Go to the documentation of this file.00001
00002 #ifndef vpgl_rational_adjust_multipt_h_
00003 #define vpgl_rational_adjust_multipt_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_cam_trans_search_lsqr : public vnl_least_squares_function
00028 {
00029 public:
00030
00031 vpgl_cam_trans_search_lsqr(vcl_vector<vpgl_rational_camera<double> > const& cams,
00032 vcl_vector< vcl_vector<vgl_point_2d<double> > > const& image_pts,
00033 vcl_vector< vgl_point_3d<double> > const& initial_pts);
00034
00035 virtual ~vpgl_cam_trans_search_lsqr() {}
00036
00037
00038
00039
00040 virtual void f(vnl_vector<double> const& translation,
00041 vnl_vector<double>& projection_errors);
00042
00043 void get_finals(vcl_vector<vgl_point_3d<double> >& finals);
00044
00045 protected:
00046 vpgl_cam_trans_search_lsqr();
00047 vcl_vector<vgl_point_3d<double> > initial_pts_;
00048 vcl_vector<vpgl_rational_camera<double> > cameras_;
00049 vcl_vector<vcl_vector<vgl_point_2d<double> > > corrs_;
00050 vcl_vector<vgl_point_3d<double> > finals_;
00051 };
00052
00053 class vpgl_rational_adjust_multiple_pts
00054 {
00055 public:
00056 ~vpgl_rational_adjust_multiple_pts() {}
00057
00058
00059 static bool adjust(vcl_vector<vpgl_rational_camera<double> > const& cams,
00060 vcl_vector<vcl_vector< vgl_point_2d<double> > > const& corrs,
00061 double radius, int n,
00062 vcl_vector<vgl_vector_2d<double> >& cam_translations,
00063 vcl_vector<vgl_point_3d<double> >& intersections);
00064
00065
00066 static bool adjust_lev_marq(vcl_vector<vpgl_rational_camera<double> > const& cams,
00067 vcl_vector<vcl_vector< vgl_point_2d<double> > > const& corrs,
00068 vcl_vector<vgl_vector_2d<double> >& cam_translations,
00069 vcl_vector<vgl_point_3d<double> >& intersections);
00070
00071 protected:
00072 vpgl_rational_adjust_multiple_pts();
00073 };
00074
00075
00076 #endif // vpgl_rational_adjust_multipt_h_