Matlab How to display imshow two pictures at the same time
Matlab How to display imshow two pictures at the same time
Method One: Subplot () function
Subplot (2,1,1);
Subplot (2,1,2);
Show two pictures up or down or left or right ...
For example:
The original picture is displayed in two windows:
Hehe=uint8 (hehe);
Figure (1)
Imshow (He), title (' original image ');% Display original image
Figure (2)
Imshow (hehe), title (' Slic split k=400,m=40 ');% display hyper-pixel segmented image
Two pictures are displayed in a window:
Hehe=uint8 (hehe);
Figure (1)
Subplot (2,1,1); Imshow (He), title (' original image '); % Display Original image
%figure (2)
Subplot (2,1,2); Imshow (hehe), title (' Slic Division k=400,m=40 '); % display of hyper-pixel segmented images
Method Two:montage () function
Use the montage () function, but the two images must be the same size. Cat is a good way to connect 2 of data together. For specific use please help montage. The code for the example in the illustration is as follows:
Gray01=rgb2gray (Imread (' img01.jpg '));
Gray02=rgb2gray (Imread (' img12.jpg '));
Pic=cat (2,GRAY01,GRAY02);
Figure
Montage (pic)
Horizontal arrangement:
Pic=cat (2,GRAY01,GRAY02);
Figure, Imshow (pic);
Vertical arrangement:
Pic=cat (1,GRAY01,GRAY02);
Figure, Imshow (pic);
The above example procedure on the street is as follows:
Imshow (He), title (' original image '); % Display Original image
Imshow (hehe), title (' Slic split k=400,m=40 ');
Pic=cat (2,he,hehe);
Figure, Imshow (pic);
Horizontal arrangement:
Vertical arrangement:
More, please pay attention: http://blog.csdn.net/tiandijun/, Welcome to Exchange!
Matlab How to display imshow two pictures at the same time