Visual Servoing Platform
version 3.0.1
|
#include <visp3/core/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 106 of file vpMoment.h.
vpMoment::vpMoment | ( | ) |
Default constructor
Definition at line 51 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 119 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), vpMomentArea::printDependencies(), vpMomentGravityCenterNormalized::printDependencies(), vpMomentCentered::printDependencies(), vpMomentAreaNormalized::printDependencies(), and vpMomentAlpha::printDependencies().
|
inline |
Definition at line 145 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(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::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(), 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 99 of file vpMoment.cpp.
References vpException::memoryAllocationError, and name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().
|
pure virtual |
Implemented in vpMomentAlpha, vpMomentCInvariant, vpMomentAreaNormalized, vpMomentGravityCenter, vpMomentCentered, vpMomentBasic, vpMomentGravityCenterNormalized, and vpMomentArea.
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, vpMomentGravityCenterNormalized, and vpMomentArea.
Definition at line 137 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 116 of file vpMoment.cpp.
|
friend |
Prints the moment contents to a stream
os | : a std::stream. |
m | : a moment instance. |
Definition at line 125 of file vpMoment.cpp.
|
protected |
Definition at line 114 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().