Commit efed59b6 authored by Stuart Sides's avatar Stuart Sides
Browse files

Updated Distortion to subtract the distortion when going from distorted to...

Updated Distortion to subtract the distortion when going from distorted to undistorted and the opposite for undistorted to distorted.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6572 41f8697f-d340-4b68-9986-7bafba869bb8
parent 5e1f4b7c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,5 +33,5 @@ DeltaSample = 0.000000000
DeltaLine = 0.000000000

For center pixel position ...
Latitude OK
Longitude OK
Latitude off by: 0.0255589466259298
Longitude off by: 0.0032366246724109
+17 −5
Original line number Diff line number Diff line
@@ -72,7 +72,18 @@ namespace Isis {
    double rr = x * x + y * y;

    // dr is the radial distortion contribution
    double dr = 1.0 + rr * p_e2 + y * p_e5 + x * p_e6;
    // The equation below was changed from all + to all - to adjust the distortion model to fit
    // the definition of the LORRI distortion. The original version with +, was defined from Bill
    // Owen's paper with an assumption the xs and ys in the equations were distorted x,ys. After
    // meeting with the LORRI team +s were changed to -s to account for the x,ys actually being
    // undistorted focal plane positions. That is, the undistorted focal plane positions are
    // closer to the center of the image than the distorted focal plane positions.
    // NOTE: The discussions showed the Ky and e5 values needed to be negated. The e5 value has
    // now been negated in the LORRI IK, and the y is now negated in the equation below.
    // NOTE: The Y and Line values can not be negated in the transY and transL affines because
    // this would cause the p_xxxxx class member variables to be in a flipped (top to bottom) 
    // coordinate system relative to the SPICE defined focal plane coordinate system.
    double dr = 1.0 - rr * p_e2 - y * p_e5 - x * p_e6;

    // Image coordinates corrected for distortion
    p_undistortedFocalPlaneX = x * dr;
@@ -130,12 +141,13 @@ namespace Isis {
      ydistortion = yt * rr * p_e2 + yy * p_e5 + xy * p_e6;

      // Updated image coordinates
      xt = ux - xdistortion;
      yt = uy - ydistortion;
      // Changed to + instead of -. See comment in SetFocalPlane above
      xt = ux + xdistortion;
      yt = uy + ydistortion;

      // Distorted point corrected for principal point
      xdistorted = xt; // No PP for Lorrie
      ydistorted = yt; // No PP for Lorrie
      xdistorted = xt; // No PP for LORRI
      ydistorted = yt; // No PP for LORRI

      // Check for convergence
      if ((fabs(xt - xprevious) <= tolerance) && (fabs(yt - yprevious) <= tolerance)) {
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ namespace Isis {
   *    @history 2014-06-08 Staurt Sides - Original version. Equations and coefficients
   *    taken from Jet Propulsion Laboratory Interoffice Memorandum 2011/06/08 "New Horizons
   *    LORRI Geometric Calibration of August 2006" From: W. M. Owen Jr. and D. O'Coonnell
   *  
   *    @history 2016-02-24 Staurt Sides - New Horizons LORRI distortion model changed to
   *    subtract the distortion when going from distorted to undistorted instead of adding, and
   *    adding the distortion when going from undistorted to destorted.
   */
  class NewHorizonsLorriDistortionMap : public CameraDistortionMap {
    public: