Homography: the mapping between two views of a plane taken from different points. It preserves straight lines but not parallelism (parallel lines may converge to a vanishing point). Useful to straighten documents, façades or boards photographed at an angle.
As with the affine transform, cv::warpPerspective computes each destination pixel with the inverse transform H−1 and interpolates it. The result keeps the image size.
Parameters
| Parameter | Meaning |
|---|---|
| Interpolation | How values at non-integer positions are computed. |
| Empty areas | Value of pixels that fall outside the original image. |
See also: Interpolation and borders, Affine transform (3 points)
References
- OpenCV 4.x documentation — Geometric Image Transformations (warpAffine, warpPerspective, getAffineTransform, getPerspectiveTransform, getRotationMatrix2D, interpolation flags). docs.opencv.org/4.x/da/d54/group__imgproc__transform.html
- R. Hartley, A. Zisserman. Multiple View Geometry in Computer Vision, 2nd ed. Cambridge University Press, 2004.
- R. Szeliski. Computer Vision: Algorithms and Applications, 2nd ed. Springer, 2022. szeliski.org/Book/