ViSP
2.10.0
|
#include <vpMomentAlpha.h>
Public Member Functions | |
vpMomentAlpha () | |
vpMomentAlpha (std::vector< double > &ref, double alphaRef) | |
void | compute () |
double | get () const |
const char * | name () const |
bool | is_ref () const |
bool | is_symmetric () const |
void | printDependencies (std::ostream &os) const |
const vpMomentObject & | getObject () const |
void | linkTo (vpMomentDatabase &moments) |
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 vpMomentAlpha &v) |
This class defines the orientation of the object inside the plane parallel to the object.
The value of the moment is computed in radians in a interval at most by the formula .
To obtain the precision, you have to specify reference information. This reference information describes an object with 0 rad orientation or at least an orientation between and rad. The nature of this information are third-order centered moments and a reference value of alpha. Reference centered moments are obtained with vpMomentCentered and reference alpha is obtained with vpMomentAlpha using the reference constructor.
Therefore there are two modes for vpMomentAlpha and one constructor per mode:
The following code demonstrates a calculation of a reference alpha and then uses this alpha to estimate the orientation of the same object after performing a 180 degrees rotation. Therefore the first and second alpha should have opposite values.
This program outputs:
Shortcuts for quickly getting those references exist in vpMomentCommon.
This moment depends on vpMomentCentered.
Definition at line 198 of file vpMomentAlpha.h.
vpMomentAlpha::vpMomentAlpha | ( | ) |
Empty constructor. Initializes alpha moment as a reference alpha. A default-constructed alpha moment may be used as a reference for other alphas. A reference alpha is class harbouring an alpha value computed for a portion of the circle. Not setting a reference alpha will prevent you from doing more than 180deg rotation with moments.
Definition at line 52 of file vpMomentAlpha.cpp.
References vpMoment::values.
vpMomentAlpha::vpMomentAlpha | ( | std::vector< double > & | ref_, |
double | alpha_ref | ||
) |
Common constructor. Initializes alpha moment as a non-reference alpha. A default-constructed alpha moment must be used as a reference for other this alpha. A reference alpha is class harbouring an alpha value computed for a portion of the circle. Not having a reference alpha will prevent you from doing more than 180deg rotation with moments.
ref_ | : vector of 3rd order centered moments corresponding to the reference alpha in the following order: . |
alpha_ref | : value of the reference alpha. |
Definition at line 63 of file vpMomentAlpha.cpp.
References vpMoment::values.
|
virtual |
Compute the value of the alpha-moment. Depends on vpMomentCentered.
Implements vpMoment.
Definition at line 77 of file vpMomentAlpha.cpp.
References vpMath::comb(), vpMomentCentered::get(), vpMomentDatabase::get(), vpMoment::getMoments(), vpException::notInitialized, and vpMoment::values.
Referenced by vpMomentCommon::getAlpha(), and vpMomentCommon::updateAll().
|
inline |
Retrieve the orientation of the object as a single double value.
Definition at line 213 of file vpMomentAlpha.h.
Referenced by vpMomentCommon::getAlpha().
|
inlineprotectedinherited |
Returns the linked moment database.
Definition at line 119 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), compute(), vpMomentArea::printDependencies(), vpMomentGravityCenterNormalized::printDependencies(), vpMomentCentered::printDependencies(), vpMomentAreaNormalized::printDependencies(), and printDependencies().
|
inlineinherited |
Definition at line 121 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentCentered::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(), vpMomentCentered::get(), vpFeatureMomentBasic::interaction(), vpFeatureMomentCentered::interaction(), vpMomentArea::printDependencies(), vpMomentBasic::printDependencies(), vpMomentCentered::printDependencies(), vpMomentGravityCenter::printDependencies(), vpMomentAreaNormalized::printDependencies(), vpMomentCentered::printWithIndices(), and vpMomentCentered::set().
|
inline |
Definition at line 219 of file vpMomentAlpha.h.
|
inline |
Definition at line 227 of file vpMomentAlpha.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 103 of file vpMoment.cpp.
References vpException::memoryAllocationError, and vpMoment::name().
Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().
|
inlinevirtual |
|
virtual |
Prints the dependencies of alpha, namely centered moments mu11, mu20 ad mu02
Reimplemented from vpMoment.
Definition at line 161 of file vpMomentAlpha.cpp.
References vpMomentCentered::get(), vpMomentDatabase::get(), vpMoment::getMoments(), and vpException::notInitialized.
|
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 120 of file vpMoment.cpp.
|
friend |
Prints the value of the major-axis orientation in degrees and rad
Definition at line 152 of file vpMomentAlpha.cpp.
|
protectedinherited |
Definition at line 114 of file vpMoment.h.
Referenced by vpMomentArea::compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentGravityCenter::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), compute(), vpMomentCentered::get(), vpMomentGravityCenter::get(), vpMomentCInvariant::getMomentVector(), vpMomentCentered::set(), vpMomentAlpha(), vpMomentArea::vpMomentArea(), vpMomentAreaNormalized::vpMomentAreaNormalized(), vpMomentCInvariant::vpMomentCInvariant(), and vpMomentGravityCenter::vpMomentGravityCenter().