matlab两张图片显示,matlab怎么同时显示imshow 两幅图片
matlab怎么同時(shí)顯示imshow 兩幅圖片
方法一:subplot()函數(shù)
subplot(2,1,1);
subplot(2,1,2);
分上下或者左右顯示兩張圖片...
例如:
原始圖片分兩個(gè)窗口顯示:
hehe=uint8(hehe);
figure(1)
imshow(he), title(‘原始圖像‘);%顯示原始圖像
figure(2)
imshow(hehe), title(‘SLIC分割k=400,m=40‘);%顯示超像素分割圖像
兩張圖片在一個(gè)窗口中顯示:
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()函數(shù)
使用montage()函數(shù)就可,不過(guò)要求兩幅圖像大小必須一樣的.cat是個(gè)好辦法,把2個(gè)數(shù)據(jù)連接在一起。具體使用請(qǐng)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://www.cnblogs.com/yymn/p/4589342.html
總結(jié)
以上是生活随笔為你收集整理的matlab两张图片显示,matlab怎么同时显示imshow 两幅图片的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 安装axios失败
- 下一篇: Android实训——图书管理系统