38#include <visp3/core/vpMomentAreaNormalized.h>
39#include <visp3/core/vpMomentGravityCenter.h>
40#include <visp3/core/vpMomentGravityCenterNormalized.h>
41#include <visp3/core/vpMomentObject.h>
50 bool found_moment_gravity;
51 bool found_moment_surface_normalized;
54 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
58 if (!found_moment_surface_normalized)
60 if (!found_moment_gravity)
63 double Xn = momentGravity.
get()[0] * momentSurfaceNormalized.
get()[0];
64 double Yn = momentGravity.
get()[1] * momentSurfaceNormalized.
get()[0];
82 os << (__FILE__) << std::endl;
83 bool found_moment_gravity;
84 bool found_moment_surface_normalized;
87 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
91 if (!found_moment_surface_normalized)
93 if (!found_moment_gravity)
95 os <<
"Xg = " << momentGravity.
get()[0] <<
"\t"
96 <<
"Yg = " << momentGravity.
get()[1] << std::endl;
97 os <<
"An = " << momentSurfaceNormalized.
get()[0] << std::endl;
105 os << (__FILE__) << std::endl;
106 os <<
"(Xn,Yn) = (" << m.
values[0] <<
", " << m.
values[1] <<
")" << std::endl;
error that can be emitted by ViSP classes.
@ notInitialized
Used to indicate that a parameter is not initialized.
Class handling the normalized surface moment that is invariant in scale and used to estimate depth.
const vpMoment & get(const std::string &moment_name, bool &found) const
vpMomentGravityCenterNormalized()
void printDependencies(std::ostream &os) const VP_OVERRIDE
void compute() VP_OVERRIDE
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpMomentGravityCenterNormalized &v)
const std::vector< double > & get() const
std::vector< double > values
vpMomentDatabase & getMoments() const
const std::vector< double > & get() const