Regarding imwrite()
14 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
David Young
on 2 Sep 2011
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.
0 Comments
More Answers (1)
See Also
Categories
Find more on Read, Write, and Modify Image in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!