Visual Servoing Platform
version 3.0.0
|
#include <visp3/core/vpMomentCommon.h>
Public Member Functions | |
vpMomentCommon (double dstSurface, std::vector< double > ref, double refAlpha, double dstZ=1.0, bool flg_sxsyfromnormalized=false) | |
void | updateAll (vpMomentObject &object) |
~vpMomentCommon () | |
const vpMoment & | get (const char *type, bool &found) const |
vpMoment & | get_first () |
Static Public Member Functions | |
static double | getAlpha (vpMomentObject &object) |
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 [26].
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 94 of file vpMomentCommon.h.
vpMomentCommon::vpMomentCommon | ( | double | dstSurface, |
std::vector< double > | ref, | ||
double | refAlpha, | ||
double | dstZ = 1.0 , |
||
bool | flg_sxsyfromnormalized = false |
||
) |
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. |
flg_sxsyfromnormalized | : flag to enable calculation of sx,sy from normalized moments. |
Definition at line 50 of file vpMomentCommon.cpp.
References vpMoment::linkTo().
vpMomentCommon::~vpMomentCommon | ( | ) |
Definition at line 210 of file vpMomentCommon.cpp.
|
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 61 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(), vpMomentArea::printDependencies(), vpMomentGravityCenterNormalized::printDependencies(), vpMomentCentered::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentAlpha::printDependencies(), 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 144 of file vpMomentDatabase.h.
|
static |
Gets a reference alpha of an object.
object | : Moment object. |
Definition at line 167 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 186 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 143 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 120 of file vpMomentCommon.cpp.
References vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), and vpMomentDatabase::updateAll().