48 ClementineUvvisDistortionMap::ClementineUvvisDistortionMap(
Camera *parent,
50 double k1,
double k2,
double k3,
51 double p1,
double p2) :
94 double rr = x * x + y * y;
102 double dtx =
p_p1 * (rr + 2.0 * x * x) + 2.0 *
p_p2 * x * y;
103 double dty = 2.0 *
p_p1 * x * y +
p_p2 * (rr + 2 * y * y);
131 double xx, yy, rr, dr;
132 double xdistortion, ydistortion;
133 double xdistorted, ydistorted;
134 double xprevious, yprevious;
139 xprevious = 1000000.0;
140 yprevious = 1000000.0;
142 double tolerance = 0.000001;
144 bool bConverged =
false;
149 for (
int i = 0; i < 50; i++) {
160 double dtx =
p_p1 * (rr + 2.0 * xt * xt) + 2.0 *
p_p2 * xt * yt;
161 double dty = 2.0 *
p_p1 * xt * yt +
p_p2 * (rr + 2 * yt * yt);
164 xdistortion = dr * xt + dtx;
165 ydistortion = dr * yt + dty;
168 xt = ux - xdistortion;
169 yt = uy - ydistortion;
172 xdistorted = xt +
p_xp;
173 ydistorted = yt +
p_yp;
176 if ((fabs(xt - xprevious) <= tolerance) && (fabs(yt - yprevious) <= tolerance)) {
double p_focalPlaneX
Distorted focal plane x.
double p_p1
First coefficient of decentering distortion.
double p_k2
Linear term coefficient of radial distortion.
Namespace for the standard library.
double p_yp
Principal point y coordinate.
double p_undistortedFocalPlaneX
Undistorted focal plane x.
~ClementineUvvisDistortionMap()
Deconstruct the distortion map for the Clementine UVVIS instrument.
double p_xp
Principal point x coordinate.
Distort/undistort focal plane coordinates.
double p_k1
Constant term coefficient of radial distortion.
double p_focalPlaneY
Distorted focal plane y.
double p_undistortedFocalPlaneY
Undistorted focal plane y.
bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
double p_p2
Second coefficient of decentering distortion.
Namespace for ISIS/Bullet specific routines.
double p_k3
Quadratic term coefficient of radial distortion.
bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.