Image-Process [MATLAB] Matlab Figure을 이용한 Zoom기능

[MATLAB] Matlab Figure을 이용한 Zoom기능

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Img1 = imread(‘peppers.png’);
Img1=imresize(Img1,[256 256]);
 
f=figure;
imshow(Img1);
rect = getrect(f); %//select roi with mouse
Img1_roi = Img1( rect(2) : (rect(2)+rect(4)) , rect(1) : (rect(1)+rect(3)) , : ); %//store roi in matrix
 
Img2 = imread(‘coins.png’);
Img2= imresize(Img2,[256 256]);
 
f=figure;
imshow(Img2);
rect = getrect(f); %//select roi with mouse
Img2_roi = Img2( rect(2) : (rect(2)+rect(4)) , rect(1) : (rect(1)+rect(3)) , : ); %//store roi in matrix
 
%//Plot
subplot(2,2,1)
imshow(Img1)
subplot(2,2,2)
imshow(Img2)
subplot(2,2,3)
imshow(Img1_roi)
subplot(2,2,4)
imshow(Img2_roi)
cs

Leave a Reply

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Related Post

[MATLAB] Changing colors in 3D Graphs[MATLAB] Changing colors in 3D Graphs

가끔 Figure에 이미지 혹은 Plot 데이터를 서로 다른 Colormap 을이용하여 분석할때 유용한 Coloramp 사용 방법이다. z=5*sin(x).*cos(y); ax1=subplot(2,2,1); mesh(x,y,z) colormap(ax1,parula) title('Default colormap(parula)') ax2=subplot(2,2,2); mesh(x,y,z) colormap(ax2,jet) title('Colormap(jet)') ax3=subplot(2,2,3); colormap(ax3,bone) mesh(x,y,z) title('Colormap(bone)') ax4=subplot(2,2,4);