필터 지우기
필터 지우기

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)

채택된 답변

KSSV
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
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 CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by