Tuesday, April 14, 2015

Another Application of the Four Point Algorithm


I mentioned the mathematical underlying of the Four Point Algorithm in my previous post, with an example showing tiles in the NY subway under projective distortion and the same tiles without the distortion.

Another application of this algorithm is used in stadiums, on the sidelines. You'll often see ads that appear "straight" to the viewers, although the camera is located high, on one side of the field, and thus should display major distortion.

Using the Four Point Algorithm, one can remove that distortion such that the user sees the ads as undistorted.

Here's an example:
I snapped a picture of a blank piece of paper, at an angle such that there is visible projective distortion.

I calculated the homography by clicking the 4 points of the trapeze above and putting them in correspondence with 4 points forming a rectangle of dimensions equal to the original piece of paper. If you put anything on the piece of paper, it'll undergo that homography transformation as well - hence the alien look.

Printed that picture out, and put it back in the same setting, roughly the same camera pose. The projective distortion is the inverse of the homography which produced the alien look... We end up with no distortion.

No comments:

Post a Comment