38 #include <visp3/core/vpDebug.h>
39 #include <visp3/core/vpTrackingException.h>
40 #include <visp3/core/vpVelocityTwistMatrix.h>
41 #include <visp3/mbt/vpMbEdgeKltTracker.h>
42 #include <visp3/mbt/vpMbtXmlGenericParser.h>
44 #if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
47 : m_thresholdKLT(2.), m_thresholdMBT(2.), m_maxIterKlt(30), m_w_mbt(), m_w_klt(), m_error_hybrid(), m_w_hybrid()
79 unsigned int i = (
unsigned int)
scales.size();
115 unsigned int i = (
unsigned int)
scales.size();
152 unsigned int i = (
unsigned int)
scales.size();
181 unsigned int nbrow = 0;
182 for (std::list<vpMbtDistanceLine *>::iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
191 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
201 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
276 #if defined(VISP_HAVE_PUGIXML)
299 std::cout <<
" *********** Parsing XML for Mb Edge KLT Tracker ************ " << std::endl;
301 xmlp.
parse(configFile.c_str());
304 vpERROR_TRACE(
"Can't open XML file \"%s\"\n ", configFile.c_str());
369 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
376 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
384 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
425 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
432 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
440 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
489 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
490 if ((*it)->isTracked()) {
492 unsigned int indexLine = 0;
495 for (
size_t a = 0; a < l->
meline.size(); a++) {
496 std::list<vpMeSite>::iterator itListLine;
498 itListLine = l->
meline[a]->getMeList().begin();
500 for (
unsigned int i = 0; i < l->
nbFeature[a]; i++) {
501 wmean += w[n + indexLine];
503 if (w[n + indexLine] < 0.5) {
529 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
531 if ((*it)->isTracked()) {
534 std::list<vpMeSite>::iterator itListCyl1;
535 std::list<vpMeSite>::iterator itListCyl2;
537 itListCyl1 = cy->
meline1->getMeList().begin();
538 itListCyl2 = cy->
meline2->getMeList().begin();
542 for (
unsigned int i = 0; i < cy->
nbFeaturel1; i++) {
545 if (w[n + i] < 0.5) {
566 for (
unsigned int i = cy->
nbFeaturel1; i < cy->nbFeature; i++) {
569 if (w[n + i] < 0.5) {
595 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
596 if ((*it)->isTracked()) {
599 std::list<vpMeSite>::iterator itListCir;
602 itListCir = ci->
meEllipse->getMeList().begin();
606 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
609 if (w[n + i] < 0.5) {
645 unsigned int lvl,
double *edge_residual,
double *klt_residual)
650 if (nbrow < 4 && nbInfos < 4) {
656 unsigned int totalNbRows = nbrow + 2 * nbInfos;
658 double residu_1 = -1;
659 unsigned int iter = 0;
669 L_mbt.
resize(nbrow, 6,
false,
false);
670 R_mbt.
resize(nbrow,
false);
674 L_klt.
resize(2 * nbInfos, 6,
false,
false);
675 R_klt.
resize(2 * nbInfos,
false);
699 if (edge_residual !=
nullptr)
701 if (klt_residual !=
nullptr)
729 while (((
int)((residu - residu_1) * 1e8) != 0) && (iter <
m_maxIter)) {
734 unsigned int shift = 0;
776 unsigned int cpt = 0;
777 while (cpt < (nbrow + 2 * nbInfos)) {
778 if (cpt < (
unsigned)nbrow) {
787 bool reStartFromLastIncrement =
false;
790 if (reStartFromLastIncrement) {
794 if (!reStartFromLastIncrement) {
797 if (edge_residual !=
nullptr) {
799 for (
unsigned int i = 0; i < R_mbt.
getRows(); i++)
800 *edge_residual += fabs(R_mbt[i]);
801 *edge_residual /= R_mbt.
getRows();
807 L.insert(L_mbt, 0, 0);
811 if (klt_residual !=
nullptr) {
813 for (
unsigned int i = 0; i < R_klt.
getRows(); i++)
814 *klt_residual += fabs(R_klt[i]);
815 *klt_residual /= R_klt.
getRows();
821 L.insert(L_klt, nbrow, 0);
825 while (cpt < (nbrow + 2 * nbInfos)) {
826 if (cpt < (
unsigned)nbrow) {
837 if (!isoJoIdentity) {
840 LVJ_true = (L * cVo *
oJo);
849 for (
unsigned int i = 0; i < weighted_error.
getRows(); i++) {
855 for (
unsigned int j = 0; j < 6; j += 1) {
861 residu = sqrt(num / den);
863 computeVVSPoseEstimation(isoJoIdentity, iter, L, LTL, weighted_error,
m_error_hybrid, m_error_prev, LTR, mu, v,
886 "computeVVSInteractionMatrixAndR"
887 "esidu() should not be called!");
918 unsigned int nbrow = 0;
976 unsigned int nbrow = 0;
1023 factor.
resize(nbrow,
false);
1027 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
1028 if ((*it)->isTracked()) {
1035 int index = *itindex;
1046 for (
size_t a = 0; a < l->
meline.size(); a++) {
1047 std::list<vpMeSite>::const_iterator itListLine;
1048 if (l->
meline[a] !=
nullptr) {
1049 itListLine = l->
meline[a]->getMeList().begin();
1051 for (
unsigned int i = 0; i < l->
nbFeature[a]; i++) {
1052 factor[n + i] = fac;
1055 factor[n + i] = 0.2;
1064 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
1066 if ((*it)->isTracked()) {
1071 std::list<vpMeSite>::const_iterator itCyl1;
1072 std::list<vpMeSite>::const_iterator itCyl2;
1074 itCyl1 = cy->
meline1->getMeList().begin();
1075 itCyl2 = cy->
meline2->getMeList().begin();
1078 for (
unsigned int i = 0; i < cy->
nbFeature; i++) {
1079 factor[n + i] = fac;
1081 if (i < cy->nbFeaturel1) {
1090 factor[n + i] = 0.2;
1097 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
1098 if ((*it)->isTracked()) {
1103 std::list<vpMeSite>::const_iterator itCir;
1105 itCir = ci->
meEllipse->getMeList().begin();
1108 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
1109 factor[n + i] = fac;
1112 factor[n + i] = 0.2;
1131 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
1132 if ((*it)->isTracked()) {
1136 for (
unsigned int j = 0; j < 6; j++) {
1137 L[n + i][j] = l->
L[i][j];
1138 error[n + i] = l->
error[i];
1145 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
1147 if ((*it)->isTracked()) {
1150 for (
unsigned int i = 0; i < cy->
nbFeature; i++) {
1151 for (
unsigned int j = 0; j < 6; j++) {
1152 L[n + i][j] = cy->
L[i][j];
1153 error[n + i] = cy->
error[i];
1159 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
1160 if ((*it)->isTracked()) {
1163 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
1164 for (
unsigned int j = 0; j < 6; j++) {
1165 L[n + i][j] = ci->
L[i][j];
1166 error[n + i] = ci->
error[i];
1222 const std::string &name)
1238 const std::string &name)
1257 bool displayFullModel)
1259 std::vector<std::vector<double> > models =
1262 for (
size_t i = 0; i < models.size(); i++) {
1270 double n20 = models[i][3];
1271 double n11 = models[i][4];
1272 double n02 = models[i][5];
1285 std::stringstream ss;
1292 #ifdef VISP_HAVE_OGRE
1311 bool displayFullModel)
1313 std::vector<std::vector<double> > models =
1316 for (
size_t i = 0; i < models.size(); i++) {
1324 double n20 = models[i][3];
1325 double n11 = models[i][4];
1326 double n02 = models[i][5];
1339 std::stringstream ss;
1346 #ifdef VISP_HAVE_OGRE
1355 bool displayFullModel)
1357 std::vector<std::vector<double> > models;
1359 for (
unsigned int i = 0; i <
scales.size(); i += 1) {
1363 std::vector<std::vector<double> > currentModel =
1364 (*it)->getModelForDisplay(width, height, cMo, cam, displayFullModel);
1365 models.insert(models.end(), currentModel.begin(), currentModel.end());
1368 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[
scaleLevel].begin();
1370 std::vector<std::vector<double> > currentModel =
1371 (*it)->getModelForDisplay(width, height, cMo, cam, displayFullModel);
1372 models.insert(models.end(), currentModel.begin(), currentModel.end());
1375 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[
scaleLevel].begin();
1377 std::vector<double> paramsCircle = (*it)->getModelForDisplay(cMo, cam, displayFullModel);
1378 models.push_back(paramsCircle);
1385 #ifdef VISP_HAVE_OGRE
1411 for (std::list<vpMbtDistanceKltPoints *>::const_iterator it =
kltPolygons.begin(); it !=
kltPolygons.end(); ++it) {
1413 if (kltpoly !=
nullptr) {
1423 if (kltPolyCylinder !=
nullptr) {
1424 delete kltPolyCylinder;
1426 kltPolyCylinder =
nullptr;
1434 if (ci !=
nullptr) {
1448 for (
unsigned int i = 0; i <
scales.size(); i += 1) {
1450 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[i].begin(); it !=
lines[i].end(); ++it) {
1457 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[i].begin(); it !=
cylinders[i].end();
1465 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[i].begin(); it !=
circles[i].end(); ++it) {
1494 #elif !defined(VISP_BUILD_SHARED_LIBS)
1497 void dummy_vpMbEdgeKltTracker() { };
void setWindowName(const Ogre::String &n)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int getRows() const
Generic class defining intrinsic camera parameters.
void computeFov(const unsigned int &w, const unsigned int &h)
Implementation of column vector and the associated operations.
void insert(unsigned int i, const vpColVector &v)
void resize(unsigned int i, bool flagNullify=true)
Class to define RGB colors available for display functionalities.
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void displayEllipse(const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &coef1, const double &coef2, const double &coef3, bool use_normalized_centered_moments, const vpColor &color, unsigned int thickness=1, bool display_center=false, bool display_arc=false)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
static vpHomogeneousMatrix direct(const vpColVector &v)
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
Implementation of an homography and operations on homographies.
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int getWidth() const
unsigned int getHeight() const
void setBlockSize(int blockSize)
void setQuality(double qualityLevel)
void setHarrisFreeParameter(double harris_k)
void setMaxFeatures(int maxCount)
void setMinDistance(double minDistance)
void setWindowSize(int winSize)
void setPyramidLevels(int pyrMaxLevel)
static double rad(double deg)
static double sqr(double x)
static bool equal(double x, double y, double threshold=0.001)
static double deg(double rad)
Implementation of a matrix and operations on matrices.
double m_thresholdKLT
The threshold used in the robust estimation of KLT.
virtual void loadConfigFile(const std::string &configFile, bool verbose=true) vp_override
virtual void track(const vpImage< unsigned char > &I) vp_override
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false) vp_override
virtual void initCylinder(const vpPoint &, const vpPoint &, double r, int idFace, const std::string &name="") vp_override
void reInitModel(const vpImage< unsigned char > &I, const std::string &cad_name, const vpHomogeneousMatrix &cMo, bool verbose=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix()) vp_override
vpColVector m_w_mbt
Robust weights for Edge.
void resetTracker() vp_override
bool postTracking(const vpImage< unsigned char > &I, vpColVector &w_mbt, vpColVector &w_klt, unsigned int lvl=0)
unsigned int trackFirstLoop(const vpImage< unsigned char > &I, vpColVector &factor, unsigned int lvl=0)
void postTrackingMbt(vpColVector &w, unsigned int level=0)
virtual void initCircle(const vpPoint &, const vpPoint &, const vpPoint &, double r, int idFace=0, const std::string &name="") vp_override
void trackSecondLoop(const vpImage< unsigned char > &I, vpMatrix &L, vpColVector &_error, const vpHomogeneousMatrix &cMo, unsigned int lvl=0)
virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity, const vpColVector &w_true, const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true, const vpMatrix &LVJ_true, const vpColVector &error)
virtual void init(const vpImage< unsigned char > &I) vp_override
virtual void computeVVSPoseEstimation(const bool isoJoIdentity, unsigned int iter, vpMatrix &L, vpMatrix <L, vpColVector &R, const vpColVector &error, vpColVector &error_prev, vpColVector <R, double &mu, vpColVector &v, const vpColVector *const w=nullptr, vpColVector *const m_w_prev=nullptr)
unsigned int initMbtTracking(unsigned int level=0)
virtual void computeVVSInit() vp_override
virtual ~vpMbEdgeKltTracker()
virtual void setNearClippingDistance(const double &dist) vp_override
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false) vp_override
vpColVector m_error_hybrid
(s - s*)
virtual void setFarClippingDistance(const double &dist) vp_override
virtual void initFaceFromLines(vpMbtPolygon &polygon) vp_override
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo) vp_override
virtual void computeVVSInteractionMatrixAndResidu() vp_override
virtual void initFaceFromCorners(vpMbtPolygon &polygon) vp_override
vpColVector m_w_klt
Robust weights for KLT.
double m_thresholdMBT
The threshold used in the robust estimation of MBT.
unsigned int m_maxIterKlt
The maximum iteration of the virtual visual servoing stage.
virtual void setClipping(const unsigned int &flags) vp_override
virtual void setCameraParameters(const vpCameraParameters &cam) vp_override
vpColVector m_w_hybrid
Robust weights.
void upScale(const unsigned int _scale)
std::vector< std::list< vpMbtDistanceLine * > > lines
vpMe me
The moving edges parameters.
void computeProjectionError(const vpImage< unsigned char > &_I)
void downScale(const unsigned int _scale)
void cleanPyramid(std::vector< const vpImage< unsigned char > * > &_pyramid)
std::vector< std::list< vpMbtDistanceCylinder * > > cylinders
Vector of the tracked cylinders.
void initPyramid(const vpImage< unsigned char > &_I, std::vector< const vpImage< unsigned char > * > &_pyramid)
virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace=0, const std::string &name="") vp_override
unsigned int nbvisiblepolygone
Number of polygon (face) currently visible.
void resetTracker() vp_override
std::vector< std::list< vpMbtDistanceCircle * > > circles
Vector of the tracked circles.
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
virtual void initFaceFromLines(vpMbtPolygon &polygon) vp_override
void trackMovingEdge(const vpImage< unsigned char > &I)
std::vector< const vpImage< unsigned char > * > Ipyramid
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace=0, const std::string &name="") vp_override
virtual void setCameraParameters(const vpCameraParameters &cam) vp_override
std::vector< bool > scales
Vector of scale level to use for the multi-scale tracking.
void updateMovingEdge(const vpImage< unsigned char > &I)
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
virtual void initFaceFromCorners(vpMbtPolygon &polygon) vp_override
void setMovingEdge(const vpMe &me)
vpAROgre * getOgreContext()
void computeClippedPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam)
bool isAppearing(unsigned int i)
vpMbScanLine & getMbScanLineRenderer()
void computeScanLineRender(const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h)
void displayOgre(const vpHomogeneousMatrix &cMo)
std::list< vpMbtDistanceKltCylinder * > kltCylinders
vpHomogeneousMatrix c0Mo
Initial pose.
vpHomogeneousMatrix ctTc0
std::list< vpMbtDistanceKltPoints * > kltPolygons
virtual void init(const vpImage< unsigned char > &I) vp_override
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo) vp_override
std::list< vpMbtDistanceCircle * > circles_disp
Vector of the circles used here only to display the full model.
vpKltOpencv tracker
Points tracker.
virtual std::vector< std::vector< double > > getFeaturesForDisplayKlt()
void preTracking(const vpImage< unsigned char > &I)
bool postTracking(const vpImage< unsigned char > &I, vpColVector &w)
virtual void initFaceFromLines(vpMbtPolygon &polygon) vp_override
virtual void reinit(const vpImage< unsigned char > &I)
unsigned int maskBorder
Erosion of the mask.
void setCameraParameters(const vpCameraParameters &cam) vp_override
std::vector< std::vector< double > > m_featuresToBeDisplayedKlt
Display features.
virtual void initCylinder(const vpPoint &, const vpPoint &, double, int, const std::string &name="") vp_override
virtual void initFaceFromCorners(vpMbtPolygon &polygon) vp_override
void resetTracker() vp_override
double m_lambda
Gain of the virtual visual servoing stage.
double minLineLengthThresholdGeneral
Minimum line length threshold for LOD mode (general setting)
virtual void setMinLineLengthThresh(double minLineLengthThresh, const std::string &name="")
vpImage< unsigned char > m_I
Grayscale image buffer, used when passing color images.
bool useLodGeneral
True if LOD mode is enabled.
double minPolygonAreaThresholdGeneral
Minimum polygon area threshold for LOD mode (general setting)
bool m_computeInteraction
vpMatrix oJo
The Degrees of Freedom to estimate.
virtual void setMinPolygonAreaThresh(double minPolygonAreaThresh, const std::string &name="")
double m_initialMu
Initial Mu for Levenberg Marquardt optimization loop.
vpHomogeneousMatrix m_cMo
The current pose.
virtual void computeVVSCheckLevenbergMarquardt(unsigned int iter, vpColVector &error, const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev, double &mu, bool &reStartFromLastIncrement, vpColVector *const w=nullptr, const vpColVector *const m_w_prev=nullptr)
vpCameraParameters m_cam
The camera parameters.
bool useOgre
Use Ogre3d for visibility tests.
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
virtual void setLod(bool useLod, const std::string &name="")
bool displayFeatures
If true, the features are displayed.
double angleDisappears
Angle used to detect a face disappearance.
virtual unsigned int getNbPolygon() const
bool applyLodSettingInConfig
bool m_isoJoIdentity
Boolean to know if oJo is identity (for fast computation)
bool useScanLine
Use Scanline for visibility tests.
double angleAppears
Angle used to detect a face appearance.
virtual void loadModel(const std::string &modelFile, bool verbose=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix())
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
unsigned int clippingFlag
Flags specifying which clipping to used.
virtual void loadConfigFile(const std::string &configFile, bool verbose=true)
Manage a circle used in the model-based tracker.
vpColVector error
The error vector.
unsigned int nbFeature
The number of moving edges.
vpMatrix L
The interaction matrix.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
void setMeanWeight(double _wmean)
void displayMovingEdges(const vpImage< unsigned char > &I)
bool Reinit
Indicates if the circle has to be reinitialized.
void initInteractionMatrixError()
vpMbtMeEllipse * meEllipse
The moving edge containers.
Manage a cylinder used in the model-based tracker.
void setMeanWeight1(double wmean)
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo, const vpImage< unsigned char > &I)
vpMbtMeLine * meline2
The moving edge containers (second line of the cylinder)
vpMatrix L
The interaction matrix.
unsigned int nbFeaturel2
The number of moving edges on line 2.
bool Reinit
Indicates if the line has to be reinitialized.
void initInteractionMatrixError()
void setMeanWeight2(double wmean)
unsigned int nbFeaturel1
The number of moving edges on line 1.
vpColVector error
The error vector.
void displayMovingEdges(const vpImage< unsigned char > &I)
unsigned int nbFeature
The number of moving edges.
vpMbtMeLine * meline1
The moving edge containers (first line of the cylinder)
Implementation of a polygon of the model containing points of interest. It is used by the model-based...
void computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &cMc0, vpColVector &_R, vpMatrix &_J)
unsigned int getCurrentNumberPoints() const
bool hasEnoughPoints() const
Implementation of a polygon of the model containing points of interest. It is used by the model-based...
bool hasEnoughPoints() const
void computeInteractionMatrixAndResidu(vpColVector &_R, vpMatrix &_J)
unsigned int getCurrentNumberPoints() const
vpMbtPolygon * polygon
Pointer to the polygon that define a face.
void computeHomography(const vpHomogeneousMatrix &_cTc0, vpHomography &cHc0)
Manage the line of a polygon used in the model-based tracker.
std::vector< unsigned int > nbFeature
The number of moving edges.
void displayMovingEdges(const vpImage< unsigned char > &I)
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
void initInteractionMatrixError()
std::list< int > Lindex_polygon
Index of the faces which contain the line.
unsigned int nbFeatureTotal
The number of moving edges.
bool Reinit
Indicates if the line has to be reinitialized.
vpColVector error
The error vector.
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
bool closeToImageBorder(const vpImage< unsigned char > &I, const unsigned int threshold)
std::vector< vpMbtMeLine * > meline
The moving edge container.
vpMatrix L
The interaction matrix.
void setMeanWeight(double w_mean)
Implementation of a polygon of the model used by the model-based tracker.
virtual bool isVisible(const vpHomogeneousMatrix &cMo, double alpha, const bool &modulo=false, const vpCameraParameters &cam=vpCameraParameters(), unsigned int width=0, unsigned int height=0)
Parse an Xml file to extract configuration parameters of a mbtConfig object.
unsigned int getKltMaxFeatures() const
void setKltMinDistance(const double &mD)
unsigned int getKltBlockSize() const
void getCameraParameters(vpCameraParameters &cam) const
double getAngleAppear() const
void setEdgeMe(const vpMe &ecm)
void setKltMaskBorder(const unsigned int &mb)
void getEdgeMe(vpMe &ecm) const
double getLodMinLineLengthThreshold() const
unsigned int getKltMaskBorder() const
void setAngleDisappear(const double &adisappear)
double getKltQuality() const
double getAngleDisappear() const
void setKltPyramidLevels(const unsigned int &pL)
void setKltWindowSize(const unsigned int &w)
double getKltMinDistance() const
void setKltMaxFeatures(const unsigned int &mF)
void setAngleAppear(const double &aappear)
void setKltBlockSize(const unsigned int &bs)
void setKltHarrisParam(const double &hp)
void parse(const std::string &filename)
double getNearClippingDistance() const
void setKltQuality(const double &q)
bool hasNearClippingDistance() const
bool hasFarClippingDistance() const
unsigned int getKltPyramidLevels() const
double getKltHarrisParam() const
unsigned int getKltWindowSize() const
void setCameraParameters(const vpCameraParameters &cam)
double getFarClippingDistance() const
bool getFovClipping() const
double getLodMinPolygonAreaThreshold() const
void setVerbose(bool verbose)
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'....
@ M_ESTIMATOR
Point detected as an outlier during virtual visual-servoing.
@ NO_SUPPRESSION
Point successfully tracked.
vpMeSiteState getState() const
void setState(const vpMeSiteState &flag)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Contains an M-estimator and various influence function.
@ TUKEY
Tukey influence function.
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
void setMinMedianAbsoluteDeviation(double mad_min)
Definition of the vpSubMatrix class that provides a mask on a vpMatrix. All properties of vpMatrix ar...
Error that can be emitted by the vpTracker class and its derivatives.
@ notEnoughPointError
Not enough point to track.
@ fatalError
Tracker fatal error.
vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)