USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::TaylorCameraDistortionMap Class Reference

Distort/undistort focal plane coordinates. More...

#include <TaylorCameraDistortionMap.h>

Inheritance diagram for Isis::TaylorCameraDistortionMap:
Inheritance graph
Collaboration diagram for Isis::TaylorCameraDistortionMap:
Collaboration graph

Public Member Functions

 TaylorCameraDistortionMap (Camera *parent, double zDirection=1.0)
 Taylor series camera distortion map constructor.
 
void SetDistortion (const int naifIkCode)
 Load distortion coefficients.
 
 ~TaylorCameraDistortionMap ()
 Destructor.
 
bool SetFocalPlane (const double dx, const double dy)
 Compute undistorted focal plane x/y.
 
bool SetUndistortedFocalPlane (const double ux, const double uy)
 Compute distorted focal plane x/y.
 
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 Member Functions

void DistortionFunction (double ux, double uy, double *dx, double *dy)
 Compute distorted focal plane dx,dy given an undistorted focal plane ux,uy.
 
void DistortionFunctionJacobian (double x, double y, double *Jxx, double *Jxy, double *Jyx, double *Jyy)
 Jacobian of the distortion function.
 

Protected Attributes

std::vector< double > p_odtx
 distortion x coefficients
 
std::vector< double > p_odty
 distortion y coefficients
 
Camerap_camera
 
double p_focalPlaneX
 
double p_focalPlaneY
 
double p_undistortedFocalPlaneX
 
double p_undistortedFocalPlaneY
 
double p_zDirection
 
std::vector< double > p_odk
 

Detailed Description

Distort/undistort focal plane coordinates.

Creates a map for adding/removing optical distortions from the focal plane of a camera. This class describes a non-radial distortion map. The distortion map is a third-order Taylor series expansion of a generic function.

See Also
MdisCamera
CameraDistortionMap
Author
????-??-?? Kris Becker
History:

2011-05-03 Jeannie Walldren - Added Isis disclaimer.

2011-05-23 Janet Barrett and Steven Lambright - Spice::GetDouble is no longer a static call.

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

Definition at line 51 of file TaylorCameraDistortionMap.h.

Constructor & Destructor Documentation

Isis::TaylorCameraDistortionMap::TaylorCameraDistortionMap ( Camera parent,
double  zDirection = 1.0 
)

Taylor series camera distortion map constructor.

Create a geometric distortion model which is approximated by a third-order Taylor series expansion. This class maps between distorted and undistorted focal plane x/y's. The default mapping is the identity, that is, the focal plane x/y and undistorted focal plane x/y will be identical.

Parameters
parentthe parent camera that will use this distortion map
zDirectionthe direction of the focal plane Z-axis (either 1 or -1)

Definition at line 41 of file TaylorCameraDistortionMap.cpp.

Isis::TaylorCameraDistortionMap::~TaylorCameraDistortionMap ( )
inline

Destructor.

Definition at line 58 of file TaylorCameraDistortionMap.h.

Member Function Documentation

void Isis::TaylorCameraDistortionMap::DistortionFunction ( double  ux,
double  uy,
double *  dx,
double *  dy 
)
protected

Compute distorted focal plane dx,dy given an undistorted focal plane ux,uy.

This describes the third order Taylor approximation to the distortion model.

Parameters
uxUndistored x
uyUndistored y
dxResult distorted x
dyResult distorted y

Definition at line 215 of file TaylorCameraDistortionMap.cpp.

References p_odtx, and p_odty.

Referenced by SetFocalPlane(), and SetUndistortedFocalPlane().

void Isis::TaylorCameraDistortionMap::DistortionFunctionJacobian ( double  x,
double  y,
double *  Jxx,
double *  Jxy,
double *  Jyx,
double *  Jyy 
)
protected

Jacobian of the distortion function.

The Jacobian was computed algebraically from the function described in the DistortionFunction method.

Parameters
x
y
Jxx
Jxy
Jyx
Jyy

Definition at line 251 of file TaylorCameraDistortionMap.cpp.

References p_odtx, and p_odty.

Referenced by SetFocalPlane().

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::TaylorCameraDistortionMap::SetDistortion ( const int  naifIkCode)

Load distortion coefficients.

This method loads the distortion coefficients from the instrument kernel. The coefficients in the NAIF instrument kernel are expected to be in the form of:

INSxxxxx_OD_T_X = ( xa, xb, xc, xd, xe, xf, xg, xh, xi, xj )
INSxxxxx_OD_T_Y = ( ya, yb, yc, yd, ye, yf, yg, yh, yi, yj )
where xxxxx is the instrument code (always a negative number)

These coefficient will be used to convert between focal plane xp,yp to undistorted x,y as follows

[ xp ] = [ xa xb xc xd xe xf xg xh xi xj ] * [ 1 ] [ yp ] [ ya yb yc yd ye yf yg yh yi yj ] [ x ] [ y ] [ x*x ] [ x*y ] [ y*y ] [ x*x*x ] [ x*x*y ] [ x*y*y ] [ y*y*y ]

Parameters
naifIkCodeCode to search for in instrument kernel

Definition at line 75 of file TaylorCameraDistortionMap.cpp.

References Isis::Spice::getDouble(), p_odtx, p_odty, and Isis::toString().

Referenced by Isis::MdisCamera::MdisCamera().

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

Compute undistorted focal plane x/y.

Compute undistorted focal plane x/y given a distorted focal plane x/y. The undistorted coordinates are solved for using the Newton-Raphson method for root-finding if the SetDistortion method is invoked. After calling this method, you can obtain the undistorted x/y via the UndistortedFocalPlaneX and UndistortedFocalPlaneY methods.

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

Review the tolerance and maximum iterations of the root- finding algorithm.

Review the handling of non-convergence of the root-finding algorithm.

Add error handling for near-zero determinant.

Reimplemented from Isis::CameraDistortionMap.

Definition at line 104 of file TaylorCameraDistortionMap.cpp.

References DistortionFunction(), DistortionFunctionJacobian(), Isis::E(), p_odtx, and p_odty.

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

Compute distorted focal plane x/y.

Compute distorted focal plane x/y given an undistorted focal plane x/y. The distortion model is approximated by a third order Taylor series expansion of a generic function if the SetDistortion method was invoked. After calling this method, you can obtain the distorted x/y 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

Reimplemented from Isis::CameraDistortionMap.

Definition at line 189 of file TaylorCameraDistortionMap.cpp.

References DistortionFunction(), p_odtx, and p_odty.

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::TaylorCameraDistortionMap::p_odtx
protected
std::vector<double> Isis::TaylorCameraDistortionMap::p_odty
protected

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