- 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)
'Programming > MATLAB' 카테고리의 다른 글
[MATLAB] MATLAB Theme 적용 (0) | 2019.04.02 |
---|---|
[MATLAB] Imfreehand Roi Image (0) | 2019.03.12 |
[MATlLAB] GUI환경에서 변수 저장하기 - assignin (0) | 2018.04.26 |
[MATLAB] Figure Window Name 바꾸기 (0) | 2018.03.23 |
[MATLAB] MATLAB 코드 단축키 (0) | 2018.03.13 |