Visual Servoing Platform
version 3.6.1 under development (2024-12-06)
|
#include <visp3/core/vpMoment.h>
Public Member Functions | |
vpMoment () | |
virtual | ~vpMoment () |
Protected Member Functions | |
vpMomentDatabase & | getMoments () const |
Protected Attributes | |
std::vector< double > | values |
Inherited functionalities from vpMoment | |
virtual void | compute ()=0 |
const vpMomentObject & | getObject () const |
const std::vector< double > & | get () const |
void | linkTo (vpMomentDatabase &moments) |
virtual const std::string | name () const =0 |
virtual void | printDependencies (std::ostream &os) const |
void | update (vpMomentObject &object) |
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, const vpMoment &m) |
This class defines shared methods/attributes for 2D moments.
All moments or combination of moments in the moments module are based on this class. A moment uses a vpMomentObject object to access all useful information. Moment values are obtained by a 4-step process common for all moment types:
A moment may also be linked to a vpMomentDatabase. Moments linked to a database are able to access each others values. Some moments can be computed only if they are linked to a a database containing their dependencies. Linking to a database is done using the vpMoment::linkTo(...) method.
There are no constraints about format of the array returned by vpMoment::get(); any implementation is fine.
Each moment must have a string name by implementing the char* vpMoment::name() method which allows to identify the moment in the database. Each moment must also implement a compute method describing how to obtain its values from the object.
Definition at line 105 of file vpMoment.h.
vpMoment::vpMoment | ( | ) |
Default constructor
Definition at line 61 of file vpMoment.cpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 140 of file vpMoment.h.
|
pure virtual |
|
inline |
Returns all values computed by the moment.
Definition at line 150 of file vpMoment.h.
Referenced by vpMomentGravityCenterNormalized::compute(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentCentered::get(), vpFeatureMoment::init(), vpMomentGravityCenterNormalized::printDependencies(), and vpFeatureMoment::update().
|
inlineprotected |
Returns the linked moment database.
Definition at line 118 of file vpMoment.h.
Referenced by vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentAlpha::printDependencies(), vpMomentArea::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentCentered::printDependencies(), and vpMomentGravityCenterNormalized::printDependencies().
|
inline |
Definition at line 145 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenter::compute(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentBasic::compute_interaction(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentBasic::get(), vpMomentCentered::get(), vpFeatureMomentBasic::interaction(), vpFeatureMomentCentered::interaction(), vpMomentArea::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentBasic::printDependencies(), vpMomentCentered::printDependencies(), vpMomentGravityCenter::printDependencies(), vpMomentCentered::printWithIndices(), and vpMomentCentered::set().
void vpMoment::linkTo | ( | vpMomentDatabase & | data_base | ) |
Links the moment to a database of moment primitives. If the moment depends on other moments, these moments must be linked to the same database.
data_base | : database of moment primitives. |
Definition at line 114 of file vpMoment.cpp.
References name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().
|
pure virtual |
Implemented in vpMomentGravityCenterNormalized, vpMomentGravityCenter, vpMomentCInvariant, vpMomentCentered, vpMomentBasic, vpMomentAreaNormalized, vpMomentArea, and vpMomentAlpha.
Referenced by linkTo().
|
virtual |
Prints values of all dependent moments required to calculate a specific vpMoment. Not made pure to maintain compatibility Recommended : Types inheriting from vpMoment should implement this function
Reimplemented in vpMomentGravityCenterNormalized, vpMomentGravityCenter, vpMomentCentered, vpMomentBasic, vpMomentAreaNormalized, vpMomentArea, and vpMomentAlpha.
Definition at line 134 of file vpMoment.cpp.
void vpMoment::update | ( | vpMomentObject & | moment_object | ) |
Updates the moment with the current object. This does not compute any values.
moment_object | : object descriptor of the current camera vision. |
Definition at line 127 of file vpMoment.cpp.
|
friend |
Prints the moment contents to a stream
os | : a std::stream. |
m | : a moment instance. |
Definition at line 50 of file vpMoment.cpp.
|
protected |
Definition at line 113 of file vpMoment.h.
Referenced by vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenter::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentGravityCenter::get(), vpMomentCentered::get(), vpMomentCInvariant::getMomentVector(), vpMomentCentered::set(), vpMomentAlpha::vpMomentAlpha(), vpMomentArea::vpMomentArea(), vpMomentAreaNormalized::vpMomentAreaNormalized(), vpMomentCInvariant::vpMomentCInvariant(), and vpMomentGravityCenter::vpMomentGravityCenter().