How to show four sub sections of two images separately in a single window???
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Arshad Ali
am 12 Apr. 2017
Kommentiert: Arshad Ali
am 13 Apr. 2017
Img=read('A.jpg');
a=imresize(img,[300 200]);
Img(a)
0 Kommentare
Akzeptierte Antwort
KSSV
am 13 Apr. 2017
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)
Weitere Antworten (1)
Walter Roberson
am 12 Apr. 2017
Bearbeitet: Walter Roberson
am 12 Apr. 2017
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,:));
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!