46 #ifndef vpMbKltTracker_h
47 #define vpMbKltTracker_h
49 #include <visp/vpConfig.h>
51 #if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
53 #include <visp/vpMbTracker.h>
54 #include <visp/vpKltOpencv.h>
55 #include <visp/vpMeterPixelConversion.h>
56 #include <visp/vpPixelMeterConversion.h>
57 #include <visp/vpDisplayX.h>
58 #include <visp/vpMbtKltXmlParser.h>
59 #include <visp/vpHomography.h>
60 #include <visp/vpRobust.h>
61 #include <visp/vpSubColVector.h>
62 #include <visp/vpSubMatrix.h>
63 #include <visp/vpExponentialMap.h>
65 #include <visp/vpMbtDistanceKltPoints.h>
66 #include <visp/vpMbtDistanceCircle.h>
67 #include <visp/vpMbtDistanceCylinder.h>
233 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
271 void addCircle(
const vpPoint &P1,
const vpPoint &P2,
const vpPoint &P3,
const double r,
const std::string &name=
"");
272 void addCylinder(
const vpPoint &P1,
const vpPoint &P2,
const double r,
const std::string &name=
"");
275 const bool displayFullModel =
false);
277 const vpColor& col,
const unsigned int thickness=1,
const bool displayFullModel =
false);
298 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
301 inline CvPoint2D32f* getKltPoints() {
return tracker.
getFeatures();}
304 std::vector<vpImagePoint> getKltImagePoints()
const;
306 std::map<int, vpImagePoint> getKltImagePointsWithId()
const;
320 virtual inline double getLambda()
const {
return lambda;}
334 virtual inline unsigned int getMaxIter()
const {
return maxIter;}
351 const bool verbose=
false);
353 const bool verbose=
false);
365 virtual inline void setLambda(
const double gain) {this->lambda = gain;}
379 virtual inline void setMaxIter(
const unsigned int max) {maxIter = max;}
390 #ifdef VISP_HAVE_OGRE
391 faces.getOgreContext()->setWindowName(
"MBT Klt");
408 void computeVVS(
const unsigned int &nbInfos,
vpColVector &w);
413 const std::string &name=
"");
415 const std::string &name=
"");
422 #endif // VISP_HAVE_OPENCV
bool compute_interaction
If true, compute the interaction matrix at each iteration of the minimization. Otherwise, compute it only on the first iteration.
std::list< vpMbtDistanceKltPoints * > kltPolygons
Vector of the cylinders used here only to display the full model.
void setThresholdAcceptation(const double th)
virtual void track(const vpImage< unsigned char > &I)=0
virtual void setLambda(const double gain)
unsigned int maxIter
The maximum iteration of the virtual visual servoing stage.
std::vector< cv::Point2f > getFeatures() const
Get the list of current features.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class to define colors available for display functionnalities.
double percentGood
Percentage of good points, according to the initial number, that must have the tracker.
virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius, const int idFace=0, const std::string &name="")=0
std::list< vpMbtDistanceCylinder * > & getFeaturesCylinder()
virtual double getLambda() const
std::list< vpMbtDistanceCircle * > & getFeaturesCircle()
bool firstInitialisation
Flag to specify whether the init method is called the first or not (specific calls to realize in this...
virtual void resetTracker()=0
Class that defines what is a point.
std::vector< cv::Point2f > getKltPoints()
vpHomogeneousMatrix ctTc0
The estimated displacement of the pose between the current instant and the initial position...
virtual void init(const vpImage< unsigned char > &I)=0
unsigned int getMaskBorder() const
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)=0
Implementation of a polygon of the model used by the model-based tracker.
virtual void setCameraParameters(const vpCameraParameters &camera)
unsigned int maskBorder
Erosion of the mask.
virtual void initFaceFromCorners(vpMbtPolygon &polygon)=0
Generic class defining intrinsic camera parameters.
std::list< vpMbtDistanceKltPoints * > & getFeaturesKlt()
Main methods for a model-based tracker.
Model based tracker using only KLT.
bool firstTrack
First track() called.
virtual void loadConfigFile(const std::string &configFile)=0
vpKltOpencv tracker
Points tracker.
double threshold_outlier
Threshold below which the weight associated to a point to consider this one as an outlier...
virtual void setMaxIter(const unsigned int max)
cv::Mat cur
Temporary OpenCV image for fast conversion.
double lambda
The gain of the virtual visual servoing stage.
int getNbKltPoints() const
vpKltOpencv getKltOpencv() const
std::list< vpMbtDistanceCircle * > circles_disp
Vector of the circles used here only to display the full model.
virtual void setOgreVisibilityTest(const bool &v)
void setMaskBorder(const unsigned int &e)
std::list< vpMbtDistanceCylinder * > cylinders_disp
Vector of the cylinders used here only to display the full model.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
virtual void initFaceFromLines(vpMbtPolygon &polygon)=0
virtual void setOgreVisibilityTest(const bool &v)
virtual void testTracking()=0
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV.
int getNbFeatures() const
Get the number of current features.
double getThresholdAcceptation() const
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)=0
virtual unsigned int getMaxIter() const
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const int idFace=0, const std::string &name="")=0