11#include "CameraFocalPlaneMap.h" 
   12#include "ClementineUvvisDistortionMap.h" 
   35                                                             double k1, 
double k2, 
double k3,
 
   36                                                             double p1, 
double p2) :
 
 
   79    double rr = x * x + y * y;
 
   87    double dtx = 
p_p1 * (rr + 2.0 * x * x) + 2.0 * 
p_p2 * x * y;
 
   88    double dty = 2.0 * 
p_p1 * x * y + 
p_p2 * (rr + 2 * y * y);
 
 
  116    double xx, yy, rr, dr;
 
  117    double xdistortion, ydistortion;
 
  118    double xdistorted, ydistorted;
 
  119    double xprevious, yprevious;
 
  124    xprevious = 1000000.0;
 
  125    yprevious = 1000000.0;
 
  127    double tolerance = 0.000001;
 
  129    bool bConverged = 
false;
 
  134    for (
int i = 0; i < 50; i++) {
 
  145      double dtx = 
p_p1 * (rr + 2.0 * xt * xt) + 2.0 * 
p_p2 * xt * yt;
 
  146      double dty = 2.0 * 
p_p1 * xt * yt + 
p_p2 * (rr + 2 * yt * yt);
 
  149      xdistortion = dr * xt + dtx;
 
  150      ydistortion = dr * yt + dty;
 
  153      xt = ux - xdistortion;
 
  154      yt = uy - ydistortion;
 
  157      xdistorted = xt + 
p_xp;
 
  158      ydistorted = yt + 
p_yp;
 
  161      if ((fabs(xt - xprevious) <= tolerance) && (fabs(yt - yprevious) <= tolerance)) {
 
 
CameraDistortionMap(Camera *parent, double zDirection=1.0)
Camera distortion map constructor.
 
double p_focalPlaneX
Distorted focal plane x.
 
double p_undistortedFocalPlaneX
Undistorted focal plane x.
 
double p_undistortedFocalPlaneY
Undistorted focal plane y.
 
double p_focalPlaneY
Distorted focal plane y.
 
double p_p2
Second coefficient of decentering distortion.
 
double p_k3
Quadratic term coefficient of radial distortion.
 
~ClementineUvvisDistortionMap()
Deconstruct the distortion map for the Clementine UVVIS instrument.
 
ClementineUvvisDistortionMap(Camera *parent, double xp, double yp, double k1, double k2, double k3, double p1, double p2)
Construct a distortion map for the Clementine UVVIS instrument.
 
double p_yp
Principal point y coordinate.
 
bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
 
double p_k2
Linear term coefficient of radial distortion.
 
double p_xp
Principal point x coordinate.
 
double p_p1
First coefficient of decentering distortion.
 
double p_k1
Constant term coefficient of radial distortion.
 
bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
 
This is free and unencumbered software released into the public domain.
 
Namespace for the standard library.