23 #include <boost/math/special_functions/legendre.hpp> 58 NewHorizonsMvicTdiCameraDistortionMap::NewHorizonsMvicTdiCameraDistortionMap(
60 vector<double> xDistortionCoeffs,
61 vector<double> yDistortionCoeffs,
62 vector<double> residualColDistCoeffs,
63 vector<double> residualRowDistCoeffs) :
122 double deltax1 = 0.0;
129 double deltax2 = 0.0;
130 double deltay2 = 0.0;
175 double xprevious, yprevious;
177 double deltax2 = 0.0;
178 double deltay2 = 0.0;
180 xprevious = 1000000.0;
181 yprevious = 1000000.0;
183 double tolerance = 0.000001;
185 bool bConverged =
false;
190 for (
int i = 0; i < 50; i++ ) {
197 if (fabs(xtScaled) > 1.0) {
212 if ((fabs(xt - xprevious) <= tolerance) && (fabs(yt - yprevious) <= tolerance)) {
249 const double xscaled,
250 const double yscaled,
253 double lpx0, lpx1, lpx2, lpx3, lpx4, lpx5;
254 double lpy0, lpy1, lpy2, lpy3, lpy4, lpy5;
258 lpx0 = legendre_p(0,xscaled);
259 lpx1 = legendre_p(1,xscaled);
260 lpx2 = legendre_p(2,xscaled);
261 lpx3 = legendre_p(3,xscaled);
262 lpx4 = legendre_p(4,xscaled);
263 lpx5 = legendre_p(5,xscaled);
264 lpy0 = legendre_p(0,yscaled);
265 lpy1 = legendre_p(1,yscaled);
266 lpy2 = legendre_p(2,yscaled);
267 lpy3 = legendre_p(3,yscaled);
268 lpy4 = legendre_p(4,yscaled);
269 lpy5 = legendre_p(5,yscaled);
271 catch (
const std::exception& e) {
312 double &residualDeltax,
313 double &residualDeltay) {
315 double s = 2500.5 - dx/0.013;
double p_focalPlaneX
Distorted focal plane x.
vector< double > m_residualColDistCoeffs
residual distortion coefficients as determined
bool computeDistortionCorrections(const double xscaled, const double yscaled, double &deltax)
Compute distortion corrections in x and y direction.
void computeResidualDistortionCorrections(const double dx, double &residualDeltax, double &residualDeltay)
Compute residual distortion corrections in row and column direction TODO: Implementati plete...
Namespace for the standard library.
double m_focalPlaneHalf_x
half of focal plane x and y dimensions in mm
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
double p_undistortedFocalPlaneX
Undistorted focal plane x.
Camera * p_camera
The camera to distort/undistort.
std::vector< double > m_xDistortionCoeffs
distortion coefficients in x and y as determined
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
~NewHorizonsMvicTdiCameraDistortionMap()
Destructor.
Distort/undistort focal plane coordinates.
double PixelPitch() const
Returns the pixel pitch.
vector< double > m_residualRowDistCoeffs
by Jason Cook, SWRI (MVIC Distortion)
double p_focalPlaneY
Distorted focal plane y.
double p_undistortedFocalPlaneY
Undistorted focal plane y.
int Samples() const
Returns the number of samples in the image.
Namespace for ISIS/Bullet specific routines.
std::vector< double > m_yDistortionCoeffs
by Keith Harrison (Interface Control Document section 10.3.1.2)
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.