6 #include <vcl_compiler_detection.h> 8 # include <vcl_msvc_warnings.h> 10 #include <vcl_deprecated.h> 17 plane_(plane), cam_ptr_(cam), pp_(X_Y)
21 double anx = std::fabs(
plane_[0]), any = std::fabs(
plane_[1]),
22 anz = std::fabs(
plane_[2]);
23 if (anx<any && anz<any)
25 if (any<anx && anz<anx)
39 double u,
v,X=p_3d[0],Y=p_3d[1],Z=p_3d[2];
75 std::cerr <<
"Improper prameterization in vpgl_invmap_cost_function\n";
83 VXL_DEPRECATED_MACRO(
"vpgl_invmap_cost_function::set_params(, vnl_vector<double>&)");
107 std::cerr <<
"Improper prameterization in vpgl_invmap_cost_function\n";
141 xyz[0] = 0; xyz[1] = 0; xyz[2] = 0;
142 std::cerr <<
"Improper prameterization in vpgl_invmap_cost_function\n";
150 VXL_DEPRECATED_MACRO(
"vpgl_invmap_cost_function::point_3d(vnl_vector<double>,)");
177 xyz[0] = 0; xyz[1] = 0; xyz[2] = 0;
178 std::cerr <<
"Improper prameterization in vpgl_invmap_cost_function\n";
void set_params(vnl_vector_fixed< double, 3 > const &xyz, vnl_vector_fixed< double, 2 > &x)
set the parameter values from the 3-d point.
void point_3d(vnl_vector_fixed< double, 2 > const &x, vnl_vector_fixed< double, 3 > &xyz)
get the 3-d point defined by the parameters (and the plane).
vnl_vector_fixed< double, 4 > plane_
plane coefficients.
const vpgl_camera< double > * cam_ptr_
rational camera.
double f(vnl_vector< double > const &x) override
The cost function. x is a vector holding the two plane parameters.
vpgl_invmap_cost_function(vnl_vector_fixed< double, 2 > const &image_point, vnl_vector_fixed< double, 4 > const &plane, const vpgl_camera< double > *rcam)
Constructor - rcam pointer is not deleted by this class.
plane_param pp_
the well-conditioned parameterization.
virtual void project(const T x, const T y, const T z, T &u, T &v) const =0
The generic camera interface. u represents image column, v image row.
vnl_vector_fixed< double, 2 > image_point_
image point.