Visual Servoing Platform
version 3.4.0
|
#include <vpMoment.h>
Public Member Functions | |
vpMoment () | |
virtual | ~vpMoment () |
Inherited functionalities from vpMoment | |
virtual void | compute ()=0 |
const vpMomentObject & | getObject () const |
const std::vector< double > & | get () const |
void | linkTo (vpMomentDatabase &moments) |
virtual const char * | name () const =0 |
virtual void | printDependencies (std::ostream &os) const |
void | update (vpMomentObject &object) |
Protected Member Functions | |
vpMomentDatabase & | getMoments () const |
Protected Attributes | |
std::vector< double > | values |
Friends | |
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 110 of file vpMoment.h.
vpMoment::vpMoment | ( | ) |
Default constructor
Definition at line 51 of file vpMoment.cpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 145 of file vpMoment.h.
|
pure virtual |
Implemented in vpMomentAlpha, vpMomentCInvariant, vpMomentAreaNormalized, vpMomentGravityCenter, vpMomentCentered, vpMomentBasic, vpMomentArea, and vpMomentGravityCenterNormalized.
Referenced by vpMomentCInvariant::C10(), vpMomentAlpha::~vpMomentAlpha(), vpMomentArea::~vpMomentArea(), vpMomentAreaNormalized::~vpMomentAreaNormalized(), vpMomentBasic::~vpMomentBasic(), vpMomentCentered::~vpMomentCentered(), and vpMomentGravityCenter::~vpMomentGravityCenter().
|
inline |
Returns all values computed by the moment.
Definition at line 155 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 123 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), vpMomentGravityCenterNormalized::printDependencies(), vpMomentArea::printDependencies(), vpMomentCentered::printDependencies(), vpMomentAreaNormalized::printDependencies(), and vpMomentAlpha::printDependencies().
|
inline |
Definition at line 150 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentBasic::compute_interaction(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentBasic::get(), vpMomentCentered::get(), vpFeatureMomentBasic::interaction(), vpFeatureMomentCentered::interaction(), vpMomentArea::printDependencies(), vpMomentBasic::printDependencies(), vpMomentCentered::printDependencies(), vpMomentGravityCenter::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentCentered::printWithIndices(), vpMomentCentered::set(), and vpMomentCInvariant::vpMomentCInvariant().
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 98 of file vpMoment.cpp.
References vpException::memoryAllocationError, and name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().
|
pure virtual |
Implemented in vpMomentCInvariant, vpMomentAlpha, vpMomentAreaNormalized, vpMomentGravityCenter, vpMomentCentered, vpMomentBasic, vpMomentArea, and vpMomentGravityCenterNormalized.
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 vpMomentAlpha, vpMomentAreaNormalized, vpMomentGravityCenter, vpMomentCentered, vpMomentBasic, vpMomentArea, and vpMomentGravityCenterNormalized.
Definition at line 135 of file vpMoment.cpp.
Referenced by vpMomentAlpha::is_symmetric(), vpMomentArea::name(), vpMomentBasic::name(), vpMomentCentered::name(), vpMomentGravityCenter::name(), and vpMomentAreaNormalized::name().
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 115 of file vpMoment.cpp.
|
friend |
Prints the moment contents to a stream
os | : a std::stream. |
m | : a moment instance. |
Definition at line 122 of file vpMoment.cpp.
Referenced by vpMomentCInvariant::getMomentVector(), vpMomentAlpha::is_symmetric(), vpMomentArea::name(), vpMomentBasic::name(), vpMomentCentered::name(), vpMomentGravityCenter::name(), and vpMomentAreaNormalized::name().
|
protected |
Definition at line 118 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), vpMomentCentered::get(), vpMomentGravityCenter::get(), vpMomentCInvariant::getMomentVector(), vpMomentCentered::set(), vpMomentAlpha::vpMomentAlpha(), vpMomentArea::vpMomentArea(), vpMomentAreaNormalized::vpMomentAreaNormalized(), vpMomentCInvariant::vpMomentCInvariant(), and vpMomentGravityCenter::vpMomentGravityCenter().