imadjust doesn't return the same image
3 ビュー (過去 30 日間)
古いコメントを表示
Sum = imadjust(Sum,[],[],1.);
This should return Sum with no changes, right? The figure is almost all white.
imshow(uint8(Sum))
figure(4)
Sum = imadjust(Sum,[],[],1.);
imshow(Sum)
0 件のコメント
回答 (2 件)
Walter Roberson
2016 年 10 月 30 日
If you had read in a uint8 image, and had used double() with it, then your Sum array would be class double with values in the range 0 to 255. imshow(uint8(Sum)) would "undo" the double() , diplaying the image in its uint8 form. But the imadjust() on the double() version of it would leave the data completely unchanged including still being double(). And you did not use uint8() on your second imshow(), so it would be trying to imshow data that is way out of range for images of class double.
For example,
Sum = double(imread('cameraman.tif'));
subplot(1,2,1)
imshow(uint8(Sum));
subplot(1,2,2)
imshow(Sum)
Image Analyst
2016 年 10 月 30 日
Use [] to fix it. Sum is a double image and any values over 1 will display as white unless you use [] to scale min to max to the range 0-255.
imshow(Sum, []);
参考
カテゴリ
Help Center および File Exchange で Computer Vision with Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!