7 #include "RadialDistortionMap.h"
8 #include "CameraFocalPlaneMap.h"
13 RadialDistortionMap::RadialDistortionMap(Camera *parent,
double k1,
double zDirection) : CameraDistortionMap(parent, zDirection) {
24 offsetSqrd = dx * dx + dy * dy;
48 offsetSqrd = uy * uy + ux * ux;
49 double guess_dx, guess_dy;
50 double guess_ux, guess_uy;
57 guess_dx = ux / (1.0 + p_k1 * offsetSqrd);
58 guess_dy = uy / (1.0 + p_k1 * offsetSqrd);
61 offsetSqrd = guess_dy * guess_dy + guess_dx * guess_dx;
63 guess_ux = guess_dx * (1.0 + p_k1 * offsetSqrd);
64 guess_uy = guess_dy * (1.0 + p_k1 * offsetSqrd);
68 if(abs(guess_uy - uy) > delta) {
72 if(abs(guess_ux - ux) > delta) {
78 if(numAttempts > 20) {