Euclidean transformation: Euclidean transformation preserves the length and Angle of the vector, which is equivalent to moving and rotating a rigid body intact without changing its appearance

Similar transformation: than it is equivalent to isometric transformation and uniform scaling of a compound, with S to represent the transformation matrix, S is a 3×3 matrix, one more degree of freedom than the Euclidean transformation, Allow the object to scale evenly S={{sr11,sr12,tx},{sr21,sr22,ty},{0,0,1}} upper left 2×2 matrix is the rotation part,tx and ty are translation factors, it has 4 degrees of freedom, namely rotation, x direction translation, y direction translation and scaling factor S. Before and after the similarity transformation, the length ratio, included Angle, imaginary dot I,J remain unchanged.

Affine transformation and projective transformation: The projective transformation forms a group, which is called the projective transformation group. The n× N invertible real matrix is called the general linear group GL(n). When all matrices of phase difference nonzero scalar factors are treated as equal, the projective mapping group is obtained, which is denoted as PL(n). In the plane, the projective transformation is PL(3). The projective transformation in the form of a transformation matrix in the plane, which is a 3 by 3 matrix. Among them, when the last behavior of the above matrix is (0,0,1), the transformation is affine transformation. Before affine, it is Euclidean transformation when the upper left corner 2×2 matrix is orthogonal, and oriented Euclidean transformation when the upper left corner matrix determinant is 1. So projective transformations include affine transformations, and affine transformations include Euclidean transformations. So now we have the relationship between projective transformations and affine transformations. We divide the above matrix into several parts as follows: The four elements in the large rectangle represent linear transformations as a whole, such as Scaling, shearing and ratotion; The ellipse represents the parameters of the translation, one that is fixed in the x direction and one that is fixed in the y direction; The small rectangle is used to create perspective transformations. From this it can be understood that affine and so on are special forms of perspective transformation. The composition of A translation transformation (t) and A nonuniform transformation (A), which is invertible, does not have to be orthogonal. Invariants of affine transformation are: parallel lines, proportion of length of parallel lines and proportion of area degree of freedom 12 (9+3). It can be seen that affine transformation is rotation, translation, scaling and shear of the image. Compared with the first two transformations, the shape of the image has changed, but the parallel lines in the original image still remain parallel. Projective transformation (perspective transformation) An affine transformation is a general nonsingular linear transformation of the homogeneous coordinates of a point in an image whose invariants are: coincidence relation, degree of freedom of intersection of length 15 (the whole matrix divided by v is 1 at the lower right corner) and last behavior 0 0 0 1

im = imread('D:/ CVPR/job 1/ experiment 1/ test.jpeg'); % read a graph degree=30; %degree = degree [r,c,d]=size(im); I=im2double(im); D nH=round(r*abs(cosd(degree))+c* ABS (sIND (degree))); NW =round(c*abs(cosd(degree))+r*abs(degree)); % New width of rotated image A= Zeros (nH,nW,d); % defines the row and row of the target image and the number of channels delX =50; % translation X delY is equal to100; % shift Y beis is equal to1.5;
deis=2
tras = [beis 0 0; 0 deis 0; delX delY 1];
M1=[1 0 0;0 -1 0; -0.5*nW 0.5*nH 1]; M2=[cosd(degree) -sind(degree)0; sind(degree) cosd(degree)0;0 0 1]; % Angle rotation transformation matrix M2, I used the clockwise direction M3=[1 0 0;0 -1 0;0.5*c 0.5*r 1]; Coordinate system transformation matrix M3for i=1:nW
        for j=1:nH
            temp=[i j 1]*M1*M2*M3*tras; % to obtain the rotated matrix temp y=temp(1.2); %y take the first row and second column of the matrix temp,y corresponds to j, is the height x=temp(1.1); Y =round(y); y=round(y); y=round(y); %y =round(x); %x is roundedif(x>=1&&x<=c)&&(y>=1A(j, I,:)=I(y,x,:); &&y<=r) % End % (" A(I,j,:)=B(x,y,:); I,x, j,y, j,y, j,y, j,y, j,y, j,y, j,y, j,y, j,y, j,y, j,y0.'defaultFigurePosition'[100.100.1000.500]); % window size set(0.'defaultFigureColor'[1 1 1]); % Set window color figure; % Opens a window to display (multiple) image subplot(1.2.1), imshow(I),axis on ; % display image, one row, two columns, first subplot(1.2.2), imshow(A),axis on; % display picture, one line, two columns, secondCopy the code