Flexible perspective correction

Now that we have implemented the rigid correction, we want to get slightly better results. As discussed before, the main reason to use the perspective correction is to find the four corner points of the object of interest. In the Rigid perspective correction section, we used the estimated bounding rectangle to find the corners of the object of interest; however, as you know, every opposite side of a rectangle is parallel, and this might degrade the results of the perspective correction because parallel lines in the real world have to intersect in what is called a vanishing point when projected to the picture plane.

So, having parallel lines to estimate the corners is not our best option and we can do better by keeping ...

Get OpenCV Android Programming By Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.