45#ifndef _vpFeatureMoment_h_
46#define _vpFeatureMoment_h_
49#include <visp3/core/vpConfig.h>
50#include <visp3/core/vpException.h>
51#include <visp3/visual_features/vpBasicFeature.h>
135 // Init object of order 3 because we need vpFeatureMomentBasic of order 2 which
136 // implies third-order moment primitives
137 vpMomentObject obj(3);
138 obj.setType(vpMomentObject::DISCRETE); // Discrete mode for object
139 obj.fromVector(vec_p);
141 vpMomentDatabase mdb; //database for moment primitives. This will
142 //only contain the basic moment.
143 vpMomentBasic bm; //basic moment (this particular moment is nothing
144 //more than a shortcut to the vpMomentObject)
145 bm.linkTo(mdb); //add basic moment to moment database
147 vpFeatureMomentBasic fmb(mdb,0,0,1,NULL);
149 //update and compute the vpMoment BEFORE doing any operations with vpFeatureMoment
153 fmb.update(0,0,1); //update the vpFeatureMoment with a plane
155 std::cout << fmb.interaction(1,1) << std::endl;
215 virtual void compute_interaction(
void);
218 unsigned int thickness = 1)
const;
220 unsigned int thickness = 1)
const;
222 int getDimension(
unsigned int select = FEATURE_ALL)
const;
235 virtual const char *
name()
const = 0;
239 void update(
double A,
double B,
double C);
279 virtual const char *
name()
const {
return NULL; }
class that defines what is a visual feature
virtual vpMatrix interaction(unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
virtual void print(unsigned int select=FEATURE_ALL) const =0
Print the name of the feature.
unsigned int getDimension(unsigned int select=FEATURE_ALL) const
Get the feature vector dimension.
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
virtual vpBasicFeature * duplicate() const =0
Generic class defining intrinsic camera parameters.
Class to define RGB colors available for display functionalities.
static const vpColor green
This class allows to register all feature moments (implemented in vpFeatureMoment....
This class defines shared system methods/attributes for 2D moment features but no functional code....
virtual void printDependencies(std::ostream &os) const
std::vector< vpMatrix > interaction_matrices
virtual const char * momentName() const =0
vpFeatureMomentDatabase * featureMomentsDataBase
virtual const char * name() const =0
vpFeatureMoment(vpMomentDatabase &data_base, double A_=0.0, double B_=0.0, double C_=0.0, vpFeatureMomentDatabase *featureMoments=NULL, unsigned int nbmatrices=1)
vpMomentDatabase & moments
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpFeatureMoment &featM)
const vpMoment & getMoment() const
void update(double A, double B, double C)
Definition of the vpImage class member functions.
Implementation of a matrix and operations on matrices.
This class allows to register all vpMoments so they can access each other according to their dependen...
vpMomentGenericFeature(vpMomentDatabase &data_base, double A_, double B_, double C_, vpFeatureMomentDatabase *featureMoments, const vpMoment *p_moment)
const char * momentName() const
virtual const char * name() const
Class for generic objects.
This class defines shared methods/attributes for 2D moments.