![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpMomentCInvariant.h>
Public Member Functions | |
| VP_EXPLICIT | vpMomentCInvariant (bool flg_sxsynormalization=false) |
| double | C1 () const |
| double | C2 () const |
| double | C3 () const |
| double | C4 () const |
| double | C5 () const |
| double | C6 () const |
| double | C7 () const |
| double | C8 () const |
| double | C9 () const |
| double | C10 () const |
| void | compute () VP_OVERRIDE |
| double | get (unsigned int i) const |
| double | getC (unsigned int i) const |
| double | getI (unsigned int index) const |
| void | printInvariants (std::ostream &os) const |
| double | getII (unsigned int i) const |
| double | getK () const |
| double | getS (unsigned int i) const |
| const std::string | name () const VP_OVERRIDE |
| void | printI (unsigned int index) |
| double | Px () |
| double | Py () |
| double | Sx () const |
| double | Sy () const |
| double | getIn1 () const |
| double | getCN (unsigned int i) const |
| double | getSN (unsigned int i) const |
| bool | isSxSyfromNormalizedMoments () const |
| const std::vector< double > & | getMomentVector () const |
Inherited functionalities from vpMoment | |
| const vpMomentObject & | getObject () const |
| const std::vector< double > & | get () const |
| void | linkTo (vpMomentDatabase &moments) |
| 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 vpMomentCInvariant &v) |
This class defines several 2D (translation+rotation+scale) invariants for both symmetric and non-symmetric objects. These moment-based invariants are described in the following papers [6], [54].
The descriptions for the invariants
to
can be found in [6] and for invariants
,
,
,
in [54].
These invariants are classicaly used in visual servoing to control the out-of-plane rotations. The C-type or P-type invariants are used for non-symmetric objects whereas the S-type invariants are used for symmetric objects.
For most cases of non-symmetric objects, (
,
) or (
,
) couples are widely used to control x and y rotations. For symmetric objects
and
are the only choice.
There are 14 translation+rotation+scale invariants (10 C-type, 2 P-type and 2 S-type) that can be accessed from by vpMomentCInvariant::get or any of the get shortcuts.
The example below shows how to retrieve the
invariant:
vpMomentCInvariant depends on vpMomentCentered (see vpMomentDatabase and vpMomentCommon).
Definition at line 128 of file vpMomentCInvariant.h.
| BEGIN_VISP_NAMESPACE vpMomentCInvariant::vpMomentCInvariant | ( | bool | flg_sxsynormalization = false | ) |
Default constructor. (option to use a different calculation mode for sx and sy)
Definition at line 44 of file vpMomentCInvariant.cpp.
References vpMoment::values.
Referenced by operator<<.
|
inline |
Shorcut for getting the value of
.
Definition at line 153 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 189 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 157 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 161 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 165 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 169 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 173 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 177 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 181 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 185 of file vpMomentCInvariant.h.
References vpMoment::values.
|
virtual |
Computes translation-plane-rotation-scale invariants. Depends on vpMomentCentered. All possible invariants are computed here. The selection of the invariant is done afterwards.
Implements vpMoment.
Definition at line 192 of file vpMomentCInvariant.cpp.
References vpMomentObject::DISCRETE, vpMomentCentered::get(), vpMomentDatabase::get(), vpMomentObject::get(), vpMoment::getMoments(), vpMoment::getObject(), vpException::notInitialized, and vpMoment::values.
|
inlineinherited |
Returns all values computed by the moment.
Definition at line 155 of file vpMoment.h.
References values.
Referenced by vpMomentGravityCenterNormalized::compute(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentCentered::get(), and vpMomentGravityCenterNormalized::printDependencies().
|
inline |
Gets the desired invariant.
| i | given index. For invariants from C1 to C10 the corresponding index is from 0 to 9. For |
Definition at line 199 of file vpMomentCInvariant.h.
References get(), and vpMoment::values.
Referenced by get().
|
inline |
Access to partial invariant c (see [2]).
Definition at line 204 of file vpMomentCInvariant.h.
Referenced by vpFeatureMomentCInvariant::compute_interaction().
|
inline |
Getter for c (calculated from normalized 2nd and 3ord order moments)
Definition at line 267 of file vpMomentCInvariant.h.
|
inline |
Access to partial invariants. The index convention is the same as in [1].
Definition at line 208 of file vpMomentCInvariant.h.
Referenced by vpFeatureMomentCInvariant::compute_interaction().
|
inline |
Access to partial invariant I (see [2]).
Definition at line 218 of file vpMomentCInvariant.h.
Referenced by vpFeatureMomentCInvariant::compute_interaction().
|
inline |
Getters for I (calculated from normalized 2nd and 3ord order moments)
Definition at line 261 of file vpMomentCInvariant.h.
|
inline |
Access to partial invariant K (see [2]).
Definition at line 222 of file vpMomentCInvariant.h.
|
inlineprotectedinherited |
Returns the linked moment database.
Definition at line 118 of file vpMoment.h.
Referenced by vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentAlpha::printDependencies(), vpMomentArea::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentCentered::printDependencies(), and vpMomentGravityCenterNormalized::printDependencies().
|
inline |
To get all the invariant values as a whole.
Definition at line 283 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inlineinherited |
Definition at line 150 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenter::compute(), vpMomentBasic::get(), vpMomentBasic::get(), vpMomentCentered::get(), vpMomentBasic::operator<<, vpMomentCentered::operator<<, vpMomentArea::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentBasic::printDependencies(), vpMomentCentered::printDependencies(), vpMomentGravityCenter::printDependencies(), vpMomentCentered::printWithIndices(), and vpMomentCentered::set().
|
inline |
Access to partial invariant S (see [2]).
Definition at line 227 of file vpMomentCInvariant.h.
Referenced by vpFeatureMomentCInvariant::compute_interaction().
|
inline |
Getter for s (calculated from normalized 2nd and 3ord order moments)
Definition at line 273 of file vpMomentCInvariant.h.
|
inline |
To know if Sx and Sy were calculated from normalized moments or not
Definition at line 278 of file vpMomentCInvariant.h.
|
inherited |
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 114 of file vpMoment.cpp.
References name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), and vpMomentCommon::getSurface().
|
inlinevirtual |
|
virtualinherited |
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, vpMomentArea, vpMomentAreaNormalized, vpMomentBasic, vpMomentCentered, vpMomentGravityCenter, and vpMomentGravityCenterNormalized.
Definition at line 134 of file vpMoment.cpp.
Referenced by name().
| void vpMomentCInvariant::printI | ( | unsigned int | index | ) |
Print partial invariant.
Prints the temporary invariants. Used for debug purposes only
| index | : index of the temporary invariant |
Definition at line 266 of file vpMomentCInvariant.cpp.
| void vpMomentCInvariant::printInvariants | ( | std::ostream & | os | ) | const |
Print the moment invariants used to obtain the actual visual features
Print out all invariants that were computed There are 15 of them, as in [Point-based and region based.ITRO05] [54]
Definition at line 273 of file vpMomentCInvariant.cpp.
|
inline |
Shorcut for getting the value of
.
Definition at line 242 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 246 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 251 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inline |
Shorcut for getting the value of
.
Definition at line 255 of file vpMomentCInvariant.h.
References vpMoment::values.
|
inherited |
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 127 of file vpMoment.cpp.
Referenced by name().
|
friend |
Outputs the moment's values to a stream.
Definition at line 285 of file vpMomentCInvariant.cpp.
References vpMomentCInvariant().
|
protectedinherited |
Definition at line 113 of file vpMoment.h.
Referenced by vpMomentCInvariant::C1(), vpMomentCInvariant::C10(), vpMomentCInvariant::C2(), vpMomentCInvariant::C3(), vpMomentCInvariant::C4(), vpMomentCInvariant::C5(), vpMomentCInvariant::C6(), vpMomentCInvariant::C7(), vpMomentCInvariant::C8(), vpMomentCInvariant::C9(), vpMomentAlpha::compute(), vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCentered::compute(), vpMomentCInvariant::compute(), vpMomentGravityCenter::compute(), vpMomentGravityCenterNormalized::compute(), get(), vpMomentAlpha::get(), vpMomentCentered::get(), vpMomentCInvariant::get(), vpMomentGravityCenter::get(), vpMomentCInvariant::getMomentVector(), vpMomentGravityCenter::getXg(), vpMomentGravityCenter::getYg(), operator<<, vpMomentAlpha::operator<<, vpMomentArea::operator<<, vpMomentAreaNormalized::operator<<, vpMomentCentered::operator<<, vpMomentGravityCenter::operator<<, vpMomentGravityCenterNormalized::operator<<, vpMomentCInvariant::Px(), vpMomentCInvariant::Py(), vpMomentCentered::set(), vpMomentCInvariant::Sx(), vpMomentCInvariant::Sy(), vpMoment(), vpMomentAlpha::vpMomentAlpha(), vpMomentArea::vpMomentArea(), vpMomentAreaNormalized::vpMomentAreaNormalized(), vpMomentCInvariant::vpMomentCInvariant(), and vpMomentGravityCenter::vpMomentGravityCenter().