IMWRITE followed by IMREAD Changes Pixel Values
Afficher commentaires plus anciens
I have an image matrix
aa 150x200x3 720000 double
With pixel values 0-255
Why does this test fail :
imwrite(aa, 'aatest.png');
aanew = imread('aatest.png');
isequal(aa, aanew)
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 19 Août 2013
0 votes
I don't believe PNG is meant for doubles, though I could be wrong. Anyway I never try to save color images while in a double class unless it's to a mat file. Try casting your aa array to uint8 before you save it out. I think that's really what you want and intended anyway.
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!