Regarding imwrite()

15 次查看(过去 30 天)
Samay Kumar
Samay Kumar 2011-9-2
Friends,
I want to store 3D Cartesian Co-ordinates (acquired from range-map of 376x200 size) in the image format. Let say, color image has three channels and I want to store x-coordinates of given points in red channel, y-coordinates in green channel and so on.
I tried using..
>>imwrite(cartPoints, 'cartPoints.tif')
where, size of cartPoints is (376, 200, 3).
Problem is when I read the 'cartPoints.tif', values are normalized between [0, 255] and hence the real information is lost. Can somebody help me to save the value to the image without getting normalized?
Any help would be really appreciated.

采纳的回答

David Young
David Young 2011-9-2
If you want to read the data back into MATLAB without any loss of accuracy, then use load and save rather than imwrite and imread.
If you really must use an image file format, copy the data to a uint16 array, and use an uncompressed file format that supports 16-bit data, such as .tif. To avoid loss of data you still need to ensure that the values you start with are integers that can be expressed in 16 bits.

更多回答(1 个)

Samay Kumar
Samay Kumar 2011-9-3
Thanks David, was informative.
With I can save data without loss or normalization in TIFF format.
Thanks anyhow.

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by