Public Member Functions | Protected Attributes | List of all members
vpgl_radial_distortion< T > Class Template Referenceabstract

A base class for radial lens distortions. More...

#include <vpgl_radial_distortion.h>

Inheritance diagram for vpgl_radial_distortion< T >:
Inheritance graph
[legend]

Public Member Functions

 vpgl_radial_distortion (const vgl_point_2d< T > &center, bool has_deriv=false)
 Constructor. More...
 
 vpgl_radial_distortion (const vgl_point_2d< T > &center, const vgl_point_2d< T > &new_center, bool has_deriv=false)
 Constructor. 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 distort_radius (T radius) const =0
 Distort a radial length. More...
 
virtual T undistort_radius (T radius, const T *init=nullptr) const
 Return the inverse of distort function. More...
 
virtual T distort_radius_deriv (T radius) const
 Compute the derivative of the distort_radius 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

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>
class vpgl_radial_distortion< T >

A base class for radial lens distortions.

Definition at line 22 of file vpgl_radial_distortion.h.

Constructor & Destructor Documentation

◆ vpgl_radial_distortion() [1/2]

template<class T >
vpgl_radial_distortion< T >::vpgl_radial_distortion ( const vgl_point_2d< T > &  center,
bool  has_deriv = false 
)
inline

Constructor.

Definition at line 26 of file vpgl_radial_distortion.h.

◆ vpgl_radial_distortion() [2/2]

template<class T >
vpgl_radial_distortion< T >::vpgl_radial_distortion ( const vgl_point_2d< T > &  center,
const vgl_point_2d< T > &  new_center,
bool  has_deriv = false 
)
inline

Constructor.

Definition at line 30 of file vpgl_radial_distortion.h.

Member Function Documentation

◆ center()

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

Returns the center of distortion.

Definition at line 79 of file vpgl_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
overridevirtual

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 >
virtual T vpgl_radial_distortion< T >::distort_radius ( radius) const
pure virtual

Distort a radial length.

Return values
ascale factor such that
distort_pt = center + distort_radius(radius)*(pt - center)

Implemented in vpgl_poly_radial_distortion< T, n >.

◆ distort_radius_deriv()

template<class T >
virtual T vpgl_radial_distortion< T >::distort_radius_deriv ( radius) const
inlinevirtual

Compute the derivative of the distort_radius function.

Note
implementing this function is optional but it may improve the convergence rate of the undistort function if iterative solving is used Set has_derivative_ to true if you define this function

Reimplemented in vpgl_poly_radial_distortion< T, n >.

Definition at line 61 of file vpgl_radial_distortion.h.

◆ distorted_center()

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

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)
inline

Set the center of distortion.

Definition at line 84 of file vpgl_radial_distortion.h.

◆ set_distorted_center()

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

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 
)
inlineoverridevirtual

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
overridevirtual

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
virtual

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_
protected

The center of distortion.

Definition at line 90 of file vpgl_radial_distortion.h.

◆ distorted_center_

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

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_
protected

Definition at line 95 of file vpgl_radial_distortion.h.


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