Computer vision is to make the computer understand the image and video, the purpose of this series of blog is to deepen their learning computer vision in the process of understanding and review of relevant knowledge. Many of the contents refer to: Textbook "Computer vision:algorithms and Applications", textbook "Learning Image Processing with OpenCV" reference book "Learning OpenCV" , the curriculum of foreign universities, "computer vision" and the course "Computer vision".
The difference between image filtering and image transformation is that the image filter changes the value of the pixel itself and the image geometry changes the spatial distribution of the image. Given a pair of image f (x), the image filtering and image geometric transformation, has the following relationship:
Common image geometric transformations include: pan, rotate, European (pan + Rotate), similar (zoom rotation + pan), affine, and projection transforms. As shown in the following illustration:
With homogeneous coordinate system, all of these transformations can be attributed to a 3 x 3 transformation matrix, except for the projection transformation, the last line in the rest of the transformation matrix is [0 0 1]. Such as
Such transformations can be collectively referred to as affine transformations, expressed by the following formula:
Has the following properties:
1. The image origin does not necessarily map to the origin of the image (because there is a translation)
2. Line map to Straight line
3. Parallel lines are still parallel after mapping
4. The proportions of the graphs remain the same
5. The sealing of the image remains closed after the closed image map is maintained.
In OpenCV, an affine transformation of an image is possible by using the function Warpaffine.
When the last row is not [0 0 1], such transformations are called Projection transformations (or single-should transformations), and the corresponding transformation matrices are:
In contrast to affine transformations, the parallel lines are not necessarily parallel after the projection transformation, and the basic proportions of the graphs do not necessarily persist.
In OpenCV, you can cast transformations on an image by using the function warpperspective.