how to show two images in one figure?

12 ビュー (過去 30 日間)
liu
liu 2011 年 10 月 31 日
I used the following codes:
I1=imread('left.tiff');
I2=imread('right.tiff');
cvexShowImagePair(I1,I2,'Left image','Right image');
unfortunately, Only the right image could be seen,and
Warning: The Computer Vision System Toolbox coordinate system changed. You invoked a
function, System object, or block affected by the change. See R2011b Release Notes for
details.
> In cvstGetCoordsChoice at 64
In cvexShowImagePair>showImage at 104
In cvexShowImagePair at 50
How to modify the codes?

採用された回答

Image Analyst
Image Analyst 2011 年 10 月 31 日
Instead of cvexShowImagePair(), try
pairOfImages = [I1, I2]; % or [I1;I2]
imshow(pairOfImages);
The comma will concatenate them horizontally and the semicolon will concatenate them vertically. That way you can put them in a single axes control if you want. Otherwise use subplot() to put them into different axes, but they won't be touching each other.

その他の回答 (1 件)

Amith Kamath
Amith Kamath 2011 年 10 月 31 日
Is it really necessary to use cvexShowImagePair? This should work pretty OK:
I = imread('rice.png'); J = I; figure, subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(J)
if that's what you really meant to do!

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by