7 DawnFcDistortionMap::DawnFcDistortionMap(Camera *parent,
double k1,
double zDirection) : CameraDistortionMap(parent, zDirection) {
11 bool DawnFcDistortionMap::SetUndistortedFocalPlane(
const double ux,
const double uy) {
14 p_undistortedFocalPlaneX = ux;
15 p_undistortedFocalPlaneY = uy;
17 offsetSqrd = ux * ux + uy * uy;
19 p_focalPlaneX = ux * (1.0 + p_k1 * offsetSqrd);
20 p_focalPlaneY = uy * (1.0 + p_k1 * offsetSqrd);
24 bool DawnFcDistortionMap::SetFocalPlane(
const double dx,
const double dy) {
40 offsetSqrd = dy * dy + dx * dx;
41 double guess_dx, guess_dy;
42 double guess_ux, guess_uy;
48 guess_ux = dx / (1.0 + p_k1 * offsetSqrd);
49 guess_uy = dy / (1.0 + p_k1 * offsetSqrd);
51 offsetSqrd = guess_uy * guess_uy + guess_ux * guess_ux;
53 guess_dx = guess_ux * (1.0 + p_k1 * offsetSqrd);
54 guess_dy = guess_uy * (1.0 + p_k1 * offsetSqrd);
57 if(abs(guess_dy - dy) > delta) {
61 if(abs(guess_dx - dx) > delta) {
67 if(numAttempts > 20) {
77 p_undistortedFocalPlaneX = guess_ux;
78 p_undistortedFocalPlaneY = guess_uy;