How to show four sub sections of two images separately in a single window???
1 次查看(过去 30 天)
显示 更早的评论
Img=read('A.jpg');
a=imresize(img,[300 200]);
Img(a)
0 个评论
采纳的回答
KSSV
2017-4-13
I=imread('peppers.png');
imshow(I)
%%split the image into four parts
[m,n,p] = size(I) ;
I1 = imcrop(I,[1,1,m/2,n/2]) ;
I2 = imcrop(I,[m/2,1,m,n/2]) ;
I3 = imcrop(I,[1,n/2,m/2,n]) ;
I4 = imcrop(I,[m/2,n/2,m,n]) ;
figure
subplot(221)
imshow(I1)
subplot(222)
imshow(I2)
subplot(223)
imshow(I3)
subplot(224)
imshow(I4)
更多回答(1 个)
Walter Roberson
2017-4-12
编辑:Walter Roberson
2017-4-12
Remove the line Img(a) as that is wrong. Then
subplot(2,2,1)
imshow(a(1:150,1:100,:));
subplot(2,2,2),
imshow(a(1:150,101:200,:));
subplot(2,2,3)
imshow(a(151:300,1:100,:));
subplot(2,2,4)
imshow(a(151:300,101:200,:));
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!