zoukankan      html  css  js  c++  java
  • matlab怎么同时显示imshow 两幅图片

    matlab怎么同时显示imshow 两幅图片

    matlab怎么同时显示imshow 两幅图片

    方法一:subplot()函数

    subplot(2,1,1);

    subplot(2,1,2);

    分上下或者左右显示两张图片...

    例如:

    原始图片分两个窗口显示:

    hehe=uint8(hehe);

    figure(1)

    imshow(he), title('原始图像');%显示原始图像

    figure(2)

    imshow(hehe), title('SLIC分割k=400,m=40');%显示超像素分割图像

    两张图片在一个窗口中显示:

    hehe=uint8(hehe);

    figure(1)

    subplot(2,1,1);imshow(he),title('原始图像'); %显示原始图像

    %figure(2)

    subplot(2,1,2);imshow(hehe),title('SLIC分割k=400,m=40'); %显示超像素分割图像

     

    方法二:montage()函数

    使用montage()函数就可,不过要求两幅图像大小必须一样的.cat是个好办法,把2个数据连接在一起。具体使用请help montage.图示中的例子的代码如下:

    gray01=rgb2gray(imread('img01.jpg'));
    gray02=rgb2gray(imread('img12.jpg'));
    pic=cat(2,gray01,gray02);
    figure;

    montage(pic)

    水平排列:

    pic=cat(2,gray01,gray02);

    figure, imshow(pic);

    垂直排列:

    pic=cat(1,gray01,gray02);

    figure, imshow(pic);

    街上上述例子程序如下:

    imshow(he), title('原始图像'); %显示原始图像

    imshow(hehe), title('SLIC分割k=400,m=40');

    pic=cat(2,he,hehe);

    figure, imshow(pic);

    水平排列:

     

    垂直排列:

     

    更多,请关注:http://blog.csdn.net/tiandijun/,欢迎交流!

  • 相关阅读:
    前端 -- html
    MySQL索引
    Python操作MySQL
    MySQL表操作进阶
    MySQL表操作基础
    Github使用教程
    Android开发面试题
    MYSQL学习记录
    Java开发从零到现在
    JavaWeb(JSP/Servlet/上传/下载/分页/MVC/三层架构/Ajax)
  • 原文地址:https://www.cnblogs.com/yymn/p/4589342.html
Copyright © 2011-2022 走看看