ViSP  2.6.2
vpMomentArea Class Reference

#include <vpMomentArea.h>

+ Inheritance diagram for vpMomentArea:

Public Member Functions

 vpMomentArea ()
void compute ()
const char * name ()
vpMomentObjectgetObject ()
std::vector< double > & get ()
void linkTo (vpMomentDatabase &moments)
void update (vpMomentObject &object)

Protected Member Functions

vpMomentDatabasegetMoments ()

Protected Attributes

std::vector< double > values


VISP_EXPORT std::ostream & operator<< (std::ostream &os, const vpMomentArea &m)

Detailed Description

Definition at line 49 of file vpMomentArea.h.

Constructor & Destructor Documentation

vpMomentArea::vpMomentArea ( )

Default constructor.

Definition at line 70 of file vpMomentArea.cpp.

References vpMoment::values.

Member Function Documentation

void vpMomentArea::compute ( )
vpMomentDatabase& vpMoment::getMoments ( )

Returns the linked moment database.

the moment database

Definition at line 115 of file vpMoment.h.

Referenced by compute(), vpMomentGravityCenterNormalized::compute(), vpMomentCentered::compute(), vpMomentAreaNormalized::compute(), vpMomentCInvariant::compute(), and vpMomentAlpha::compute().

void vpMoment::linkTo ( vpMomentDatabase moments)

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.

Two moments of the same class cannot be stored in the same database
#include <visp/vpMomentObject.h>
#include <visp/vpPoint.h>
#include <visp/vpMomentGravityCenter.h>
#include <visp/vpMomentDatabase.h>
#include <visp/vpMomentCentered.h>
int main()
std::vector<vpPoint> vec_p;
p.set_x(1); p.set_y(1); // coordinates in meters in the image plane (vertex 1)
p.set_x(2); p.set_y(2); // coordinates in meters in the image plane (vertex 2)
obj.setType(vpMomentObject::DISCRETE); // Discrete mode.
obj.fromVector(vec_p); // Init the dense object with the polygon
vpMomentGravityCenter G; // declaration of gravity center
vpMomentCentered mc; // mc containts centered moments
G.linkTo(db); //add gravity center to database
mc.linkTo(db); //centered moments depend on gravity, add them to the
//database to grant access
G.update(obj); // specify the object for gravity center
mc.update(obj); // and for centered moments
G.compute(); // compute the moment
mc.compute(); //compute centered moments AFTER gravity center
return 0;
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().

const char* vpMomentArea::name ( )

Moment name.

Implements vpMoment.

Definition at line 56 of file vpMomentArea.h.

void vpMoment::update ( vpMomentObject object)

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.

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  os,
const vpMomentArea m 

Outputs the moment's values to a stream.

Definition at line 77 of file vpMomentArea.cpp.

Member Data Documentation