38 RosettaOsirisCameraDistortionMap::RosettaOsirisCameraDistortionMap(
Camera *parent) :
94 xTerms(2) = dxPixel*dxPixel;
95 xTerms(3) = dxPixel*dxPixel*dxPixel;
100 yTerms(2) = dyPixel*dyPixel;
101 yTerms(3) = dyPixel*dyPixel*dyPixel;
160 double tolerance = 1e-7;
162 int maxIterations = 20;
166 undistortedCoordinate(0) = uxPixel;
167 undistortedCoordinate(1) = uyPixel;
185 xTerms(1) = distortedCoordinate(0);
186 xTerms(2) = distortedCoordinate(0)*distortedCoordinate(0);
187 xTerms(3) = distortedCoordinate(0)*distortedCoordinate(0)*distortedCoordinate(0);
190 yTerms(1) = distortedCoordinate(1);
191 yTerms(2) = distortedCoordinate(1)*distortedCoordinate(1);
192 yTerms(3) = distortedCoordinate(1)*distortedCoordinate(1)*distortedCoordinate(1);
195 delXTerms(2) = 2.0*distortedCoordinate(0);
196 delXTerms(3) = 3.0*distortedCoordinate(0)*distortedCoordinate(0);
199 delYTerms(2) = 2.0*distortedCoordinate(1);
200 delYTerms(3) = 3.0*distortedCoordinate(1)*distortedCoordinate(1);
203 objectFuncValue(0) = undistortedCoordinate(0)
206 objectFuncValue(1) = undistortedCoordinate(1)
228 double det = negJacobian(0, 0) * negJacobian(1, 1) - negJacobian(1, 0) * negJacobian(0, 1);
229 if ( fabs(det) < 1e-15 ) {
232 negInvJacobian(0, 0) = negJacobian(1, 1) / det;
233 negInvJacobian(0, 1) = - negJacobian(0, 1) / det;
234 negInvJacobian(1, 0) = - negJacobian(1, 0) / det;
235 negInvJacobian(1, 1) = negJacobian(0, 0) / det;
241 distortedCoordinate += updateStep;
245 xTerms(1) = distortedCoordinate(0);
246 xTerms(2) = distortedCoordinate(0)*distortedCoordinate(0);
247 xTerms(3) = distortedCoordinate(0)*distortedCoordinate(0)*distortedCoordinate(0);
250 yTerms(1) = distortedCoordinate(1);
251 yTerms(2) = distortedCoordinate(1)*distortedCoordinate(1);
252 yTerms(3) = distortedCoordinate(1)*distortedCoordinate(1)*distortedCoordinate(1);
255 delXTerms(2) = 2.0*distortedCoordinate(0);
256 delXTerms(3) = 3.0*distortedCoordinate(0)*distortedCoordinate(0);
259 delYTerms(2) = 2.0*distortedCoordinate(1);
260 delYTerms(3) = 3.0*distortedCoordinate(1)*distortedCoordinate(1);
263 objectFuncValue(0) = undistortedCoordinate(0)
266 objectFuncValue(1) = undistortedCoordinate(1)
271 iteration > maxIterations ) {
double p_focalPlaneX
Distorted focal plane x.
void setUnDistortedXMatrix(LinearAlgebra::Matrix xMat)
Set the matrix for converting from distorted to undistorted samples.
static Matrix multiply(const Matrix &matrix1, const Matrix &matrix2)
Returns the product of two matrices.
static double magnitude(const Vector &vector)
Computes the magnitude (i.e., the length) of the given vector using the Euclidean norm (L2 norm)...
Namespace for the standard library.
boost::numeric::ublas::matrix< double > Matrix
Definition for an Isis::LinearAlgebra::Matrix of doubles.
static Matrix zeroMatrix(int rows, int columns)
Returns a matrix with given dimensions that is filled with zeroes.
static double dotProduct(const Vector &vector1, const Vector &vector2)
Computes the dot product of the given vectors.
void setPixelPitch(double pitch)
Set the pixel pitch for converting from focal plane coordinates to pixel coordinates.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y given a distorted focal plane x/y.
double p_undistortedFocalPlaneX
Undistorted focal plane x.
void setBoresight(double sample, double line)
Set the boresight location for converting from focal plane coordinates to pixel coordinates.
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
LinearAlgebra::Matrix m_toUnDistortedX
Matrix for computing undistorted X coordinates.
double lineToFocalX(double line)
Convert pixel space line coordinate to a focal plane x coordinate.
double sampleToFocalY(double sample)
Convert pixel space sample coordinate to a focal plane y coordinate.
double focalXToLine(double x)
Convert a focal plane x coordinate to a pixel space line coordinate.
static Vector zeroVector(int size)
Returns a vector of given length that is filled with zeroes.
Distort/undistort focal plane coordinates.
double m_pixelPitch
Camera pixel pitch for converting focal plane coordinates to pixel coordinates.
void setUnDistortedYMatrix(LinearAlgebra::Matrix yMat)
Set the matrix for converting from distorted to undistorted lines.
double m_boresightSample
Camera boresight sample coordinate for converting focal plane coordinates to pixel coordinates...
LinearAlgebra::Matrix m_toUnDistortedY
Matrix for computing undistorted Y coordinates.
double p_focalPlaneY
Distorted focal plane y.
double p_undistortedFocalPlaneY
Undistorted focal plane y.
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y given an undistorted focal plane x/y.
double focalYToSample(double y)
Convert a focal plane y coordinate to a pixel space sample coordinate.
Namespace for ISIS/Bullet specific routines.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double m_boresightLine
Camera boresight line coordinate for converting focal plane coordinates to pixel coordinates.