0

I'm trying to approximate a Fisheye Lense distortion. I originally used the polynomial method described in this paper, and that worked fine for a forward transform, but I forgot that I would need some sort of interpolation so a backward transform was needed, and I would need an inverse function for this transformation, which proved problematic (I used the non alternating power sign version ie SUM( polynomial_coefficients[i] * radius^i)) so the division model didn't appear to be appropriate (and would spit out bad results if I tried to use the non alternating power version because I would be dividing by my radius). I switched to what appears to be a more accurate method (correct me if I'm wrong and provide a more accurate method) via

r_distorted = scalar * ln(1 + lambda * r_undistorted)

and

r_undistorted = (e^(r_distorted/scalar) - 1)/lambda

which was featured in the same paper. I in the source paper I didn't understand how you would ever end up with no distortion with lower values of lambda, or what the heck I was supposed to do with the scalar value. I wanted to test my code in situatiations where lense distortion was zero, however this formula does not seem to provide a way for me to set the parameters to some value where the forward transform of (r_undistorted) = r_distorted or the inverse transform (r_distorted) = r_undistorted for all r_undistorted and r_distorted. This was trivial however in the polynomial example.

Currently I have the algorithm implemented, but values of 0 for lambda and 1 for scale do not result in no distortion (indeed its obvious to see why) since 1*ln(1 - 0 *x) = 0. This source also alters the equation to be instead of terms of distance from image plane (f in the images) and tan(theta), and leaves me even more confused. It would seem that there must be another variable implicitly involved into the equation that would allow such a transformation (no transform) to happen. It also appears un-intuitive how to actually control distortion using these two equations.

In short, how do I use this equation to apply no distortion, and what do both lambda and scalar mean physically, and what do they do? Are there better methods for accuracy in approximating fisheye transform with inverse?

Krupip
  • 4,404
  • 2
  • 32
  • 54
  • @Yves Daoust what do you mean? two separate fittings? – Krupip Mar 28 '17 at 16:21
  • @YvesDaoust Sorry, I still don't understand, currently I use forward transform to get scaling values, and backward transform for linear interpolation to chose which color values go where in the final image, I don't see how I can get around not using one or the other, nor does it matter, I need both regardless. Additionally your answer didn't explain what you meant by two different fittings, the phrase 'two different fittings' means absolutely nothing to me, and 'forward and backward' as a response leaves me more clueless. – Krupip Mar 28 '17 at 19:54

0 Answers0