In this recipe, we will review two main ways to geometrically transform images: affine and perspective warps. The first one is used to remove simple geometrical transformations such as rotations, scales, translations, and their combinations, but it can't turn converging lines into parallel ones. Here, perspective transformation comes into play. It aims to eliminate perspective distortions when two parallel lines converge in perspective views. Let's find out how to use all these transformations in OpenCV.
Warping an image using affine and perspective transformations
Getting ready
Before you proceed with this recipe, you need to install the OpenCV version 3.3 (or greater) Python API package.