Image shows with imshowpair, but not with imshow
Show older comments
I am writing a function that reads an image and converts it to BW. I am able to use imshowpair to display the unedited and edited images next to each other, but can't individually show just the edited (BW) image. What should I do?
midAirImage = imread("MidAirTest.jpg");
bwImage = imbinarize(midAirImage,'adaptive','ForegroundPolarity','dark','Sensitivity',0.4);
imshowpair(midAirImage, bwImage, 'montage')
Accepted Answer
More Answers (1)
Constantino Carlos Reyes-Aldasoro
on 22 Jul 2020
You have two options, use subplots
subplot(121)
imagesc(midAirImage)
subplot(122)
imagesc( bwImage)
Alternatively you can concatenate your images like this
imagesc( [ midAirImage bwImage])

Notice that the binary will be between 0 and 1 and the original between 0 and 255 so you need to scale:
imagesc( [ midAirImage 255*bwImage])

Hope this helps to solve your problem.
Categories
Find more on Image Processing Toolbox 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!