Visual Servoing Platform
version 3.5.1 under development (2023-09-22)
|
#include <visp3/core/vpMomentCommon.h>
Public Member Functions | |
vpMomentCommon (double dstSurface, const std::vector< double > &ref, double refAlpha, double dstZ=1.0, bool flg_sxsyfromnormalized=false) | |
virtual | ~vpMomentCommon () |
void | updateAll (vpMomentObject &object) |
Inherited functionalities from vpMomentDatabase | |
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 [45].
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 99 of file vpMomentCommon.h.
vpMomentCommon::vpMomentCommon | ( | double | dstSurface, |
const 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 54 of file vpMomentCommon.cpp.
References vpMoment::linkTo().
|
virtual |
Definition at line 226 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 64 of file vpMomentDatabase.cpp.
Referenced by vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenterNormalized::compute(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentAlpha::printDependencies(), vpMomentArea::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentCentered::printDependencies(), vpMomentGravityCenterNormalized::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 149 of file vpMomentDatabase.h.
|
static |
Gets a reference alpha of an object.
object | : Moment object. |
Definition at line 176 of file vpMomentCommon.cpp.
References vpMomentAlpha::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAlpha::get(), vpMoment::linkTo(), and vpMomentDatabase::updateAll().
|
static |
Gets the reference 3rd order moments of an object.
object | : Moment object. |
Definition at line 199 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 149 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 vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenter::compute(), vpMomentGravityCenterNormalized::compute(), and vpMomentDatabase::updateAll().