フィルターのクリア

Can some explain why when I tried to display two images side by side it not only didn't display the two images side by side but displayed one image that now had green in it.

1 回表示 (過去 30 日間)
I used imshowpair(I,B); (what I named the images) and it gave me one of my images with green in it. My only explanation is that the two iamges were folded on each other, but then why the green in it when they were both black and white? Please assist.
Thank you
P.S. - Still don't know how to display the images side by side

採用された回答

Geoff Hayes
Geoff Hayes 2015 年 4 月 19 日
Neo - imshowpair displays the differences between two images. The green is no doubt illustrating a difference between the two.
As for showing the two images side by side, if the images are of the same dimension (same height and width) then you could concatenate the two into a single image (matrix) and then show that combined image.
  2 件のコメント
Neo
Neo 2015 年 4 月 19 日
Why would I want to show them as a combined image if I want to show them side by side. As in next to each other not of each other.
Thanks for your response by the way
Image Analyst
Image Analyst 2015 年 4 月 19 日
They just need to be the same number of rows, not columns:
imshow([I, B]);

サインインしてコメントする。

その他の回答 (1 件)

coolguynp
coolguynp 2015 年 4 月 19 日
編集済み: coolguynp 2015 年 4 月 19 日
To display images side by side, you can use subplot. The first 2 parameters define the number of cells in the subplot grid. The last parameter defines the n^th cell of the grid arranged row-wise.
I1 = imread('.../img1');
I2 = imread('.../img2');
figure,
subplot(1,2,1); imshow(I1);
subplot(1,2,2); imshow(I2);

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by