Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpMomentArea Class Reference

#include <visp3/core/vpMomentArea.h>

+ Inheritance diagram for vpMomentArea:

Public Member Functions

 vpMomentArea ()
virtual ~vpMomentArea ()
Inherited functionalities from vpMomentArea
void compute ()
const char * name () const
void printDependencies (std::ostream &os) const
Inherited functionalities from vpMoment
const vpMomentObjectgetObject () const
const std::vector< double > & get () const
void linkTo (vpMomentDatabase &moments)
void update (vpMomentObject &object)

Protected Member Functions

vpMomentDatabasegetMoments () const

Protected Attributes

std::vector< double > values


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

Detailed Description

Class handling the surface moment.

Definition at line 53 of file vpMomentArea.h.

Constructor & Destructor Documentation

vpMomentArea::vpMomentArea ( )

Default constructor.

Definition at line 66 of file vpMomentArea.cpp.

References vpMoment::values.

virtual vpMomentArea::~vpMomentArea ( )

Definition at line 56 of file vpMomentArea.h.

Member Function Documentation

void vpMomentArea::compute ( )
void vpMoment::linkTo ( vpMomentDatabase data_base)

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 <visp3/core/vpMomentObject.h>
#include <visp3/core/vpPoint.h>
#include <visp3/core/vpMomentGravityCenter.h>
#include <visp3/core/vpMomentDatabase.h>
#include <visp3/core/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;
data_base: database of moment primitives.

Definition at line 99 of file vpMoment.cpp.

References vpException::memoryAllocationError, and vpMoment::name().

Referenced by vpMomentCommon::getAlpha(), vpMomentCommon::getMu3(), vpMomentCommon::getSurface(), and vpMomentCommon::vpMomentCommon().

const char* vpMomentArea::name ( ) const

Moment name.

Implements vpMoment.

Definition at line 62 of file vpMomentArea.h.

void vpMomentArea::printDependencies ( std::ostream &  os) const

If the vpMomentObject type is

  1. DISCRETE(set of discrete points), uses mu20+mu02
  2. DENSE_FULL_OBJECT(from image) used mu00

Reimplemented from vpMoment.

Definition at line 84 of file vpMomentArea.cpp.

References vpMomentObject::DISCRETE, vpMomentCentered::get(), vpMomentDatabase::get(), vpMoment::getMoments(), vpMoment::getObject(), and vpException::notInitialized.

void vpMoment::update ( vpMomentObject moment_object)

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 116 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 73 of file vpMomentArea.cpp.

Member Data Documentation