Regarding imwrite()
15 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File 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!