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!