Originally posted by rpriedhorsky I poked around a little on ye olde Internet and found a hint that the fisheye image mapping is so different from that of rectilinear lenses that the polynomial correction model doesn't apply and won't work.

True? Before debugging my Bibble problem further, I want to figure out if there's a fundamental reason it won't work (and I should pursue a different de-fish path).

Thanks,

Reid

There are two problems you might be running into:

**(1) Bibble and Hugin may apply parameters differently:** *a*,

*b*, and

*c* specify a polynomial describing how your lens differs from either an ideal rectilinear lens or an ideal fisheye lens, depending on the lens type you specify. If you're using hugin to calculate

*a*,

*b*, and

*c* for the fisheye model, and Bibble applies

*a*,

*b*, and

*c* to the rectilinear model, you will get a different result.

**(2) Polynomial approximations of trigonometric functions suck:**
So why can't you just find

*a*,

*b*, and

*c* to do the fisheye-to-rectilinear mapping, and avoid having a special fisheye lens model?

De-fishing and barrel distortion correction both require computing the distance

*r_src* from the center of the input image that corresponds to

*r_dest* in the output image. For simple barrel distortion correction, you can usually find a polynomial that works, but for de-fishing the mapping function is

*r_src* = 2 sin(arctan(

*r_dest*)/2).

(Here I'm assuming that the units are scaled so that the focal length of the lens is 1).

You can approximate this function with a polynomial for a small range of values of

*r_dest* near zero, but any polynomial approximation will fail for larger values (think about what happens to

*r_src* when

*r_dest* gets large).