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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.