ViSP
2.8.0
|
#include <vpMomentCommon.h>
Public Member Functions | |
vpMomentCommon (double dstSurface, std::vector< double > ref, double refAlpha, double dstZ=1.0) | |
void | updateAll (vpMomentObject &object) |
vpMoment & | get (const char *type, bool &found) |
vpMoment & | get_first () |
Static Public Member Functions | |
static double | getAlpha (vpMomentObject &objec) |
static std::vector< double > | getMu3 (vpMomentObject &object) |
static double | getSurface (vpMomentObject &object) |
This class initializes and allows access to commonly used moments.
It is a vpMomentDatabase filled with the following moments:
There is no need to do the linkTo operations manually nor is it necessary to care about the order of moment computation.
This class carries an vpMomentCommon::updateAll method capable of updating AND computing moments from an object (see 4-step process in vpMoment). The moments computed by this class are classical moments used in moment-based visual servoing. For more information see [12].
To initialize this moment set the user needs to compute the following things:
Shortcuts for each of these prerequisites are provided by this class except depth (methods vpMomentCommon::getMu3, vpMomentCommon::getSurface,vpMomentCommon::getAlpha).
Definition at line 96 of file vpMomentCommon.h.
vpMomentCommon::vpMomentCommon | ( | double | dstSurface, |
std::vector< double > | ref, | ||
double | refAlpha, | ||
double | dstZ = 1.0 |
||
) |
Default constructor. Initializes the common database with the following moments: basic, gravity,centered,centered+normalized,normalized gravity,normalized surface, scale-plane-rotation-translation invariant,alpha, symmetric invariant.
dstSurface | : destination surface. You may use vpMomentCommon::getSurface. |
ref | : reference 3rd order moments (see vpMomentAlpha). You may use vpMomentCommon::getMu3. |
refAlpha | : reference alpha (see vpMomentAlpha). You may use vpMomentCommon::getAlpha. |
dstZ | : destination depth. |
Definition at line 53 of file vpMomentCommon.cpp.
References vpMoment::linkTo().
|
inherited |
Retrieves a moment from the database.
type | : Name of the moment's class. |
found | : true if the moment's type exists in the database, false otherwise. |
Definition at line 65 of file vpMomentDatabase.cpp.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), and vpFeatureMoment::update().
|
inlineinherited |
Get the first element in the database. May be useful in case an unnamed object is present but is the only element in the database.
Definition at line 147 of file vpMomentDatabase.h.
|
static |
Gets a reference alpha of an object.
object | : Moment object. |
Definition at line 175 of file vpMomentCommon.cpp.
References vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAlpha::compute(), vpMomentAlpha::get(), vpMoment::linkTo(), and vpMomentDatabase::updateAll().
|
static |
Gets the reference 3rd order moments of an object.
object | : Moment object. |
Definition at line 194 of file vpMomentCommon.cpp.
References vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentCentered::get(), vpMoment::linkTo(), and vpMomentDatabase::updateAll().
|
static |
Gets the surface of an object
object | : moment object |
Definition at line 150 of file vpMomentCommon.cpp.
References vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentObject::DISCRETE, vpMomentCentered::get(), vpMoment::linkTo(), and vpMomentDatabase::updateAll().
|
virtual |
Updates all moments in the database with the object and computes all their values. This is possible because this particular database knows the link between the moments it contains. The order of computation is as follows: vpMomentGravityCenter,vpMomentCentered,vpMomentAlpha,vpMomentCInvariant,vpMomentSInvariant,vpMomentAreaNormalized,vpMomentGravityCenterNormalized
object | : Moment object. |
Example of using a preconfigured database to compute one of the C-invariants:
Reimplemented from vpMomentDatabase.
Definition at line 126 of file vpMomentCommon.cpp.
References vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), and vpMomentDatabase::updateAll().