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

#include <vpgl_affine_camera.h>

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

Public Member Functions

 vpgl_affine_camera ()
 Default constructor creates the canonical affine camera. More...
 
 vpgl_affine_camera (const vnl_vector_fixed< T, 4 > &row1, const vnl_vector_fixed< T, 4 > &row2)
 Construct from the first two rows. More...
 
 vpgl_affine_camera (const vnl_matrix_fixed< T, 3, 4 > &camera_matrix)
 Construct from a 3x4 matrix, sets the last row to 0001. More...
 
 vpgl_affine_camera (vgl_vector_3d< T > ray, vgl_vector_3d< T > up, vgl_point_3d< T > stare_pt, T u0, T v0, T su, T sv)
 Construct from a ray direction, up vector, 3-d stare point: vgl interface. More...
 
 vpgl_affine_camera (vnl_vector_fixed< T, 3 > ray, vnl_vector_fixed< T, 3 > up, vnl_vector_fixed< T, 3 > stare_pt, T u0, T v0, T su, T sv)
 Construct from a ray direction, up vector, 3-d stare point: vnl interface. More...
 
bool set_matrix (const vnl_matrix_fixed< T, 3, 4 > &new_camera_matrix) override
 Setters mirror the constructors and return true if the setting was successful. More...
 
bool set_matrix (const T *new_camera_matrix) override
 
std::string type_name () const override
 class identity functions for casting. More...
 
void set_rows (const vnl_vector_fixed< T, 4 > &row1, const vnl_vector_fixed< T, 4 > &row2)
 Set the top two rows. More...
 
void set_viewing_distance (T dist)
 set a finite viewing distance to allow the methods below to return finite objects. More...
 
viewing_distance () const
 
void orient_ray_direction (vgl_vector_3d< T > const &look_dir)
 flip the ray direction so that dot product with look_dir is positive. More...
 
bool operator== (vpgl_affine_camera< T > const &that) const
 Equality test. More...
 
vgl_homg_point_3d< T > camera_center () const override
 Find the 3d coordinates of the center of the camera. Will be an ideal point with the sense of the ray direction. More...
 
vgl_homg_line_3d_2_points< T > backproject (const vgl_homg_point_2d< T > &image_point) const override
 Find the 3d ray that goes through the camera center. More...
 
vgl_ray_3d< T > backproject_ray (const vgl_homg_point_2d< T > &image_point) const override
 Find the 3d ray that goes through the camera center and the provided image point. More...
 
vgl_homg_plane_3d< T > principal_plane () const override
 Find the world plane perpendicular to the camera rays at viewing distance from the origin. More...
 
vpgl_affine_camera< T > * clone (void) const override
 Clone ‘this’: creation of a new object and initialization. More...
 
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_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_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_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 > operator() (const vgl_line_segment_3d< T > &world_line) const
 Standard () forward projection operator. More...
 
vgl_line_2d< T > operator() (const vgl_infinite_line_3d< T > &world_line) const
 Standard () forward projection operator. 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...
 
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 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

view_distance_
 
vgl_vector_3d< T > ray_dir_
 

Detailed Description

template<class T>
class vpgl_affine_camera< T >

Definition at line 24 of file vpgl_affine_camera.h.

Constructor & Destructor Documentation

◆ vpgl_affine_camera() [1/5]

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

Default constructor creates the canonical affine camera.

Definition at line 21 of file vpgl_affine_camera.hxx.

◆ vpgl_affine_camera() [2/5]

template<class T >
vpgl_affine_camera< T >::vpgl_affine_camera ( const vnl_vector_fixed< T, 4 > &  row1,
const vnl_vector_fixed< T, 4 > &  row2 
)

Construct from the first two rows.

Definition at line 32 of file vpgl_affine_camera.hxx.

◆ vpgl_affine_camera() [3/5]

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

Construct from a 3x4 matrix, sets the last row to 0001.

The bottom right entry had better not be 0.

Definition at line 42 of file vpgl_affine_camera.hxx.

◆ vpgl_affine_camera() [4/5]

template<class T >
vpgl_affine_camera< T >::vpgl_affine_camera ( vgl_vector_3d< T >  ray,
vgl_vector_3d< T >  up,
vgl_point_3d< T >  stare_pt,
u0,
v0,
su,
sv 
)

Construct from a ray direction, up vector, 3-d stare point: vgl interface.

p projects to (u0, v0), su and sv are calibration scale factors

Definition at line 57 of file vpgl_affine_camera.hxx.

◆ vpgl_affine_camera() [5/5]

template<class T>
vpgl_affine_camera< T >::vpgl_affine_camera ( vnl_vector_fixed< T, 3 >  ray,
vnl_vector_fixed< T, 3 >  up,
vnl_vector_fixed< T, 3 >  stare_pt,
u0,
v0,
su,
sv 
)
inline

Construct from a ray direction, up vector, 3-d stare point: vnl interface.

p projects to (u0, v0), su and sv are calibration scale factors

Definition at line 46 of file vpgl_affine_camera.h.

Member Function Documentation

◆ backproject() [1/2]

template<class T >
vgl_homg_line_3d_2_points< T > vpgl_affine_camera< T >::backproject ( const vgl_homg_point_2d< T > &  image_point) const
overridevirtual

Find the 3d ray that goes through the camera center.

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

The finite point of the ray is at the viewing distance from the origin

Reimplemented from vpgl_proj_camera< T >.

Definition at line 170 of file vpgl_affine_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
inherited

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_affine_camera< T >::backproject_ray ( const vgl_homg_point_2d< T > &  image_point) const
overridevirtual

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

Reimplemented from vpgl_proj_camera< T >.

Definition at line 191 of file vpgl_affine_camera.hxx.

◆ camera_center()

template<class T >
vgl_homg_point_3d< T > vpgl_affine_camera< T >::camera_center ( ) const
overridevirtual

Find the 3d coordinates of the center of the camera. Will be an ideal point with the sense of the ray direction.

Reimplemented from vpgl_proj_camera< T >.

Definition at line 161 of file vpgl_affine_camera.hxx.

◆ clone()

template<class T >
vpgl_affine_camera< T > * vpgl_affine_camera< T >::clone ( void  ) const
overridevirtual

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

Reimplemented from vpgl_proj_camera< T >.

Definition at line 198 of file vpgl_affine_camera.hxx.

◆ get_matrix()

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

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
inlineinherited

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
inlineinherited

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
inlineinherited

Standard () forward projection operator.

Definition at line 128 of file vpgl_proj_camera.h.

◆ operator==() [1/2]

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

Equality test.

Definition at line 72 of file vpgl_affine_camera.h.

◆ operator==() [2/2]

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

Equality test.

Definition at line 98 of file vpgl_proj_camera.h.

◆ orient_ray_direction()

template<class T >
void vpgl_affine_camera< T >::orient_ray_direction ( vgl_vector_3d< T > const &  look_dir)

flip the ray direction so that dot product with look_dir is positive.

Definition at line 218 of file vpgl_affine_camera.hxx.

◆ principal_plane()

template<class T >
vgl_homg_plane_3d< T > vpgl_affine_camera< T >::principal_plane ( ) const
overridevirtual

Find the world plane perpendicular to the camera rays at viewing distance from the origin.

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

Reimplemented from vpgl_proj_camera< T >.

Definition at line 207 of file vpgl_affine_camera.hxx.

◆ 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
overridevirtualinherited

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
virtualinherited

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
inlineinherited

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
inherited

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
inherited

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

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_affine_camera< T >::set_matrix ( const vnl_matrix_fixed< T, 3, 4 > &  new_camera_matrix)
overridevirtual

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 from vpgl_proj_camera< T >.

Definition at line 133 of file vpgl_affine_camera.hxx.

◆ set_matrix() [2/2]

template<class T >
bool vpgl_affine_camera< T >::set_matrix ( const T *  new_camera_matrix)
overridevirtual

Reimplemented from vpgl_proj_camera< T >.

Definition at line 152 of file vpgl_affine_camera.hxx.

◆ set_rows()

template<class T >
void vpgl_affine_camera< T >::set_rows ( const vnl_vector_fixed< T, 4 > &  row1,
const vnl_vector_fixed< T, 4 > &  row2 
)

Set the top two rows.

Definition at line 114 of file vpgl_affine_camera.hxx.

◆ set_viewing_distance()

template<class T>
void vpgl_affine_camera< T >::set_viewing_distance ( dist)
inline

set a finite viewing distance to allow the methods below to return finite objects.

Definition at line 65 of file vpgl_affine_camera.h.

◆ svd()

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

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_affine_camera< T >::type_name ( ) const
inlineoverridevirtual

class identity functions for casting.

Reimplemented from vpgl_camera< T >.

Definition at line 56 of file vpgl_affine_camera.h.

◆ viewing_distance()

template<class T>
T vpgl_affine_camera< T >::viewing_distance ( ) const
inline

Definition at line 66 of file vpgl_affine_camera.h.

◆ x_vanishing_point()

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

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
inlineinherited

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
inlineinherited

Definition at line 151 of file vpgl_proj_camera.h.

Member Data Documentation

◆ ray_dir_

template<class T>
vgl_vector_3d<T> vpgl_affine_camera< T >::ray_dir_
private

Definition at line 96 of file vpgl_affine_camera.h.

◆ view_distance_

template<class T>
T vpgl_affine_camera< T >::view_distance_
private

Definition at line 95 of file vpgl_affine_camera.h.


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