Matlab How to display imshow two pictures at the same time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.