I have a Matlab dataset saved with .mat
that I'm trying to process in Octave GUI. The data consist of images and I want to save them in a JPG format (or any other image format), but I'm having this strange behavior when trying to displaying or writing the images.
this is how part of the image displays as an array:
91 90 91 88 93
88 91 86 81 88
93 100 90 85 91
93 100 94 93 96
87 87 87 87 89
But when I write the image
imwrite(img, 'D:image_test_1.jpg')
and read it again
img_read=imread('D:image_test_1.jpg')
I end up with this:
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
I tried searching for the cause, but couldn't find a definitive answer or clarification to this problem. Even when I'm using imshow
to display the image I end up with a blank image.
What happened to all the pixel values?
question from:
https://stackoverflow.com/questions/65879604/imshow-imwrite-changes-all-pixel-values-to-1 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…