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) {
 
 
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.
 
double p_focalPlaneY
Distorted focal plane y.
 
bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
 
bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
 
This is free and unencumbered software released into the public domain.
 
Namespace for the standard library.