File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
DawnFcDistortionMap.cpp
1 #include "DawnFcDistortionMap.h"
2 #include "CameraFocalPlaneMap.h"
3 
4 using namespace std;
5 
6 namespace Isis {
7  DawnFcDistortionMap::DawnFcDistortionMap(Camera *parent, double k1, double zDirection) : CameraDistortionMap(parent, zDirection) {
8  p_k1 = k1;
9  }
10 
11  bool DawnFcDistortionMap::SetUndistortedFocalPlane(const double ux, const double uy) {
12  double offsetSqrd;
13 
16 
17  offsetSqrd = ux * ux + uy * uy;
18 
19  p_focalPlaneX = ux * (1.0 + p_k1 * offsetSqrd);
20  p_focalPlaneY = uy * (1.0 + p_k1 * offsetSqrd);
21  return true;
22  }
23 
24  bool DawnFcDistortionMap::SetFocalPlane(const double dx, const double dy) {
25  double offsetSqrd;
26  int numAttempts;
27  double delta;
28  bool done;
29 
30  p_focalPlaneX = dx;
31  p_focalPlaneY = dy;
32 
33  /****************************************************************************
34  * Pre-loop intializations
35  ****************************************************************************/
36 
37  numAttempts = 1;
38  delta = 0.00001;
39 
40  offsetSqrd = dy * dy + dx * dx;
41  double guess_dx, guess_dy;
42  double guess_ux, guess_uy;
43 
44  /****************************************************************************
45  * Loop ...
46  ****************************************************************************/
47  do {
48  guess_ux = dx / (1.0 + p_k1 * offsetSqrd);
49  guess_uy = dy / (1.0 + p_k1 * offsetSqrd);
50 
51  offsetSqrd = guess_uy * guess_uy + guess_ux * guess_ux;
52 
53  guess_dx = guess_ux * (1.0 + p_k1 * offsetSqrd);
54  guess_dy = guess_uy * (1.0 + p_k1 * offsetSqrd);
55 
56  done = true;
57  if(abs(guess_dy - dy) > delta) {
58  done = false;
59  }
60 
61  if(abs(guess_dx - dx) > delta) {
62  done = false;
63  }
64 
65  /* Not converging so bomb */
66  numAttempts++;
67  if(numAttempts > 20) {
68  return false;
69  }
70  }
71  while(!done);
72 
73  /****************************************************************************
74  * Sucess ...
75  ****************************************************************************/
76 
77  p_undistortedFocalPlaneX = guess_ux;
78  p_undistortedFocalPlaneY = guess_uy;
79  return true;
80  }
81 }
Isis::CameraDistortionMap::p_focalPlaneX
double p_focalPlaneX
Distorted focal plane x.
Definition: CameraDistortionMap.h:65
Isis::CameraDistortionMap::p_undistortedFocalPlaneY
double p_undistortedFocalPlaneY
Undistorted focal plane y.
Definition: CameraDistortionMap.h:68
Isis::DawnFcDistortionMap::SetUndistortedFocalPlane
bool SetUndistortedFocalPlane(const double dx, const double dy)
Compute distorted focal plane x/y.
Definition: DawnFcDistortionMap.cpp:11
Isis::CameraDistortionMap::p_undistortedFocalPlaneX
double p_undistortedFocalPlaneX
Undistorted focal plane x.
Definition: CameraDistortionMap.h:67
Isis::DawnFcDistortionMap::SetFocalPlane
bool SetFocalPlane(const double ux, const double uy)
Compute undistorted focal plane x/y.
Definition: DawnFcDistortionMap.cpp:24
std
Namespace for the standard library.
Isis::CameraDistortionMap::p_focalPlaneY
double p_focalPlaneY
Distorted focal plane y.
Definition: CameraDistortionMap.h:66
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:23