Go to the documentation of this file.00001
00002 #ifndef vpgl_invmap_cost_function_h_
00003 #define vpgl_invmap_cost_function_h_
00004
00005
00006 #include <vnl/vnl_cost_function.h>
00007 #include <vnl/vnl_vector_fixed.h>
00008 #include <vpgl/vpgl_camera.h>
00009
00010 class vpgl_invmap_cost_function: public vnl_cost_function
00011 {
00012
00013 enum plane_param{X_Y=0, X_Z, Y_Z};
00014 public:
00015
00016 vpgl_invmap_cost_function(vnl_vector_fixed<double, 2> const& image_point,
00017 vnl_vector_fixed<double, 4> const& plane,
00018 const vpgl_camera<double>* rcam);
00019 ~vpgl_invmap_cost_function() {}
00020
00021 double f(vnl_vector<double> const& x);
00022
00023 void set_params(vnl_vector_fixed<double,3> const& xyz, vnl_vector_fixed<double,2> &x);
00024
00025
00026 void set_params(vnl_vector_fixed<double,3> const& xyz, vnl_vector<double> &x);
00027
00028 void point_3d(vnl_vector_fixed<double,2> const& x, vnl_vector_fixed<double, 3>& xyz);
00029
00030
00031 void point_3d(vnl_vector<double> const& x, vnl_vector_fixed<double, 3>& xyz);
00032
00033 protected:
00034
00035 vnl_vector_fixed<double, 2> image_point_;
00036
00037 vnl_vector_fixed<double, 4> plane_;
00038
00039 const vpgl_camera<double>* cam_ptr_;
00040
00041 plane_param pp_;
00042 };
00043
00044 #endif // vpgl_invmap_cost_function_h_