contrib/gel/mrc/vpgl/algo/vpgl_backproject.h
Go to the documentation of this file.
00001 // This is gel/mrc/vpgl/algo/vpgl_backproject.h
00002 #ifndef vpgl_backproject_h_
00003 #define vpgl_backproject_h_
00004 //:
00005 // \file
00006 // \brief Methods for back_projecting from cameras to 3-d geometric structures
00007 // \author J. L. Mundy
00008 // \date Oct 29, 2006
00009 
00010 #include <vpgl/vpgl_rational_camera.h>
00011 #include <vpgl/vpgl_proj_camera.h>
00012 #include <vgl/vgl_fwd.h>
00013 #include <vnl/vnl_double_2.h>
00014 #include <vnl/vnl_double_3.h>
00015 #include <vnl/vnl_double_4.h>
00016 
00017 class vpgl_backproject
00018 {
00019  public:
00020   ~vpgl_backproject();
00021 
00022   //: Generic camera interfaces (pointer for abstract class)
00023   // An iterative solution using forward projection
00024   // vnl interface
00025 
00026   //:Backproject an image point onto a plane, start with initial_guess
00027   static bool bproj_plane(const vpgl_camera<double>* cam,
00028                           vnl_double_2 const& image_point,
00029                           vnl_double_4 const& plane,
00030                           vnl_double_3 const& initial_guess,
00031                           vnl_double_3& world_point);
00032 
00033        // === vgl interface ===
00034 
00035   //:Backproject an image point onto a plane, start with initial_guess
00036   static bool bproj_plane(const vpgl_camera<double>*  cam,
00037                           vgl_point_2d<double> const& image_point,
00038                           vgl_plane_3d<double> const& plane,
00039                           vgl_point_3d<double> const& initial_guess,
00040                           vgl_point_3d<double>& world_point);
00041 
00042             // +++ concrete rational camera interfaces +++
00043 
00044        // === vnl interface ===
00045 
00046   //:Backproject an image point onto a plane, start with initial_guess
00047   static bool bproj_plane(vpgl_rational_camera<double> const& rcam,
00048                           vnl_double_2 const& image_point,
00049                           vnl_double_4 const& plane,
00050                           vnl_double_3 const& initial_guess,
00051                           vnl_double_3& world_point);
00052 
00053        // ==== vgl interface ===
00054 
00055   //:Backproject an image point onto a plane, start with initial_guess
00056   static bool bproj_plane(vpgl_rational_camera<double> const& rcam,
00057                           vgl_point_2d<double> const& image_point,
00058                           vgl_plane_3d<double> const& plane,
00059                           vgl_point_3d<double> const& initial_guess,
00060                           vgl_point_3d<double>& world_point);
00061 
00062   //: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.
00063   //  ** Defined only for a projective camera **
00064   static bool bproj_point_vector(vpgl_proj_camera<double> const& cam,
00065                                  vgl_point_2d<double> const& point,
00066                                  vgl_vector_2d<double> const& vect,
00067                                  vgl_plane_3d<double>& plane);
00068 
00069  private:
00070   //: constructor private - static methods only
00071   vpgl_backproject();
00072 };
00073 
00074 #endif // vpgl_backproject_h_