14#include "FunctionTools.h" 
   15#include "KaguyaMiCameraDistortionMap.h" 
   42    else                       m_numDistCoef = 4;  
 
   45    QString naifXKey = 
"INS" + 
toString(naifIkCode) + 
"_DISTORTION_COEF_X";
 
   46    QString naifYKey = 
"INS" + 
toString(naifIkCode) + 
"_DISTORTION_COEF_Y";
 
   47    for (
int i=0; i < m_numDistCoef; i++) {
 
   53    naifXKey = 
"INS" + 
toString(naifIkCode) + 
"_BORESIGHT";
 
 
   84    if (m_numDistCoef == 3) {  
 
   86        m_boreX + m_distCoefX[0] + dy*(m_distCoefX[1] + dy*m_distCoefX[2]) + dx;
 
   88        m_boreY + m_distCoefY[0] + dy*(m_distCoefY[1] + dy*m_distCoefY[2]) + dy;
 
   92        m_distCoefX[0] + dy*(m_distCoefX[1] + dy*(m_distCoefX[2] + dy*m_distCoefX[3])) + dx;
 
   94        m_distCoefY[0] + dy*(m_distCoefY[1] + dy*(m_distCoefY[2] + dy*m_distCoefY[3])) + dy;
 
 
  117    if (m_numDistCoef == 3) {  
 
  122      B = 1.0 + m_distCoefY[1];
 
  123      C = m_distCoefY[0] +m_boreY - uy;
 
  127      if (roots.size() == 0) 
return false;
 
  128      else if (roots.size() == 1)
 
  131        p_focalPlaneY = fabs(uy - roots[0]) < fabs(uy - roots[1]) ? roots[0] : roots[1];
 
  143      a = m_distCoefY[2] / m_distCoefY[3];
 
  144      b = (1.0 + m_distCoefY[1]) / m_distCoefY[3];
 
  145      c = (m_distCoefY[0] + m_boreY - uy) / m_distCoefY[3];
 
  149      if (roots.size() == 1) { 
 
  156        for (
int i=0;i<roots.size();i++)
 
  157          delta << fabs(roots[i]-uy);
 
  159        if ( roots.size() == 3) 
 
  161                         (delta[0] < delta[2] ? roots[0]:roots[2]) :
 
  162                         (delta[1] < delta[2] ? roots[1]:roots[2]) ;
 
 
Distort/undistort focal plane coordinates.
 
double p_focalPlaneX
Distorted focal plane x.
 
double p_undistortedFocalPlaneX
Undistorted focal plane x.
 
double p_undistortedFocalPlaneY
Undistorted focal plane y.
 
Camera * p_camera
The camera to distort/undistort.
 
double p_focalPlaneY
Distorted focal plane y.
 
double PixelPitch() const
Returns the pixel pitch.
 
KaguyaMiCameraDistortionMap(Camera *parent)
Camera distortion map constructor.
 
void SetDistortion(const int naifIkCode)
 
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
 
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
 
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
 
This is free and unencumbered software released into the public domain.
 
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
 
Namespace for the standard library.