USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::LoHighDistortionMap Class Reference

Distort/undistort focal plane coordinates. More...

#include <LoHighDistortionMap.h>

Inheritance diagram for Isis::LoHighDistortionMap:
Inheritance graph
Collaboration diagram for Isis::LoHighDistortionMap:
Collaboration graph

Public Member Functions

 LoHighDistortionMap (Camera *parent)
 Constructor for LunarOrbiterHighDistortionMap class.
 
void SetDistortion (const int naifIkCode)
 Load LO High Resolution Camera perspective & distortion coefficients.
 
virtual bool SetFocalPlane (const double dx, const double dy)
 Compute undistorted focal plane x/y for Lo High Resolution Camera.
 
virtual bool SetUndistortedFocalPlane (const double ux, const double uy)
 Compute distorted focal plane x/y for Lo High Resolution Camera.
 
std::vector< double > OpticalDistortionCoefficients () const
 Return optical distortion polynomial coefficients.
 
double ZDirection () const
 Return the direction of the focal plane Z-axis.
 
double FocalPlaneX () const
 Return distorted focal plane x.
 
double FocalPlaneY () const
 Return distorted focal plane y.
 
double UndistortedFocalPlaneX () const
 Return undistorted focal plane x.
 
double UndistortedFocalPlaneY () const
 Return undistorted focal plane y.
 
double UndistortedFocalPlaneZ () const
 Return undistorted focal plane z.
 

Protected Attributes

Camerap_camera
 
double p_focalPlaneX
 
double p_focalPlaneY
 
double p_undistortedFocalPlaneX
 
double p_undistortedFocalPlaneY
 
double p_zDirection
 
std::vector< double > p_odk
 

Private Attributes

double p_xPerspective
 Perspective correction factor in x.
 
double p_yPerspective
 Perspective correction factor in y.
 
double p_x0
 Center of distortion on x axis.
 
double p_y0
 Center of distortion on y axis.
 
std::vector< double > p_coefs
 Distortion coefficients.
 
std::vector< double > p_icoefs
 Distortion coefficients.
 

Detailed Description

Distort/undistort focal plane coordinates.

Creates a map for adding/removing optical distortions from the focal plane of the Lunar Orbiter high resolution camera.

See Also
LoHighCamera
Author
2007-06-29 Debbie A. Cook
History:

2007-06-29 Debbie A. Cook - Original version

2008-02-04 Jeff Anderson - Made change to allow for variable focal length in THEMIS IR

2008-07-25 Steven Lambright - Fixed constructor; CameraDistortionMap is responsible both for setting the p_camera protected member and calling Camera::SetDistortionMap. When the parent called Camera::SetDistortionMap the Camera took ownership of the instance of this object. By calling this twice, and with Camera only supporting having one distortion map, this object was deleted before the constructor was finished.

2011-05-03 Jeannie Walldren - Updated documentation. Removed Lo namespace wrap.

2012-07-06 Debbie A. Cook - Updated Spice members to be more compliant with Isis coding standards. References #972.

2013-02-22 Debbie A. Cook - Updated SetUndistortedFocalPlane method to reflect correction made to LookCtoFocalPlaneXY in CameraGroundMap. The adjustment for the z direction occurs in CameraGroundMap and is no needed here. Fixes Mantis ticket #1524

Definition at line 63 of file LoHighDistortionMap.h.

Constructor & Destructor Documentation

Isis::LoHighDistortionMap::LoHighDistortionMap ( Camera parent)

Constructor for LunarOrbiterHighDistortionMap class.

Define the distortion model coefficients for a Lunar Orbiter High Resolution camera.

Parameters
parentA pointer to the parent camera object
History:
2007-06-29 Debbie A. Cook Original version

Definition at line 38 of file LoHighDistortionMap.cpp.

Member Function Documentation

double Isis::CameraDistortionMap::FocalPlaneX ( ) const
inlineinherited
double Isis::CameraDistortionMap::FocalPlaneY ( ) const
inlineinherited
std::vector< double > Isis::CameraDistortionMap::OpticalDistortionCoefficients ( ) const
inherited

Return optical distortion polynomial coefficients.

Definition at line 195 of file CameraDistortionMap.cpp.

void Isis::LoHighDistortionMap::SetDistortion ( const int  naifIkCode)

Load LO High Resolution Camera perspective & distortion coefficients.

This method loads the perspective correction factors, distortion centers, and coefficients from the instrument kernel. The perspective correction factors in the NAIF instrument kernel are expected to be in the form of:

INSxxxxxxx_PERSPECTIVE_FACTORS = ( xpers, ypers)
where xxxxxxx is the instrument code (always a negative number) and
xpers and ypers are the X and Y perspective correction factors.

These factors will be used to convert from focal plane x,y to perspective-corrected x,y as follows.

pcx = FocalPlaneX * ( 1. + xpers*FocalPlaneX + ypers*FocalPlaneY); pcy = FocalPlaneY * ( 1. + xpers*FocalPlaneX + ypers*FocalPlaneY);

The distortion center coordinates (in mm) are expected to be in the form of:

INSxxxxxxx_DISTORTION_CENTER = ( xcenter, ycenter)
where xxxxxxx as is described above for the perspective factors.

The center will be used to calculate the radius of distortion in the equations below.

distX = PersCorrectedX - x0 distY = PersCorrectedY - y0

The distortion coefficients in the NAIF instrument kernel are expected to be in the form of:

INSxxxxxxx_OD_K = ( coef1, coef2, ..., coefN)
where xxxxxxx is as is described about for the perspective factors.

These coefficient will be used to convert from focal plane x,y to to undistorted x,y as follows (add equation here)

r^2 = DistX^2 + DistY^2 dr/r = k0 + k1*r^2 ux = PersCorrectedX - DistX*dr/r, similarly for uy

Parameters
naifIkCodeCode to search for in instrument kernel

Definition at line 95 of file LoHighDistortionMap.cpp.

References p_x0, p_xPerspective, p_y0, p_yPerspective, Isis::CameraDistortionMap::SetDistortion(), and Isis::toString().

Referenced by Isis::LoHighCamera::LoHighCamera().

bool Isis::LoHighDistortionMap::SetFocalPlane ( const double  dx,
const double  dy 
)
virtual

Compute undistorted focal plane x/y for Lo High Resolution Camera.

Compute undistorted focal plane x/y given a distorted focal plane x/y for the Lunar Orbiter High Resolution Camera. The polynomial used is described in the SetDistortion documentation. After calling this method, the undistorted x/y can be obtained via the UndistortedFocalPlaneX and UndistortedFocalPlaneY methods of the parent class.

Parameters
dxdistorted focal plane x in millimeters
dydistorted focal plane y in millimeters
Returns
if the conversion was successful
See Also
SetDistortion

Reimplemented from Isis::CameraDistortionMap.

Definition at line 124 of file LoHighDistortionMap.cpp.

References Isis::E(), p_x0, p_xPerspective, p_y0, and p_yPerspective.

bool Isis::LoHighDistortionMap::SetUndistortedFocalPlane ( const double  ux,
const double  uy 
)
virtual

Compute distorted focal plane x/y for Lo High Resolution Camera.

Compute distorted focal plane x/y given an undistorted focal plane x/y for the Lunar Orbiter High Resolution Camera. This method applies both a perspective error and a distortion error based on a polynomial defined in the SetDistortion method. After calling this method the distorted x/y can be obtained via the FocalPlaneX and FocalPlaneY methods.

Parameters
uxundistorted focal plane x in millimeters
uyundistorted focal plane y in millimeters
Returns
if the conversion was successful
See Also
SetDistortion
History:
2013-02-22 Debbie A. Cook - Removed signFactor since the z direction is now handled in CameraGroundMap.

Reimplemented from Isis::CameraDistortionMap.

Definition at line 174 of file LoHighDistortionMap.cpp.

References Isis::E(), p_x0, p_xPerspective, p_y0, and p_yPerspective.

double Isis::CameraDistortionMap::UndistortedFocalPlaneX ( ) const
inlineinherited
double Isis::CameraDistortionMap::UndistortedFocalPlaneY ( ) const
inlineinherited
double Isis::CameraDistortionMap::UndistortedFocalPlaneZ ( ) const
inlineinherited

Return undistorted focal plane z.

Definition at line 92 of file CameraDistortionMap.h.

References Isis::Camera::FocalLength().

Referenced by Isis::BundleAdjust::ApproximatePoint_ClosestApproach(), and Isis::Camera::SetImage().

double Isis::CameraDistortionMap::ZDirection ( ) const
inherited

Return the direction of the focal plane Z-axis.

Definition at line 201 of file CameraDistortionMap.cpp.

Member Data Documentation

std::vector<double> Isis::LoHighDistortionMap::p_coefs
private

Distortion coefficients.

Definition at line 77 of file LoHighDistortionMap.h.

std::vector<double> Isis::LoHighDistortionMap::p_icoefs
private

Distortion coefficients.

Definition at line 78 of file LoHighDistortionMap.h.

double Isis::LoHighDistortionMap::p_x0
private

Center of distortion on x axis.

Definition at line 75 of file LoHighDistortionMap.h.

Referenced by SetDistortion(), SetFocalPlane(), and SetUndistortedFocalPlane().

double Isis::LoHighDistortionMap::p_xPerspective
private

Perspective correction factor in x.

Definition at line 73 of file LoHighDistortionMap.h.

Referenced by SetDistortion(), SetFocalPlane(), and SetUndistortedFocalPlane().

double Isis::LoHighDistortionMap::p_y0
private

Center of distortion on y axis.

Definition at line 76 of file LoHighDistortionMap.h.

Referenced by SetDistortion(), SetFocalPlane(), and SetUndistortedFocalPlane().

double Isis::LoHighDistortionMap::p_yPerspective
private

Perspective correction factor in y.

Definition at line 74 of file LoHighDistortionMap.h.

Referenced by SetDistortion(), SetFocalPlane(), and SetUndistortedFocalPlane().


The documentation for this class was generated from the following files: