2 #ifndef vpgl_radial_distortion_hxx_ 3 #define vpgl_radial_distortion_hxx_ 14 # include <vcl_msvc_warnings.h> 24 T scale = distort_radius(r.
length());
43 T scale = undistort_radius(radius, &init_r);
64 T e = std::numeric_limits<T>::infinity();
65 T eps = std::numeric_limits<T>::epsilon();
66 for (
unsigned int i=0; i<100 && std::abs(e)>eps ; ++i){
67 T f_result = distort_radius(result);
68 e = radius - f_result*result;
69 result += e/(distort_radius_deriv(result)*result + f_result);
74 T e = std::numeric_limits<T>::infinity();
75 T eps = std::numeric_limits<T>::epsilon();
77 for (
unsigned int i=0; i<100 && std::abs(e)>eps ; ++i){
78 T f_result = distort_radius(result);
79 T f_result_df = distort_radius(result-df);
80 e = radius - f_result*result;
81 result += e/((f_result - f_result_df)*result/df + f_result);
89 #undef vpgl_RADIAL_DISTORTION_INSTANTIATE 90 #define vpgl_RADIAL_DISTORTION_INSTANTIATE(T) \ 91 template class vpgl_radial_distortion<T > 93 #endif // vpgl_radial_distortion_hxx_
vgl_homg_point_2d< T > distort(const vgl_homg_point_2d< T > &point) const override
Distort a projected point on the image plane.
vgl_homg_point_2d< T > undistort(const vgl_homg_point_2d< T > &point, const vgl_homg_point_2d< T > *init=nullptr) const override
Return the original point that was distorted to this location (inverse of distort).
virtual T undistort_radius(T radius, const T *init=nullptr) const
Return the inverse of distort function.
An abstract base class for radial lens distortions.
double length(v const &a)