Hi,

first, a general question: Is a ptlens calibration with a=c=0 equal to a
poly3 calibration where k1=b? I was just wondering because I saw
separate code paths in mod-coord.cpp and I thought that poly3 could as
well just invoke the ptlens methods.

Now, the actual reason for my post is that I'd like to convert the
lensfun distortion calibration parameters to equivalent parameters of
the SIP model [1] used in astronomy.

The main difference is that the SIP model is not based on radius but on
the x,y (unnormalized) pixel coordinates. For both the undistorted x and
y coordinates a separate polynomial can be defined with an arbitrary
order. It seems as if it's more general than the lensfun models, hence I
thought I could map them easily.

So, basically you have x = u + f(u,v) and y = v + g(u,v) where u,v are
the original (distorted) pixel coordinates relative to the image center,
and x,y the undistorted coordinates. Therefore f and g have to provide
the amount to walk for each axis in pixels to get from the distorted
position to the undistorted one.

First, I scaled the lensfun parameters to pixels by multiplying with
imageHeight/2.

Then, for poly3:

f(u,v) = u - u*(1-k1+k1(u^2+v^2)) = k1*u - k1*u*v^2 - k1*u^3
g(u,v) = k1*v - k1*u^2*v - k1*v^3

So that was simple. I haven't actually tested it, but it looks right.

For poly5:

f(u,v) = -k1*u*v^2 - k1*u^3 - 2*k1*u^3*v^2 - k2*u*v^4 - k2*u^5
g(u,v) = -k1*u^2*v - k1*v^3 - 2*k1*u^2*v^3 - k2*u^4*v - k2*v^5

Also simple, but with ptlens I get into serious trouble:

f(u,v) = - a*u*v^2*sqrt(u^2+v^2) - a*u^3*sqrt(u^2+v^2)
         - b*u^3 - b*u*v^2 - c*u*sqrt(u^2+v^2) + a*u + b*u + c*u

The square roots destroy the nice polynomial form. To me it looks like
the ptlens coefficients cannot be directly transformed to the SIP model,
except for the case when a=c=0.

I would be happy if anyone could give some feedback -- maybe I
overlooked something, or just to confirm my reasoning.

Thanks for your time,
Maik

[1]
http://wise2.ipac.caltech.edu/staff/fmasci/figures_codeVdist/SIP_distortion.pdf

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Lensfun-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lensfun-users

Reply via email to