image read and write problem
이전 댓글 표시

Sometimes imwrite and imread work OK, but often not. In that case in stead of numbers between 0 and 255 (RGB tif file) all numbers become 0 or 255. Nothing in between. I can't find a problem and I can't find a system in what's going wrong. Any hints? You can see in the picture waht happens. It's a very tiny tif-file, all code you can see and after write and read it's damaged. Only red shown, blue and green the same.
댓글 수: 7
Walter Roberson
2020년 7월 13일
imwrite would write binary images that way for most image types.
Weia Reinboud
2020년 7월 13일
Image Analyst
2020년 7월 14일
Weia's "Answer" moved here:
All documentation suggests to use imwrite... Why doesn't it work? I'm quite desperate.
Image Analyst
2020년 7월 14일
Weia, make it easy for us to help you. Attach your srijf2 variable in a .mat file. An image does me no good in replicating your code. I don't want to type all that in, so please just give it to me in a .mat file.
save('answers.mat', 'srijf2');
Also tell us what the class of srijf2 is. Is it uint8? Or is it double?
Weia Reinboud
2020년 7월 14일
Weia Reinboud
2020년 7월 14일
Weia Reinboud
2020년 7월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!