matlab两张图片显示,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‘); %显示超像素分割图像

6b9b9ed1e58fc8fd537a9bd39a99f99c.png

方法二: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);

水平排列:

1f749422ae5e91fe3c94f1ea41f65e5d.png

垂直排列:

621e0857a67a5c4f202f077a7dddfc0b.png

原文:http://www.cnblogs.com/yymn/p/4589342.html

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值