Here we go I have updated my code, i.e added some comments to it… It produces a fish eye effect described by Jason Waltman based on the paper:
To be fair I have only glanced at the paper because I already had the algorithm to do the fish eye effect I wanted, but it seems to go more in depth. Specifically it seems to discuss methods to determine if an image has been distored, and how to correct that image into a normal pin hole camera model (i.e a normal looking image like those used to view an eclipse).I have not noticed any additional copyright information on reproducing the abstract above, nor for examining Jason Waltmans works.Anyway click Here for the cs
“Devernay, F., and O. Faugeras. Straight Lines Have to Be Straight. 2001. 13 March 2001. http://devernay.free.fr/publis/distcalib-mva.pdf.
Most algorithms in 3D computer vision rely on the pinhole camera model because of its simplicity, whereas video optics, especially low-cost wide-angle or fish-eye lenses, generate a lot of non-linear distortion which can be critical. To find the distortion parameters of a camera, we use the following fundamental property: a camera follows the pinhole model if and only if the projection of every line in space onto the camera is a line. Consequently, if we find the transformation on the video image so that every line in space is viewed in the transformed image as a line, then we know how to remove the distortion from the image. The algorithm consists of first doing edge extraction on a possibly distorted video sequence, then doing polygonal approximation with a large tolerance on these edges to extract possible lines from the sequence, and then finding the parameters of our distortion model that best transform these edges to segments. Results are presented on real video images, compared with distortion calibration obtained by a full camera calibration method which uses a calibration grid.