An affine transformation is the process of transforming a vector space into another vector space by performing a linear transformation (multiplying by a matrix) and adding a translation (adding a vector).
The WarpAffine operator functions as an affine transformation of the input picture, including planar operations such as picture rotation, scaling, and translation. Project the picture as any parallelogram.
The operator maps the input picture in the form of affine by means of a transformation matrix parameter of size 2X3 with the following mapping relation:
[XY]=[acbd][xy]+[ef]
Among them x,y are the input image pixel coordinates, X,Y are the output image pixel coordinates, and a,b,c,d,e,f are the transformation matrices.
For the input picture, it is decomposed into multiple sub-pictures (red areas in the figure below) during the accelerated computation process, and each sub-picture has an independent mapping relationship, and the conversion coefficients are consistent with the original picture. The display is shown below:
Where the right side is the input picture and the left side is the output picture.