imadjust doesn't return the same image
1 view (last 30 days)
Show older comments
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 Comments
Answers (2)
Walter Roberson
on 30 Oct 2016
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
on 30 Oct 2016
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, []);
See Also
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!