crop
설명
예제
다중 해상도 영상 자르기
툴박스에 포함된 샘플 영상에서 블록 형식 영상을 만듭니다.
bim = blockedImage('tumor_091R.tif');
figure
bigimageshow(bim);
영상 크기와 세계 좌표 속성을 검사합니다.
bim.Size
ans = 3×3
5000 5358 3
1250 1340 3
625 670 3
bim.WorldStart
ans = 3×3
0.5000 0.5000 0.5000
0.5000 0.5000 0.5000
0.5000 0.5000 0.5000
bim.WorldEnd
ans = 3×3
103 ×
5.0005 5.3585 0.0035
5.0005 5.3585 0.0035
5.0005 5.3585 0.0035
영상에서 자르기 영역이 되는 관심 영역을 정의합니다.
hrect = drawrectangle('Position', [2280 1300 1024 800]);
영역의 세계 좌표를 얻습니다.
wstartxy = hrect.Position(1:2); wendxy = wstartxy + hrect.Position(3:4);
행-열 순서로 변환하고 마지막 차원의 세계 좌표를 포함합니다.
wstart = [wstartxy(2), wstartxy(1), bim.WorldStart(1,3)]; wend = [wendxy(2), wendxy(1), bim.WorldEnd(1,3)];
영상 첨자로 변환합니다. 이는 디폴트가 아닌 세계 좌표를 사용할 때 편리한 선택적 단계입니다.
subs = world2sub(bim, [wstart; wend]); cbim = crop(bim, subs(1,:), subs(2,:));
잘라낸 영상의 속성을 검사합니다.
cbim.Size
ans = 3×3
801 1025 3
201 258 3
101 130 3
cbim.WorldStart
ans = 3×3
103 ×
1.2995 2.2795 0.0005
1.2965 2.2757 0.0005
1.2965 2.2717 0.0005
figure
% Axes limits reflect cropped coordinates
bigimageshow(cbim);
입력 인수
bim
— 블록 형식 영상
blockedImage
객체
블록 형식 영상으로, blockedImage
객체로 지정됩니다.
cstart
— 자르기 창의 첫 번째 픽셀
1×N 정수 값 벡터
픽셀 첨자에서 자르기 창의 첫 번째 픽셀로, N차원 blockedImage
에 대한 1×N 정수 값 벡터로 지정됩니다. cstart
에 요소가 N개 미만이면 blockedImage
는 1로 확장합니다.
cend
— 자르기 창의 마지막 픽셀
1×N 정수 값 벡터
픽셀 첨자에서 자르기 창의 마지막 픽셀로, 1×N 정수 값 벡터로 지정됩니다. cend
에 요소가 N개 미만이면 blockedImage
는 가장 세밀한 수준의 Size
에 있는 해당하는 요소를 사용하여 영상을 확장합니다.
출력 인수
cbim
— 잘라낸 블록 형식 영상
blockedImage
객체
잘라낸 블록 형식 영상으로, 모든 해상도 수준에서 자르기 창에 영상 데이터를 포함하는 blockedImage
객체로 반환됩니다.
버전 내역
R2021a에 개발됨
참고 항목
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)