In this section the first, an introduction to the main geometric transformations of images will be covered. We will look at some examples the of scaling, translation, rotation, affine transformation, perspective transform, and cropping of images. The two key functions to perform these geometric transformations are cv2.warpAffine() and cv2.warpPerspective(). The cv2.warpAffine() function transforms the source image by using the following 2 x 3 M transformation matrix:
The cv2.warpPerspective() function transforms the source image using the following 3 x 3 transformation matrix:
In the next subsections, we will learn about the most common geometric transformation techniques, which we will learn more about when we look at the geometric_image_transformations.py script.