Go to the documentation of this file.00001
00002 #ifndef vpgl_rational_adjust_onept_h_
00003 #define vpgl_rational_adjust_onept_h_
00004
00005
00006
00007
00008
00009
00010
00011 #include <vcl_vector.h>
00012 #include <vnl/vnl_vector.h>
00013 #include <vnl/vnl_least_squares_function.h>
00014 #include <vpgl/vpgl_rational_camera.h>
00015 #include <vgl/vgl_vector_2d.h>
00016 #include <vgl/vgl_point_2d.h>
00017 #include <vgl/vgl_point_3d.h>
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 class vpgl_z_search_lsqr : public vnl_least_squares_function
00028 {
00029 public:
00030
00031 vpgl_z_search_lsqr(vcl_vector<vpgl_rational_camera<double> > const& cams,
00032 vcl_vector<vgl_point_2d<double> > const& image_pts,
00033 vgl_point_3d<double> const& initial_pt);
00034
00035 virtual ~vpgl_z_search_lsqr() {}
00036
00037
00038
00039
00040 virtual void f(vnl_vector<double> const& elevation,
00041 vnl_vector<double>& projection_error);
00042 double xm() const {return xm_;}
00043 double ym() const {return ym_;}
00044 protected:
00045 vpgl_z_search_lsqr();
00046 vgl_point_3d<double> initial_pt_;
00047 vcl_vector<vpgl_rational_camera<double> > cameras_;
00048 vcl_vector<vgl_point_2d<double> > image_pts_;
00049 double xm_, ym_;
00050 };
00051
00052
00053 class vpgl_rational_adjust_onept
00054 {
00055 public:
00056 ~vpgl_rational_adjust_onept() {}
00057
00058 static bool
00059 find_intersection_point(vcl_vector<vpgl_rational_camera<double> > const& cams,
00060 vcl_vector<vgl_point_2d<double> > const& corrs,
00061 vgl_point_3d<double>& p_3d);
00062
00063 static bool
00064 refine_intersection_pt(vcl_vector<vpgl_rational_camera<double> > const& cams,
00065 vcl_vector<vgl_point_2d<double> > const& image_pts,
00066 vgl_point_3d<double> const& initial_pt,
00067 vgl_point_3d<double>& final_pt);
00068
00069 static bool adjust(vcl_vector<vpgl_rational_camera<double> > const& cams,
00070 vcl_vector<vgl_point_2d<double> > const& corrs,
00071 vcl_vector<vgl_vector_2d<double> >& cam_translations,
00072 vgl_point_3d<double>& intersection);
00073
00074 protected:
00075 vpgl_rational_adjust_onept();
00076 };
00077
00078
00079 #endif // vpgl_rational_adjust_onept_h_