Regarding imwrite()
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
David Young
le 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 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!