Public Member Functions | Private Attributes | List of all members
vpgl_proj_camera< T > Class Template Reference

#include <vpgl_proj_camera.h>

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

Public Member Functions

 vpgl_proj_camera ()
 Default constructor makes an identity camera. More...
 
 vpgl_proj_camera (const vnl_matrix_fixed< T, 3, 4 > &camera_matrix)
 Construct from a vnl_matrix. More...
 
 vpgl_proj_camera (const T *camera_matrix)
 Construct from an array. The array should be in the order row1, row2, row3. More...
 
 vpgl_proj_camera (const vpgl_proj_camera &cam)
 Copy constructor. More...
 
std::string type_name () const override
 class identity functions for casting. More...
 
virtual vpgl_proj_camera< T > * clone (void) const
 Clone ‘this’: creation of a new object and initialization. More...
 
const vpgl_proj_camera< T > & operator= (const vpgl_proj_camera &cam)
 Assignment. More...
 
 ~vpgl_proj_camera () override
 
bool operator== (vpgl_proj_camera< T > const &that) const
 Equality test. More...
 
void project (const T x, const T y, const T z, T &u, T &v) const override
 Projection from base class. More...
 
virtual vgl_homg_point_2d< T > project (const vgl_homg_point_3d< T > &world_point) const
 Project a point in world coordinates onto the image plane. More...
 
vgl_homg_point_2d< T > project (const vgl_point_3d< T > &world_point) const
 Non-homogeneous version of the above. More...
 
vgl_homg_point_2d< T > operator() (const vgl_homg_point_3d< T > &world_point) const
 A shortcut to the above function. More...
 
vgl_line_segment_2d< T > project (const vgl_line_segment_3d< T > &world_line) const
 Project a line in the world onto a line in the image plane. More...
 
vgl_line_segment_2d< T > operator() (const vgl_line_segment_3d< T > &world_line) const
 Standard () forward projection operator. More...
 
vgl_line_2d< T > project (const vgl_infinite_line_3d< T > &world_line) const
 Project an infinite line in the world onto an infinite line in the image plane. More...
 
vgl_line_2d< T > operator() (const vgl_infinite_line_3d< T > &world_line) const
 Standard () forward projection operator. More...
 
virtual vgl_ray_3d< T > backproject_ray (const vgl_homg_point_2d< T > &image_point) const
 Find the 3d ray that goes through the camera center and the provided image point. More...
 
virtual vgl_homg_line_3d_2_points< T > backproject (const vgl_homg_point_2d< T > &image_point) const
 Find the 3d ray that goes through the camera center and the provided image point. More...
 
vgl_homg_plane_3d< T > backproject (const vgl_homg_line_2d< T > &image_line) const
 Find the 3d plane that contains the camera center and the provided line in the image plane. More...
 
virtual vgl_homg_point_3d< T > camera_center () const
 Find the 3d coordinates of the center of the camera. More...
 
virtual vgl_homg_plane_3d< T > principal_plane () const
 Find the world plane parallel to the image plane intersecting the camera center. More...
 
vgl_homg_point_2d< T > x_vanishing_point () const
 Find the image coordinates of the vanishing points of the world coordinate axes. More...
 
vgl_homg_point_2d< T > y_vanishing_point () const
 
vgl_homg_point_2d< T > z_vanishing_point () const
 
const vnl_matrix_fixed< T, 3, 4 > & get_matrix () const
 Return a copy of the camera matrix. More...
 
vnl_svd< T > * svd () const
 Get a copy of the svd of the get_matrix. More...
 
virtual bool set_matrix (const vnl_matrix_fixed< T, 3, 4 > &new_camera_matrix)
 Setters mirror the constructors and return true if the setting was successful. More...
 
virtual bool set_matrix (const T *new_camera_matrix)
 
virtual void save (std::string cam_path)
 Save in ascii format. More...
 
std::string is_a () const
 
bool is_class (std::string const &name) const
 
void ref ()
 
void unref ()
 
long get_references () const
 
bool is_referenced () const
 

Private Attributes

vnl_matrix_fixed< T, 3, 4 > P_
 The internal representation of the get_matrix. More...
 
vnl_svd< T > * cached_svd_
 

Detailed Description

template<class T>
class vpgl_proj_camera< T >

Definition at line 69 of file vpgl_proj_camera.h.

Constructor & Destructor Documentation

◆ vpgl_proj_camera() [1/4]

template<class T >
vpgl_proj_camera< T >::vpgl_proj_camera ( )

Default constructor makes an identity camera.

Definition at line 24 of file vpgl_proj_camera.hxx.

◆ vpgl_proj_camera() [2/4]

template<class T >
vpgl_proj_camera< T >::vpgl_proj_camera ( const vnl_matrix_fixed< T, 3, 4 > &  camera_matrix)

Construct from a vnl_matrix.

Definition at line 33 of file vpgl_proj_camera.hxx.

◆ vpgl_proj_camera() [3/4]

template<class T >
vpgl_proj_camera< T >::vpgl_proj_camera ( const T *  camera_matrix)

Construct from an array. The array should be in the order row1, row2, row3.

Definition at line 41 of file vpgl_proj_camera.hxx.

◆ vpgl_proj_camera() [4/4]

template<class T >
vpgl_proj_camera< T >::vpgl_proj_camera ( const vpgl_proj_camera< T > &  cam)

Copy constructor.

Definition at line 49 of file vpgl_proj_camera.hxx.

◆ ~vpgl_proj_camera()

template<class T >
vpgl_proj_camera< T >::~vpgl_proj_camera ( )
override

Definition at line 68 of file vpgl_proj_camera.hxx.

Member Function Documentation

◆ backproject() [1/2]

template<class T >
vgl_homg_line_3d_2_points< T > vpgl_proj_camera< T >::backproject ( const vgl_homg_point_2d< T > &  image_point) const
virtual

Find the 3d ray that goes through the camera center and the provided image point.

Reimplemented in vpgl_perspective_camera< T >, and vpgl_affine_camera< T >.

Definition at line 146 of file vpgl_proj_camera.hxx.

◆ backproject() [2/2]

template<class T >
vgl_homg_plane_3d< T > vpgl_proj_camera< T >::backproject ( const vgl_homg_line_2d< T > &  image_line) const

Find the 3d plane that contains the camera center and the provided line in the image plane.

Definition at line 178 of file vpgl_proj_camera.hxx.

◆ backproject_ray()

template<class T >
vgl_ray_3d< T > vpgl_proj_camera< T >::backproject_ray ( const vgl_homg_point_2d< T > &  image_point) const
virtual

Find the 3d ray that goes through the camera center and the provided image point.

Reimplemented in vpgl_affine_camera< T >.

Definition at line 162 of file vpgl_proj_camera.hxx.

◆ camera_center()

template<class T >
vgl_homg_point_3d< T > vpgl_proj_camera< T >::camera_center ( ) const
virtual

Find the 3d coordinates of the center of the camera.

Reimplemented in vpgl_perspective_camera< T >, and vpgl_affine_camera< T >.

Definition at line 192 of file vpgl_proj_camera.hxx.

◆ clone()

template<class T >
vpgl_proj_camera< T > * vpgl_proj_camera< T >::clone ( void  ) const
virtual

Clone ‘this’: creation of a new object and initialization.

See Prototype pattern

Reimplemented in vpgl_affine_camera< T >, and vpgl_perspective_camera< T >.

Definition at line 75 of file vpgl_proj_camera.hxx.

◆ get_matrix()

template<class T>
const vnl_matrix_fixed<T,3,4>& vpgl_proj_camera< T >::get_matrix ( ) const
inline

Return a copy of the camera matrix.

Definition at line 156 of file vpgl_proj_camera.h.

◆ is_a()

template<class T>
std::string vpgl_camera< T >::is_a ( ) const
inlineinherited

Definition at line 40 of file vpgl_camera.h.

◆ is_class()

template<class T>
bool vpgl_camera< T >::is_class ( std::string const &  name) const
inlineinherited

Definition at line 41 of file vpgl_camera.h.

◆ operator()() [1/3]

template<class T>
vgl_homg_point_2d<T> vpgl_proj_camera< T >::operator() ( const vgl_homg_point_3d< T > &  world_point) const
inline

A shortcut to the above function.

Definition at line 114 of file vpgl_proj_camera.h.

◆ operator()() [2/3]

template<class T>
vgl_line_segment_2d<T> vpgl_proj_camera< T >::operator() ( const vgl_line_segment_3d< T > &  world_line) const
inline

Standard () forward projection operator.

Definition at line 121 of file vpgl_proj_camera.h.

◆ operator()() [3/3]

template<class T>
vgl_line_2d<T> vpgl_proj_camera< T >::operator() ( const vgl_infinite_line_3d< T > &  world_line) const
inline

Standard () forward projection operator.

Definition at line 128 of file vpgl_proj_camera.h.

◆ operator=()

template<class T >
const vpgl_proj_camera< T > & vpgl_proj_camera< T >::operator= ( const vpgl_proj_camera< T > &  cam)

Assignment.

Definition at line 58 of file vpgl_proj_camera.hxx.

◆ operator==()

template<class T>
bool vpgl_proj_camera< T >::operator== ( vpgl_proj_camera< T > const &  that) const
inline

Equality test.

Definition at line 98 of file vpgl_proj_camera.h.

◆ principal_plane()

template<class T>
virtual vgl_homg_plane_3d<T> vpgl_proj_camera< T >::principal_plane ( ) const
inlinevirtual

Find the world plane parallel to the image plane intersecting the camera center.

Reimplemented in vpgl_affine_camera< T >.

Definition at line 146 of file vpgl_proj_camera.h.

◆ project() [1/5]

template<class T >
void vpgl_proj_camera< T >::project ( const T  x,
const T  y,
const T  z,
T &  u,
T &  v 
) const
overridevirtual

Projection from base class.

Implements vpgl_camera< T >.

Definition at line 104 of file vpgl_proj_camera.hxx.

◆ project() [2/5]

template<class T >
vgl_homg_point_2d< T > vpgl_proj_camera< T >::project ( const vgl_homg_point_3d< T > &  world_point) const
virtual

Project a point in world coordinates onto the image plane.

Definition at line 85 of file vpgl_proj_camera.hxx.

◆ project() [3/5]

template<class T>
vgl_homg_point_2d<T> vpgl_proj_camera< T >::project ( const vgl_point_3d< T > &  world_point) const
inline

Non-homogeneous version of the above.

Definition at line 110 of file vpgl_proj_camera.h.

◆ project() [4/5]

template<class T >
vgl_line_segment_2d< T > vpgl_proj_camera< T >::project ( const vgl_line_segment_3d< T > &  world_line) const

Project a line in the world onto a line in the image plane.

Definition at line 121 of file vpgl_proj_camera.hxx.

◆ project() [5/5]

template<class T >
vgl_line_2d< T > vpgl_proj_camera< T >::project ( const vgl_infinite_line_3d< T > &  world_line) const

Project an infinite line in the world onto an infinite line in the image plane.

Definition at line 134 of file vpgl_proj_camera.hxx.

◆ save()

template<class T >
void vpgl_proj_camera< T >::save ( std::string  cam_path)
virtual

Save in ascii format.

Reimplemented in vpgl_perspective_camera< T >.

Definition at line 267 of file vpgl_proj_camera.hxx.

◆ set_matrix() [1/2]

template<class T >
bool vpgl_proj_camera< T >::set_matrix ( const vnl_matrix_fixed< T, 3, 4 > &  new_camera_matrix)
virtual

Setters mirror the constructors and return true if the setting was successful.

In subclasses these should be redefined so that they won't allow setting of matrices with improper form.

Reimplemented in vpgl_affine_camera< T >.

Definition at line 220 of file vpgl_proj_camera.hxx.

◆ set_matrix() [2/2]

template<class T >
bool vpgl_proj_camera< T >::set_matrix ( const T *  new_camera_matrix)
virtual

Reimplemented in vpgl_affine_camera< T >.

Definition at line 230 of file vpgl_proj_camera.hxx.

◆ svd()

template<class T >
vnl_svd< T > * vpgl_proj_camera< T >::svd ( ) const

Get a copy of the svd of the get_matrix.

The svd is cached when first computed and automatically recomputed when the matrix is changed.

Definition at line 203 of file vpgl_proj_camera.hxx.

◆ type_name()

template<class T>
std::string vpgl_proj_camera< T >::type_name ( ) const
inlineoverridevirtual

class identity functions for casting.

Reimplemented from vpgl_camera< T >.

Definition at line 86 of file vpgl_proj_camera.h.

◆ x_vanishing_point()

template<class T>
vgl_homg_point_2d<T> vpgl_proj_camera< T >::x_vanishing_point ( ) const
inline

Find the image coordinates of the vanishing points of the world coordinate axes.

Definition at line 149 of file vpgl_proj_camera.h.

◆ y_vanishing_point()

template<class T>
vgl_homg_point_2d<T> vpgl_proj_camera< T >::y_vanishing_point ( ) const
inline

Definition at line 150 of file vpgl_proj_camera.h.

◆ z_vanishing_point()

template<class T>
vgl_homg_point_2d<T> vpgl_proj_camera< T >::z_vanishing_point ( ) const
inline

Definition at line 151 of file vpgl_proj_camera.h.

Member Data Documentation

◆ cached_svd_

template<class T>
vnl_svd<T>* vpgl_proj_camera< T >::cached_svd_
mutableprivate

Definition at line 178 of file vpgl_proj_camera.h.

◆ P_

template<class T>
vnl_matrix_fixed<T,3,4> vpgl_proj_camera< T >::P_
private

The internal representation of the get_matrix.

It is private so subclasses will need to access it through "get_matrix" and "set_matrix".

Definition at line 176 of file vpgl_proj_camera.h.


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