![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpMomentCentered.h>
Public Member Functions | |
vpMomentCentered () | |
virtual | ~vpMomentCentered () |
void | compute () |
double | get (unsigned int i, unsigned int j) const |
const std::vector< double > & | get () const |
const char * | name () const |
void | printWithIndices (std::ostream &os) const |
void | printDependencies (std::ostream &os) const |
Inherited functionalities from vpMoment | |
const vpMomentObject & | getObject () const |
void | linkTo (vpMomentDatabase &moments) |
void | update (vpMomentObject &object) |
Protected Member Functions | |
void | set (unsigned int i, unsigned int j, double value) |
vpMomentDatabase & | getMoments () const |
Protected Attributes | |
std::vector< double > | values |
Friends | |
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, const vpMomentCentered &v) |
This class defines the double-indexed centered moment descriptor .
In the case of a dense object O, centered moments are defined by:
In the case of a discrete set of n points, centered moments are defined by:
where are the coordinates of the center of gravity.
The centered moments are computed from the object at the highest possible order. For example if the vpMomentObject is defined up to order 5, vpMomentCentered will be too.
Values of vpMomentCentered may be accessed by one of the two vpMomentCentered::get methods. When using vpMomentCentered::get (), the format of the return vector is the following: is stored at vpMomentCentered::get ()[j* (vpMomentObject::getOrder () +1)+i]
vpMomentCentered depends on vpMomentGravityCenter.
Definition at line 78 of file vpMomentCentered.h.
vpMomentCentered::vpMomentCentered | ( | ) |
Default constructor.
Definition at line 94 of file vpMomentCentered.cpp.
|
inlinevirtual |
Definition at line 82 of file vpMomentCentered.h.
|
virtual |
Computes centered moments of all available orders. Depends on vpMomentGravityCenter.
Implements vpMoment.
Definition at line 64 of file vpMomentCentered.cpp.
|
inline |
Returns all centered moment values with
where order is the object's order.
For example, if the maximal order is 3, the following values are provided:
To have a better reading of the moments you can picture them as a triangular matrix:
The moments of the same order are on each of the matrix reverse diagonals. To access for example to the centered moment , you should use this kind of code:
Definition at line 134 of file vpMomentCentered.h.
double vpMomentCentered::get | ( | unsigned int | i, |
unsigned int | j | ||
) | const |
Gets the desired moment using indexes.
i | : first index of the centered moment. |
j | : second index of the centered moment. |
Definition at line 102 of file vpMomentCentered.cpp.
|
inlineprotectedinherited |
Returns the linked moment database.
Definition at line 122 of file vpMoment.h.
|
inlineinherited |
Definition at line 149 of file vpMoment.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 97 of file vpMoment.cpp.
|
inlinevirtual |
|
virtual |
Prints moments required for calculation of vpMomentCentered, which are
Reimplemented from vpMoment.
Definition at line 171 of file vpMomentCentered.cpp.
void vpMomentCentered::printWithIndices | ( | std::ostream & | os | ) | const |
Print in a readable form which looks better than output from << operator
Definition at line 153 of file vpMomentCentered.cpp.
|
protected |
To set the values of centred moments. Required when normalizing the moment values.
i | : first index of the 2D moment. |
j | : second index of the 2D moment. |
value | : value of the moment. |
Definition at line 51 of file vpMomentCentered.cpp.
|
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 114 of file vpMoment.cpp.
|
friend |
Outputs the centered moment's values to a stream presented as a matrix. The first line corresponds to
, the second one to
Values in table corresponding to a higher order are marked with an "x" and not computed.
For example, if the maximal order is 3, the following values are provided:
This output will be followed by an output with indexes as produced by printWithIndices() function
Definition at line 132 of file vpMomentCentered.cpp.
|
protectedinherited |
Definition at line 117 of file vpMoment.h.