Geometric transforms look up each output pixel at a position (x, y) of the original image that is almost never an integer. Interpolation estimates the value there from the neighbouring pixels.
Nearest neighbour
Linear (bilinear)
Cubic (bicubic)
Empty areas (borders)
When the position falls outside the original image: Black uses 0; Repeat edge uses the nearest edge pixel (aaa|abcd|ddd); Mirror reflects the image at the edge (cba|abcd|dcb).
See also: Rotate, Affine transform (3 points), Perspective transform (4 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. Keys. "Cubic convolution interpolation for digital image processing." IEEE Transactions on Acoustics, Speech, and Signal Processing, 29(6):1153–1160, 1981.
- R. C. Gonzalez, R. E. Woods. Digital Image Processing, 4th ed. Pearson, 2018.