주요 콘텐츠

affine2d

(권장되지 않음) 후위곱 규칙을 사용하는 2차원 아핀 기하 변환

affine2d는 권장되지 않습니다. 대신 affinetform2d 객체를 사용하십시오. 자세한 내용은 버전 내역 항목을 참조하십시오.

설명

affine2d 객체는 후위곱 규칙을 사용하여 2차원 아핀 기하 변환에 대한 정보를 저장하며, 순방향 및 역방향 변환을 적용합니다.

생성

설명

tform = affine2d는 항등 변환에 해당하는 디폴트 속성 설정을 사용하여 affine2d 객체를 만듭니다.

tform = affine2d(t)는 속성 T를 지정된 2차원 아핀 변환 행렬 t로 설정합니다.

예제

속성

모두 확장

순방향 2차원 아핀 변환으로, 3×3 숫자형 정칙 행렬로 지정됩니다. 행렬 T는 다음과 같은 규칙을 사용합니다.

[x y 1] = [u v 1] * T

T는 다음과 같은 형태를 갖습니다.

 [a b 0;
  c d 0;
  e f 1];

T의 디폴트 값은 항등 변환입니다.

데이터형: double | single

읽기 전용 속성입니다.

입력 점과 출력 점에 대한 기하 변환의 차원 수로, 값 2로 지정됩니다.

객체 함수

invert역 기하 변환
isRigidDetermine if geometric transformation is rigid transformation
isSimilarityDetermine if geometric transformation is similarity transformation
isTranslationDetermine if geometric transformation is pure translation
outputLimitsFind output spatial limits given input spatial limits
transformPointsForwardApply forward geometric transformation
transformPointsInverseApply inverse geometric transformation

예제

모두 축소

원점을 중심으로 시계 반대 방향으로의 30도 회전을 정의하는 affine2d 객체를 만듭니다.

theta = 30;
tform = affine2d([ ...
    cosd(theta) sind(theta) 0;...
    -sind(theta) cosd(theta) 0; ...
    0 0 1])
tform = 
  affine2d with properties:

                 T: [3×3 double]
    Dimensionality: 2

점 (10,0)에 순방향 기하 변환을 적용합니다.

[x,y] = transformPointsForward(tform,10,0)
x = 
8.6603
y = 
5

원래 점은 파란색으로, 변환된 점은 빨간색으로 플로팅하여 변환된 결과를 확인합니다.

plot(10,0,'bo',x,y,'ro')
axis([0 12 0 12])
axis square

Figure contains an axes object. The axes object contains 2 objects of type line. One or more of the lines displays its values using only markers

영상을 작업 공간으로 읽어 들입니다.

A = imread('pout.tif');

아핀 기하 변환을 정의하는 affine2d 객체를 만듭니다. 다음 예제는 세로 전단과 가로 늘이기를 결합합니다.

tform = affine2d([2 0.33 0; 0 1 0; 0 0 1])
tform = 
  affine2d with properties:

                 T: [3×3 double]
    Dimensionality: 2

imwarp를 사용하여 영상에 기하 변환을 적용합니다.

B = imwarp(A,tform);

결과 영상을 표시합니다.

figure
imshow(B);
axis on equal;

Figure contains an axes object. The axes object contains an object of type image.

확장 기능

모두 확장

버전 내역

R2013a에 개발됨

모두 확장