42 #include <visp3/core/vpDebug.h> 43 #include <visp3/core/vpTrackingException.h> 44 #include <visp3/core/vpVelocityTwistMatrix.h> 45 #include <visp3/mbt/vpMbEdgeKltTracker.h> 46 #include <visp3/mbt/vpMbtXmlGenericParser.h> 48 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) 51 : m_thresholdKLT(2.), m_thresholdMBT(2.), m_maxIterKlt(30), m_w_mbt(), m_w_klt(), m_error_hybrid(), m_w_hybrid()
83 unsigned int i = (
unsigned int)
scales.size();
119 unsigned int i = (
unsigned int)
scales.size();
156 unsigned int i = (
unsigned int)
scales.size();
185 unsigned int nbrow = 0;
186 for (std::list<vpMbtDistanceLine *>::iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
195 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
205 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
301 std::cout <<
" *********** Parsing XML for Mb Edge KLT Tracker ************ " << std::endl;
303 xmlp.
parse(configFile.c_str());
305 vpERROR_TRACE(
"Can't open XML file \"%s\"\n ", configFile.c_str());
365 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
372 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
380 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
421 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
428 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
436 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
485 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
486 if ((*it)->isTracked()) {
488 unsigned int indexLine = 0;
491 for (
size_t a = 0; a < l->
meline.size(); a++) {
492 std::list<vpMeSite>::iterator itListLine;
494 itListLine = l->
meline[a]->getMeList().begin();
496 for (
unsigned int i = 0; i < l->
nbFeature[a]; i++) {
497 wmean += w[n + indexLine];
499 if (w[n + indexLine] < 0.5) {
525 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
527 if ((*it)->isTracked()) {
530 std::list<vpMeSite>::iterator itListCyl1;
531 std::list<vpMeSite>::iterator itListCyl2;
533 itListCyl1 = cy->
meline1->getMeList().begin();
534 itListCyl2 = cy->
meline2->getMeList().begin();
538 for (
unsigned int i = 0; i < cy->
nbFeaturel1; i++) {
541 if (w[n + i] < 0.5) {
562 for (
unsigned int i = cy->
nbFeaturel1; i < cy->nbFeature; i++) {
565 if (w[n + i] < 0.5) {
591 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
592 if ((*it)->isTracked()) {
595 std::list<vpMeSite>::iterator itListCir;
598 itListCir = ci->
meEllipse->getMeList().begin();
602 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
605 if (w[n + i] < 0.5) {
644 if (nbrow < 4 && nbInfos < 4) {
646 }
else if (nbrow < 4)
649 unsigned int totalNbRows = nbrow + 2 * nbInfos;
651 double residu_1 = -1;
652 unsigned int iter = 0;
662 L_mbt.
resize(nbrow, 6,
false,
false);
663 R_mbt.
resize(nbrow,
false);
667 L_klt.
resize(2 * nbInfos, 6,
false,
false);
668 R_klt.
resize(2 * nbInfos,
false);
692 double residuMBT = 0;
693 double residuKLT = 0;
716 while (((
int)((residu - residu_1) * 1e8) != 0) && (iter <
m_maxIter)) {
721 unsigned int shift = 0;
762 unsigned int cpt = 0;
763 while (cpt < (nbrow + 2 * nbInfos)) {
764 if (cpt < (
unsigned)nbrow) {
772 bool reStartFromLastIncrement =
false;
775 if (reStartFromLastIncrement) {
779 if (!reStartFromLastIncrement) {
783 for (
unsigned int i = 0; i < R_mbt.
getRows(); i++)
784 residuMBT += fabs(R_mbt[i]);
795 for (
unsigned int i = 0; i < R_klt.
getRows(); i++)
796 residuKLT += fabs(R_klt[i]);
802 L.
insert(L_klt, nbrow, 0);
806 while (cpt < (nbrow + 2 * nbInfos)) {
807 if (cpt < (
unsigned)nbrow) {
820 LVJ_true = (L * cVo *
oJo);
829 for (
unsigned int i = 0; i < weighted_error.
getRows(); i++) {
835 for (
unsigned int j = 0; j < 6; j += 1) {
836 L[i][j] *= m_w_hybrid[i];
841 residu = sqrt(num / den);
843 computeVVSPoseEstimation(
isoJoIdentity, iter, L, LTL, weighted_error,
m_error_hybrid, m_error_prev, LTR, mu, v,
866 "computeVVSInteractionMatrixAndR" 867 "esidu() should not be called!");
896 unsigned int nbrow = 0;
952 unsigned int nbrow = 0;
1000 factor.
resize(nbrow,
false);
1004 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
1005 if ((*it)->isTracked()) {
1012 int index = *itindex;
1023 unsigned int indexFeature = 0;
1024 for (
size_t a = 0; a < l->
meline.size(); a++) {
1025 std::list<vpMeSite>::const_iterator itListLine;
1026 if (l->
meline[a] != NULL) {
1027 itListLine = l->
meline[a]->getMeList().begin();
1029 for (
unsigned int i = 0; i < l->
nbFeature[a]; i++) {
1030 factor[n + i] = fac;
1033 factor[n + i] = 0.2;
1043 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
1045 if ((*it)->isTracked()) {
1050 std::list<vpMeSite>::const_iterator itCyl1;
1051 std::list<vpMeSite>::const_iterator itCyl2;
1053 itCyl1 = cy->
meline1->getMeList().begin();
1054 itCyl2 = cy->
meline2->getMeList().begin();
1057 for (
unsigned int i = 0; i < cy->
nbFeature; i++) {
1058 factor[n + i] = fac;
1060 if (i < cy->nbFeaturel1) {
1068 factor[n + i] = 0.2;
1075 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
1076 if ((*it)->isTracked()) {
1081 std::list<vpMeSite>::const_iterator itCir;
1083 itCir = ci->
meEllipse->getMeList().begin();
1086 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
1087 factor[n + i] = fac;
1090 factor[n + i] = 0.2;
1109 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[lvl].begin(); it !=
lines[lvl].end(); ++it) {
1110 if ((*it)->isTracked()) {
1114 for (
unsigned int j = 0; j < 6; j++) {
1115 L[n + i][j] = l->
L[i][j];
1116 error[n + i] = l->
error[i];
1123 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[lvl].begin(); it !=
cylinders[lvl].end();
1125 if ((*it)->isTracked()) {
1128 for (
unsigned int i = 0; i < cy->
nbFeature; i++) {
1129 for (
unsigned int j = 0; j < 6; j++) {
1130 L[n + i][j] = cy->
L[i][j];
1131 error[n + i] = cy->
error[i];
1137 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[lvl].begin(); it !=
circles[lvl].end(); ++it) {
1138 if ((*it)->isTracked()) {
1141 for (
unsigned int i = 0; i < ci->
nbFeature; i++) {
1142 for (
unsigned int j = 0; j < 6; j++) {
1143 L[n + i][j] = ci->
L[i][j];
1144 error[n + i] = ci->
error[i];
1200 int idFace,
const std::string &name)
1216 const std::string &name)
1235 bool displayFullModel)
1239 for (
size_t i = 0; i < models.size(); i++) {
1246 double n20 = models[i][3];
1247 double n11 = models[i][4];
1248 double n02 = models[i][5];
1261 std::stringstream ss;
1268 #ifdef VISP_HAVE_OGRE 1287 bool displayFullModel)
1291 for (
size_t i = 0; i < models.size(); i++) {
1298 double n20 = models[i][3];
1299 double n11 = models[i][4];
1300 double n02 = models[i][5];
1313 std::stringstream ss;
1320 #ifdef VISP_HAVE_OGRE 1329 bool displayFullModel)
1331 std::vector<std::vector<double> > models;
1333 for (
unsigned int i = 0; i <
scales.size(); i += 1) {
1337 std::vector<std::vector<double> > currentModel =
1338 (*it)->getModelForDisplay(width, height, cMo, cam, displayFullModel);
1339 models.insert(models.end(), currentModel.begin(), currentModel.end());
1342 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[
scaleLevel].begin();
1344 std::vector<std::vector<double> > currentModel =
1345 (*it)->getModelForDisplay(width, height, cMo, cam, displayFullModel);
1346 models.insert(models.end(), currentModel.begin(), currentModel.end());
1349 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[
scaleLevel].begin();
1351 std::vector<double> paramsCircle = (*it)->getModelForDisplay(cMo, cam, displayFullModel);
1352 models.push_back(paramsCircle);
1359 #ifdef VISP_HAVE_OGRE 1384 #if (VISP_HAVE_OPENCV_VERSION < 0x020408) 1386 cvReleaseImage(&
cur);
1392 for (std::list<vpMbtDistanceKltPoints *>::const_iterator it =
kltPolygons.begin(); it !=
kltPolygons.end(); ++it) {
1394 if (kltpoly != NULL) {
1404 if (kltPolyCylinder != NULL) {
1405 delete kltPolyCylinder;
1407 kltPolyCylinder = NULL;
1429 for (
unsigned int i = 0; i <
scales.size(); i += 1) {
1431 for (std::list<vpMbtDistanceLine *>::const_iterator it =
lines[i].begin(); it !=
lines[i].end(); ++it) {
1438 for (std::list<vpMbtDistanceCylinder *>::const_iterator it =
cylinders[i].begin(); it !=
cylinders[i].end();
1446 for (std::list<vpMbtDistanceCircle *>::const_iterator it =
circles[i].begin(); it !=
circles[i].end(); ++it) {
1475 #elif !defined(VISP_BUILD_SHARED_LIBS) 1478 void dummy_vpMbEdgeKltTracker(){};
1479 #endif // VISP_HAVE_OPENCV bool m_computeInteraction
void setWindowName(const Ogre::String &n)
Implementation of a matrix and operations on matrices.
double m_thresholdMBT
The threshold used in the robust estimation of MBT.
void displayMovingEdges(const vpImage< unsigned char > &I)
void setMovingEdge(const vpMe &me)
void setMaxFeatures(int maxCount)
double getFarClippingDistance() const
vpCameraParameters m_cam
The camera parameters.
void postTrackingMbt(vpColVector &w, unsigned int level=0)
Point removed during virtual visual-servoing because considered as an outlier.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int nbFeature
The number of moving edges.
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false)
unsigned int nbFeatureTotal
The number of moving edges.
virtual void computeVVSCheckLevenbergMarquardt(unsigned int iter, vpColVector &error, const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev, double &mu, bool &reStartFromLastIncrement, vpColVector *const w=NULL, const vpColVector *const m_w_prev=NULL)
void upScale(const unsigned int _scale)
virtual void initFaceFromCorners(vpMbtPolygon &polygon)
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
double getKltMinDistance() const
void setVerbose(bool verbose)
void setHarrisFreeParameter(double harris_k)
virtual void loadModel(const std::string &modelFile, bool verbose=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix())
unsigned int getWidth() const
void setKltQuality(const double &q)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void parse(const std::string &filename)
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
bool Reinit
Indicates if the line has to be reinitialized.
double getNearClippingDistance() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setKltPyramidLevels(const unsigned int &pL)
unsigned int initMbtTracking(unsigned int level=0)
std::vector< std::list< vpMbtDistanceCylinder * > > cylinders
Vector of the tracked cylinders.
vpColVector m_w_mbt
Robust weights for Edge.
std::list< int > Lindex_polygon
Index of the faces which contain the line.
vpMatrix L
The interaction matrix.
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
virtual void initFaceFromCorners(vpMbtPolygon &polygon)
bool hasNearClippingDistance() const
std::vector< std::vector< double > > m_featuresToBeDisplayedKlt
Display features.
unsigned int getKltBlockSize() const
Class to define RGB colors available for display functionnalities.
static bool equal(double x, double y, double s=0.001)
double getAngleAppear() const
std::list< vpMbtDistanceKltCylinder * > kltCylinders
unsigned int m_maxIterKlt
The maximum iteration of the virtual visual servoing stage.
bool postTracking(const vpImage< unsigned char > &I, vpColVector &w)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
bool hasEnoughPoints() const
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)
void displayMovingEdges(const vpImage< unsigned char > &I)
std::vector< const vpImage< unsigned char > * > Ipyramid
vpColVector error
The error vector.
void setMinDistance(double minDistance)
void getCameraParameters(vpCameraParameters &cam) const
error that can be emited by ViSP classes.
vpMbtMeEllipse * meEllipse
The moving edge containers.
Manage a cylinder used in the model-based tracker.
vpMbScanLine & getMbScanLineRenderer()
Manage the line of a polygon used in the model-based tracker.
unsigned int nbFeature
The number of moving edges.
virtual void setClipping(const unsigned int &flags)
vpColVector m_w_hybrid
Robust weights.
bool useOgre
Use Ogre3d for visibility tests.
double getLodMinLineLengthThreshold() const
void setKltMaskBorder(const unsigned int &mb)
void setEdgeMe(const vpMe &ecm)
Definition of the vpSubMatrix vpSubMatrix class provides a mask on a vpMatrix all properties of vpMat...
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
vpMe me
The moving edges parameters.
virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace=0, const std::string &name="")
void updateMovingEdge(const vpImage< unsigned char > &I)
void initInteractionMatrixError()
virtual void reinit(const vpImage< unsigned char > &I)
virtual void setLod(bool useLod, const std::string &name="")
virtual void setFarClippingDistance(const double &dist)
virtual ~vpMbEdgeKltTracker()
void downScale(const unsigned int _scale)
virtual void initCylinder(const vpPoint &, const vpPoint &, double r, int idFace, const std::string &name="")
Implementation of a polygon of the model containing points of interest. It is used by the model-based...
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
vpMatrix L
The interaction matrix.
vpMeSiteState getState() const
void reInitModel(const vpImage< unsigned char > &I, const std::string &cad_name, const vpHomogeneousMatrix &cMo, bool verbose=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix())
void computeClippedPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam)
void setQuality(double qualityLevel)
virtual void init(const vpImage< unsigned char > &I)
vpHomogeneousMatrix ctTc0
virtual void initCylinder(const vpPoint &, const vpPoint &, double, int, const std::string &name="")
virtual void loadConfigFile(const std::string &configFile, bool verbose=true)
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
unsigned int nbFeaturel1
The number of moving edges on line 1.
void trackSecondLoop(const vpImage< unsigned char > &I, vpMatrix &L, vpColVector &_error, const vpHomogeneousMatrix &cMo, unsigned int lvl=0)
Implementation of an homography and operations on homographies.
vpAROgre * getOgreContext()
void setKltHarrisParam(const double &hp)
bool hasFarClippingDistance() const
virtual void computeVVSInit()
Manage a circle used in the model-based tracker.
vpMatrix oJo
The Degrees of Freedom to estimate.
std::vector< bool > scales
Vector of scale level to use for the multi-scale tracking.
bool Reinit
Indicates if the circle has to be reinitialized.
Error that can be emited by the vpTracker class and its derivates.
Point used by the tracker.
void setMeanWeight(double w_mean)
Implementation of a polygon of the model used by the model-based tracker.
void setAngleDisappear(const double &adisappear)
bool isAppearing(unsigned int i)
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
void computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &cMc0, vpColVector &_R, vpMatrix &_J)
bool useScanLine
Use Scanline for visibility tests.
vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
void setKltMinDistance(const double &mD)
static double sqr(double x)
void setPyramidLevels(int pyrMaxLevel)
double minLineLengthThresholdGeneral
Minimum line length threshold for LOD mode (general setting)
void setMeanWeight1(double wmean)
vpColVector error
The error vector.
virtual void initFaceFromCorners(vpMbtPolygon &polygon)
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)
virtual void track(const vpImage< unsigned char > &I)
unsigned int maskBorder
Erosion of the mask.
Generic class defining intrinsic camera parameters.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
double getKltHarrisParam() const
double m_thresholdKLT
The threshold used in the robust estimation of KLT.
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)
Implementation of a polygon of the model containing points of interest. It is used by the model-based...
void setMeanWeight(double _wmean)
void initPyramid(const vpImage< unsigned char > &_I, std::vector< const vpImage< unsigned char > * > &_pyramid)
void cleanPyramid(std::vector< const vpImage< unsigned char > * > &_pyramid)
double m_initialMu
Initial Mu for Levenberg Marquardt optimization loop.
vpMbtMeLine * meline1
The moving edge containers (first line of the cylinder)
void setWindowSize(int winSize)
double m_lambda
Gain of the virtual visual servoing stage.
void setMeanWeight2(double wmean)
bool hasEnoughPoints() const
unsigned int getRows() const
double getAngleDisappear() const
double angleAppears
Angle used to detect a face appearance.
vpKltOpencv tracker
Points tracker.
void setState(const vpMeSiteState &flag)
void setKltWindowSize(const unsigned int &w)
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
void getEdgeMe(vpMe &ecm) const
void displayMovingEdges(const vpImage< unsigned char > &I)
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
virtual void setMinPolygonAreaThresh(double minPolygonAreaThresh, const std::string &name="")
virtual bool isVisible(const vpHomogeneousMatrix &cMo, double alpha, const bool &modulo=false, const vpCameraParameters &cam=vpCameraParameters(), unsigned int width=0, unsigned int height=0)
void setAngleAppear(const double &aappear)
static double rad(double deg)
std::vector< std::list< vpMbtDistanceCircle * > > circles
Vector of the tracked circles.
virtual void setCameraParameters(const vpCameraParameters &cam)
void computeProjectionError(const vpImage< unsigned char > &_I)
void insert(unsigned int i, const vpColVector &v)
cv::Mat cur
Temporary OpenCV image for fast conversion.
bool postTracking(const vpImage< unsigned char > &I, vpColVector &w_mbt, vpColVector &w_klt, unsigned int lvl=0)
virtual void initFaceFromLines(vpMbtPolygon &polygon)
void computeHomography(const vpHomogeneousMatrix &_cTc0, vpHomography &cHc0)
void resize(unsigned int i, bool flagNullify=true)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
bool closeToImageBorder(const vpImage< unsigned char > &I, const unsigned int threshold)
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=NULL, vpColVector *const m_w_prev=NULL)
std::list< vpMbtDistanceCircle * > circles_disp
Vector of the circles used here only to display the full model.
unsigned int getKltPyramidLevels() const
double minPolygonAreaThresholdGeneral
Minimum polygon area threshold for LOD mode (general setting)
static double deg(double rad)
void initInteractionMatrixError()
bool displayFeatures
If true, the features are displayed.
void setCameraParameters(const vpCameraParameters &cam)
void preTracking(const vpImage< unsigned char > &I)
bool applyLodSettingInConfig
Implementation of column vector and the associated operations.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
unsigned int getKltMaskBorder() const
vpColVector m_error_hybrid
(s - s*)
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace=0, const std::string &name="")
vpHomogeneousMatrix inverse() const
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
static vpHomogeneousMatrix direct(const vpColVector &v)
virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true, const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true, const vpMatrix &LVJ_true, const vpColVector &error)
double getKltQuality() const
Contains an M-estimator and various influence function.
unsigned int nbvisiblepolygone
Number of polygon (face) currently visible.
Tukey influence function.
double angleDisappears
Angle used to detect a face disappearance.
virtual unsigned int getNbPolygon() const
virtual void initFaceFromLines(vpMbtPolygon &polygon)
vpMbtPolygon * polygon
Pointer to the polygon that define a face.
unsigned int getHeight() const
vpColVector error
The error vector.
bool getFovClipping() const
std::vector< std::list< vpMbtDistanceLine * > > lines
unsigned int getKltMaxFeatures() const
bool Reinit
Indicates if the line has to be reinitialized.
virtual void init(const vpImage< unsigned char > &I)
virtual void setCameraParameters(const vpCameraParameters &cam)
virtual void loadConfigFile(const std::string &configFile, bool verbose=true)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int trackFirstLoop(const vpImage< unsigned char > &I, vpColVector &factor, unsigned int lvl=0)
vpColVector m_w_klt
Robust weights for KLT.
virtual void setMinLineLengthThresh(double minLineLengthThresh, const std::string &name="")
unsigned int getCurrentNumberPoints() const
std::vector< vpMbtMeLine * > meline
The moving edge container.
unsigned int clippingFlag
Flags specifying which clipping to used.
void setMinMedianAbsoluteDeviation(double mad_min)
void insert(const vpMatrix &A, unsigned int r, unsigned int c)
void trackMovingEdge(const vpImage< unsigned char > &I)
void displayOgre(const vpHomogeneousMatrix &cMo)
unsigned int nbFeaturel2
The number of moving edges on line 2.
virtual void initFaceFromLines(vpMbtPolygon &polygon)
unsigned int getCurrentNumberPoints() const
void setKltBlockSize(const unsigned int &bs)
void setKltMaxFeatures(const unsigned int &mF)
void setCameraParameters(const vpCameraParameters &cam)
vpMbtMeLine * meline2
The moving edge containers (second line of the cylinder)
virtual void computeVVSInteractionMatrixAndResidu()
virtual void initCircle(const vpPoint &, const vpPoint &, const vpPoint &, double r, int idFace=0, const std::string &name="")
vpImage< unsigned char > m_I
Grayscale image buffer, used when passing color images.
double getLodMinPolygonAreaThreshold() const
void setBlockSize(int blockSize)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
bool useLodGeneral
True if LOD mode is enabled.
vpMatrix L
The interaction matrix.
void computeScanLineRender(const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h)
virtual std::vector< std::vector< double > > getFeaturesForDisplayKlt()
vpHomogeneousMatrix m_cMo
The current pose.
std::vector< unsigned int > nbFeature
The number of moving edges.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo, const vpImage< unsigned char > &I)
void initInteractionMatrixError()
std::list< vpMbtDistanceKltPoints * > kltPolygons
bool isoJoIdentity
Boolean to know if oJo is identity (for fast computation)
void computeInteractionMatrixAndResidu(vpColVector &_R, vpMatrix &_J)
vpHomogeneousMatrix c0Mo
Initial pose.
unsigned int getKltWindowSize() const
virtual void setNearClippingDistance(const double &dist)
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)
void computeFov(const unsigned int &w, const unsigned int &h)