vpgl_backproject.h
Go to the documentation of this file.
1 // This is core/vpgl/algo/vpgl_backproject.h
2 #ifndef vpgl_backproject_h_
3 #define vpgl_backproject_h_
4 //:
5 // \file
6 // \brief Methods for back_projecting from cameras to 3-d geometric structures
7 // \author J. L. Mundy
8 // \date Oct 29, 2006
9 //
10 // \verbatim
11 // Modifications
12 // Yi Dong Jun-2015 added relative diameter as one argument, with default value 1.0 (same as before)
13 // \endverbatim
14 
17 #include <vpgl/vpgl_proj_camera.h>
18 #include <vgl/vgl_fwd.h>
19 #include <vnl/vnl_double_2.h>
20 #include <vnl/vnl_double_3.h>
21 #include <vnl/vnl_double_4.h>
22 
24 {
25  public:
27 
28  //: Generic camera interfaces (pointer for abstract class)
29  // An iterative solution using forward projection
30  // vnl interface
31 
32  //:Backproject an image point onto a plane, start with initial_guess
33  static bool bproj_plane(const vpgl_camera<double>* cam,
34  vnl_double_2 const& image_point,
35  vnl_double_4 const& plane,
36  vnl_double_3 const& initial_guess,
37  vnl_double_3& world_point,
38  double error_tol = 0.05,
39  double relative_diameter = 1.0);
40 
41  // === vgl interface ===
42 
43  //:Backproject an image point onto a plane, start with initial_guess
44  static bool bproj_plane(const vpgl_camera<double>* cam,
45  vgl_point_2d<double> const& image_point,
46  vgl_plane_3d<double> const& plane,
47  vgl_point_3d<double> const& initial_guess,
48  vgl_point_3d<double>& world_point,
49  double error_tol = 0.05,
50  double relative_diameter = 1.0);
51 
52  // +++ concrete rational camera interfaces +++
53 
54  // === vnl interface ===
55 
56  //:Backproject an image point onto a plane, start with initial_guess
57  static bool bproj_plane(vpgl_rational_camera<double> const& rcam,
58  vnl_double_2 const& image_point,
59  vnl_double_4 const& plane,
60  vnl_double_3 const& initial_guess,
61  vnl_double_3& world_point,
62  double error_tol = 0.05,
63  double relative_diameter = 1.0);
64 
65  // ==== vgl interface ===
66 
67  //:Backproject an image point onto a plane, start with initial_guess
68  static bool bproj_plane(vpgl_rational_camera<double> const& rcam,
69  vgl_point_2d<double> const& image_point,
70  vgl_plane_3d<double> const& plane,
71  vgl_point_3d<double> const& initial_guess,
72  vgl_point_3d<double>& world_point,
73  double error_tol = 0.05,
74  double relative_diameter = 1.0);
75 
76  //:Backproject a point with associated direction vector in the image to a plane in 3-d, passing through the center of projection and containing the point and vector.
77  // ** Defined only for a projective camera **
78  static bool bproj_point_vector(vpgl_proj_camera<double> const& cam,
79  vgl_point_2d<double> const& point,
80  vgl_vector_2d<double> const& vect,
81  vgl_plane_3d<double>& plane);
82 
83  //: Use backprojection to determine direction to camera from 3-d point
85  vgl_point_3d<double> const& point,
86  vgl_vector_3d<double> &to_camera,
87  double error_tol = 0.05,
88  double relative_diameter = 1.0);
89 
90  private:
91  //: constructor private - static methods only
93 };
94 
95 #endif // vpgl_backproject_h_
A camera model based on ratios of cubic polynomials.
static bool bproj_point_vector(vpgl_proj_camera< double > const &cam, vgl_point_2d< double > const &point, vgl_vector_2d< double > const &vect, vgl_plane_3d< double > &plane)
Backproject a point with associated direction vector in the image to a plane in 3-d,...
A local rational camera model.
A camera model using the standard 3x4 matrix representation.
vpgl_backproject()
constructor private - static methods only.
static bool direction_to_camera(vpgl_local_rational_camera< double > const &cam, vgl_point_3d< double > const &point, vgl_vector_3d< double > &to_camera, double error_tol=0.05, double relative_diameter=1.0)
Use backprojection to determine direction to camera from 3-d point.
static bool bproj_plane(const vpgl_camera< double > *cam, vnl_double_2 const &image_point, vnl_double_4 const &plane, vnl_double_3 const &initial_guess, vnl_double_3 &world_point, double error_tol=0.05, double relative_diameter=1.0)
Generic camera interfaces (pointer for abstract class).