Public Member Functions | Protected Attributes | List of all members
vpgl_poly_radial_distortion< T, n > Class Template Reference

A class for nth order polynomial radial lens distortion. More...

#include <vpgl_poly_radial_distortion.h>

Inheritance diagram for vpgl_poly_radial_distortion< T, n >:
Inheritance graph
[legend]

Public Member Functions

 vpgl_poly_radial_distortion (const vgl_point_2d< T > &center, const T *k)
 Constructor. More...
 
 vpgl_poly_radial_distortion (const vgl_point_2d< T > &center, const vgl_point_2d< T > &distorted_center, const T *k)
 Constructor. More...
 
 vpgl_poly_radial_distortion (const vgl_point_2d< T > &center, const std::vector< T > &k)
 Constructor. More...
 
 vpgl_poly_radial_distortion (const vgl_point_2d< T > &center, const vgl_point_2d< T > &distorted_center, const std::vector< T > &k)
 Constructor. More...
 
void set_coefficients (const std::vector< T > &k)
 
void set_coefficients (const T *k)
 
coefficient (unsigned int i) const
 Read-only coefficient accessor. More...
 
T & coefficient (unsigned int i)
 Read-write coefficient accessor. More...
 
distort_radius (T radius) const override
 Distort a radial length. More...
 
distort_radius_deriv (T radius) const override
 Compute the derivative of the distort_radius function. More...
 
vgl_homg_point_2d< T > distort (const vgl_homg_point_2d< T > &point) const override
 Distort a projected point on the image plane. More...
 
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). More...
 
virtual T undistort_radius (T radius, const T *init=nullptr) const
 Return the inverse of distort function. More...
 
void set_translation (const vgl_vector_2d< T > &offset, bool after=true) override
 Set a translation to apply before of after distortion. More...
 
vgl_point_2d< T > center () const
 Returns the center of distortion. More...
 
vgl_point_2d< T > distorted_center () const
 Returns the center of distortion in the distorted image. More...
 
void set_center (const vgl_point_2d< T > &c)
 Set the center of distortion. More...
 
void set_distorted_center (const vgl_point_2d< T > &dc)
 Set the center of distortion in the distorted image. More...
 

Protected Attributes

coefficients_ [n]
 The coefficients of the nth-order polynomial. More...
 
vgl_point_2d< T > center_
 The center of distortion. More...
 
vgl_point_2d< T > distorted_center_
 The center of distortion in the distorted space. More...
 
bool has_derivative_
 

Detailed Description

template<class T, int n>
class vpgl_poly_radial_distortion< T, n >

A class for nth order polynomial radial lens distortion.

Definition at line 25 of file vpgl_poly_radial_distortion.h.

Constructor & Destructor Documentation

◆ vpgl_poly_radial_distortion() [1/4]

template<class T , int n>
vpgl_poly_radial_distortion< T, n >::vpgl_poly_radial_distortion ( const vgl_point_2d< T > &  center,
const T *  k 
)
inline

Constructor.

Definition at line 29 of file vpgl_poly_radial_distortion.h.

◆ vpgl_poly_radial_distortion() [2/4]

template<class T , int n>
vpgl_poly_radial_distortion< T, n >::vpgl_poly_radial_distortion ( const vgl_point_2d< T > &  center,
const vgl_point_2d< T > &  distorted_center,
const T *  k 
)
inline

Constructor.

Definition at line 36 of file vpgl_poly_radial_distortion.h.

◆ vpgl_poly_radial_distortion() [3/4]

template<class T , int n>
vpgl_poly_radial_distortion< T, n >::vpgl_poly_radial_distortion ( const vgl_point_2d< T > &  center,
const std::vector< T > &  k 
)
inline

Constructor.

Definition at line 45 of file vpgl_poly_radial_distortion.h.

◆ vpgl_poly_radial_distortion() [4/4]

template<class T , int n>
vpgl_poly_radial_distortion< T, n >::vpgl_poly_radial_distortion ( const vgl_point_2d< T > &  center,
const vgl_point_2d< T > &  distorted_center,
const std::vector< T > &  k 
)
inline

Constructor.

Definition at line 53 of file vpgl_poly_radial_distortion.h.

Member Function Documentation

◆ center()

template<class T >
vgl_point_2d<T> vpgl_radial_distortion< T >::center ( ) const
inlineinherited

Returns the center of distortion.

Definition at line 79 of file vpgl_radial_distortion.h.

◆ coefficient() [1/2]

template<class T , int n>
T vpgl_poly_radial_distortion< T, n >::coefficient ( unsigned int  i) const
inline

Read-only coefficient accessor.

Definition at line 79 of file vpgl_poly_radial_distortion.h.

◆ coefficient() [2/2]

template<class T , int n>
T& vpgl_poly_radial_distortion< T, n >::coefficient ( unsigned int  i)
inline

Read-write coefficient accessor.

Definition at line 86 of file vpgl_poly_radial_distortion.h.

◆ distort()

template<class T >
vgl_homg_point_2d< T > vpgl_radial_distortion< T >::distort ( const vgl_homg_point_2d< T > &  point) const
overridevirtualinherited

Distort a projected point on the image plane.

Calls the pure virtual radial distortion function

Implements vpgl_lens_distortion< T >.

Definition at line 21 of file vpgl_radial_distortion.hxx.

◆ distort_radius()

template<class T , int n>
T vpgl_poly_radial_distortion< T, n >::distort_radius ( radius) const
overridevirtual

Distort a radial length.

Implements vpgl_radial_distortion< T >.

Definition at line 34 of file vpgl_poly_radial_distortion.hxx.

◆ distort_radius_deriv()

template<class T , int n>
T vpgl_poly_radial_distortion< T, n >::distort_radius_deriv ( radius) const
overridevirtual

Compute the derivative of the distort_radius function.

Reimplemented from vpgl_radial_distortion< T >.

Definition at line 63 of file vpgl_poly_radial_distortion.hxx.

◆ distorted_center()

template<class T >
vgl_point_2d<T> vpgl_radial_distortion< T >::distorted_center ( ) const
inlineinherited

Returns the center of distortion in the distorted image.

Definition at line 81 of file vpgl_radial_distortion.h.

◆ set_center()

template<class T >
void vpgl_radial_distortion< T >::set_center ( const vgl_point_2d< T > &  c)
inlineinherited

Set the center of distortion.

Definition at line 84 of file vpgl_radial_distortion.h.

◆ set_coefficients() [1/2]

template<class T , int n>
void vpgl_poly_radial_distortion< T, n >::set_coefficients ( const std::vector< T > &  k)
inline

Definition at line 61 of file vpgl_poly_radial_distortion.h.

◆ set_coefficients() [2/2]

template<class T , int n>
void vpgl_poly_radial_distortion< T, n >::set_coefficients ( const T *  k)
inline

Definition at line 69 of file vpgl_poly_radial_distortion.h.

◆ set_distorted_center()

template<class T >
void vpgl_radial_distortion< T >::set_distorted_center ( const vgl_point_2d< T > &  dc)
inlineinherited

Set the center of distortion in the distorted image.

Definition at line 86 of file vpgl_radial_distortion.h.

◆ set_translation()

template<class T >
void vpgl_radial_distortion< T >::set_translation ( const vgl_vector_2d< T > &  offset,
bool  after = true 
)
inlineoverridevirtualinherited

Set a translation to apply before of after distortion.

This is needed when distorting an image to translate the resulting image such that all points have positive indices

Implements vpgl_lens_distortion< T >.

Definition at line 70 of file vpgl_radial_distortion.h.

◆ undistort()

template<class T >
vgl_homg_point_2d< T > vpgl_radial_distortion< T >::undistort ( const vgl_homg_point_2d< T > &  point,
const vgl_homg_point_2d< T > *  init = nullptr 
) const
overridevirtualinherited

Return the original point that was distorted to this location (inverse of distort).

Parameters
initis an initial guess at the solution for the iterative solver if init is NULL then point is used as the initial guess calls the radial undistortion function

Reimplemented from vpgl_lens_distortion< T >.

Definition at line 35 of file vpgl_radial_distortion.hxx.

◆ undistort_radius()

template<class T >
T vpgl_radial_distortion< T >::undistort_radius ( radius,
const T *  init = nullptr 
) const
virtualinherited

Return the inverse of distort function.

Return the inverse of the distort function.

Parameters
initis an initial guess at the solution for the iterative solver if init is NULL then radius is used as the initial guess

Definition at line 53 of file vpgl_radial_distortion.hxx.

Member Data Documentation

◆ center_

template<class T >
vgl_point_2d<T> vpgl_radial_distortion< T >::center_
protectedinherited

The center of distortion.

Definition at line 90 of file vpgl_radial_distortion.h.

◆ coefficients_

template<class T , int n>
T vpgl_poly_radial_distortion< T, n >::coefficients_[n]
protected

The coefficients of the nth-order polynomial.

Definition at line 100 of file vpgl_poly_radial_distortion.h.

◆ distorted_center_

template<class T >
vgl_point_2d<T> vpgl_radial_distortion< T >::distorted_center_
protectedinherited

The center of distortion in the distorted space.

Definition at line 93 of file vpgl_radial_distortion.h.

◆ has_derivative_

template<class T >
bool vpgl_radial_distortion< T >::has_derivative_
protectedinherited

Definition at line 95 of file vpgl_radial_distortion.h.


The documentation for this class was generated from the following files: