27 #include <boost/foreach.hpp> 47 LroWideAngleCameraDistortionMap::LroWideAngleCameraDistortionMap(
Camera *parent,
70 QString odkkey =
"INS" + QString::number(naifIkCode) +
"_OD_K";
72 std::vector<double> v_odk;
73 for(
int i = 0; i < 3; i++) {
77 m_odkFilters.push_back(v_odk);
94 if ( (vband <= 0) || (vband > m_odkFilters.size()) ) {
95 QString mess =
"Invalid band (" + QString::number(vband) +
" requested " +
96 " Must be <= " + QString::number(m_odkFilters.size());
101 p_odk = m_odkFilters[vband-1];
123 double dk1 =
p_odk[0];
124 double dk2 =
p_odk[1];
125 double dk3 =
p_odk[2];
127 double rr = dx * dx + dy * dy;
129 double dr = 1.0 + dk1 * rr + dk2 * rr * rr + dk3 * rr * rr * rr;
133 if ( dr == 0.0 )
return false;
164 double xdistorted, ydistorted;
165 double xprevious, yprevious;
167 xprevious = 1000000.0;
168 yprevious = 1000000.0;
171 double tolerance = 1.0e-6;
173 bool bConverged =
false;
175 double dk1 =
p_odk[0];
176 double dk2 =
p_odk[1];
177 double dk3 =
p_odk[2];
182 for(
int i = 0; i < 50; i++) {
183 rr = xt * xt + yt * yt;
185 dr = 1.0 + dk1 * rr + dk2 * rr * rr + dk3 * rr * rr * rr;
196 if((fabs(xt - xprevious) <= tolerance) && (fabs(yt - yprevious) <= tolerance)) {
double p_focalPlaneX
Distorted focal plane x.
Namespace for the standard library.
virtual void SetDistortion(int naifIkCode)
Load distortion coefficients.
This error is for when a programmer made an API call that was illegal.
void setBand(int vband)
Implements band-dependant distortion parameters.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
double p_undistortedFocalPlaneX
Undistorted focal plane x.
Camera * p_camera
The camera to distort/undistort.
#define _FILEINFO_
Macro for the filename and line number.
Distort/undistort focal plane 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.
Namespace for ISIS/Bullet specific routines.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
std::vector< double > p_odk
Vector of distortion coefficients.
void addFilter(int naifIkCode)
Add an additional set of parameters for a given LROC/WAC filter.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.