ViSP
2.8.0
|
#include <vpMomentCentered.h>
Public Member Functions | |
vpMomentCentered () | |
void | compute () |
double | get (unsigned int i, unsigned int j) |
std::vector< double > & | get () |
const char * | name () |
vpMomentObject & | getObject () const |
void | linkTo (vpMomentDatabase &moments) |
void | update (vpMomentObject &object) |
Protected Member Functions | |
vpMomentDatabase & | getMoments () |
Protected Attributes | |
std::vector< double > | values |
Friends | |
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, 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 79 of file vpMomentCentered.h.
vpMomentCentered::vpMomentCentered | ( | ) |
Default constructor.
Definition at line 80 of file vpMomentCentered.cpp.
|
virtual |
Computes centered moments of all available orders. Depends on vpMomentGravityCenter.
Implements vpMoment.
Definition at line 52 of file vpMomentCentered.cpp.
References vpMath::comb(), vpMomentGravityCenter::get(), vpMomentDatabase::get(), vpMomentObject::get(), vpMoment::getMoments(), vpMoment::getObject(), vpMomentObject::getOrder(), vpException::notInitialized, and vpMoment::values.
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::updateAll().
double vpMomentCentered::get | ( | unsigned int | i, |
unsigned int | j | ||
) |
Gets the desired moment using indexes.
i | : first index of the centered moment. |
j | : second index of the centered moment. |
Definition at line 90 of file vpMomentCentered.cpp.
References vpException::badValue, vpMoment::getObject(), vpMomentObject::getOrder(), and vpMoment::values.
Referenced by vpMomentArea::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentCommon::getMu3(), and vpMomentCommon::getSurface().
|
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 123 of file vpMomentCentered.h.
References vpMoment::get().
|
inlineprotectedinherited |
Returns the linked moment database.
Definition at line 115 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), and vpMomentAlpha::compute().
|
inlineinherited |
Definition at line 119 of file vpMoment.h.
Referenced by vpMomentArea::compute(), compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpFeatureMomentArea::compute_interaction(), vpFeatureMomentBasic::compute_interaction(), vpFeatureMomentCentered::compute_interaction(), vpFeatureMomentAlpha::compute_interaction(), vpFeatureMomentAreaNormalized::compute_interaction(), vpFeatureMomentCInvariant::compute_interaction(), vpFeatureMomentGravityCenter::compute_interaction(), vpFeatureMomentGravityCenterNormalized::compute_interaction(), vpMomentBasic::get(), get(), vpFeatureMomentBasic::interaction(), and vpFeatureMomentCentered::interaction().
|
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.
moments | : database of moment primitives. |
Definition at line 104 of file vpMoment.cpp.
References vpMoment::name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().
|
inlinevirtual |
|
inherited |
Updates the moment with the current object. This does not compute any values.
object | : object descriptor of the current camera vision. |
Definition at line 117 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:
Definition at line 112 of file vpMomentCentered.cpp.
|
protectedinherited |
Definition at line 110 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), vpMomentAlpha::compute(), get(), vpMomentGravityCenter::get(), vpMomentAlpha::vpMomentAlpha(), vpMomentArea::vpMomentArea(), vpMomentAreaNormalized::vpMomentAreaNormalized(), vpMomentCInvariant::vpMomentCInvariant(), and vpMomentGravityCenter::vpMomentGravityCenter().