54 #include <visp/vpConfig.h>
56 #ifdef VISP_HAVE_OPENCV
59 #pragma package <opencv>
62 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
63 # include <opencv2/imgproc/imgproc.hpp>
64 # include <opencv2/video/tracking.hpp>
65 # include <opencv2/legacy/legacy.hpp>
66 # include <opencv2/highgui/highgui.hpp>
76 #include <visp/vpConfig.h>
77 #include <visp/vpImage.h>
78 #include <visp/vpImageIo.h>
79 #include <visp/vpDisplay.h>
80 #include <visp/vpDebug.h>
81 #include <visp/vpException.h>
82 #include <visp/vpTrackingException.h>
84 typedef int (*funccheck)(int,double,double);
85 typedef void (*funcinfo)(int,int,int,double,double);
86 typedef void (*funcevent)(int);
148 int countPrevFeatures;
149 int globalcountFeatures;
156 double harris_free_parameter;
163 IplImage *prev_image;
165 IplImage *prev_pyramid;
168 CvPoint2D32f *features;
169 CvPoint2D32f *prev_features;
172 long *prev_featuresid;
173 bool *lostDuringTrack;
179 funcevent OnInitialize;
180 funcinfo OnFeatureLost;
181 funcinfo OnNewFeature;
182 funcinfo OnMeasureFeature;
183 funccheck IsFeatureValid;
198 void initTracking(
const IplImage *I,
const IplImage *mask = NULL);
201 void track(
const IplImage *I);
210 void setMaxFeatures(
const int input);
220 void setQuality(
double input) {initialized = 0; quality=input;}
248 void setBlockSize(
const int input) {initialized = 0; block_size=input;}
249 void setUseHarris(
const int input) {initialized = 0; use_harris=input;}
292 void getFeature(
int index,
int &
id,
float &x,
float &y)
const;
293 void getPrevFeature(
int index,
int &
id,
float &x,
float &y)
const;
294 void addFeature(
const int &
id,
const float &x,
const float &y);
295 void suppressFeature(
int index);
301 unsigned int thickness=1);
304 const long *featuresid_list,
const int &nbFeatures,
void setOnInitialize(funcevent input)
void setQuality(double input)
void setOnFeatureLost(funcinfo input)
int getMaxFeatures() const
Get Max number of features.
CvPoint2D32f * getFeatures() const
Get the list of features.
void setOnNewFeature(funcinfo input)
Class to define colors available for display functionnalities.
void setUseHarris(const int input)
void setOnMeasureFeature(funcinfo input)
void setPyramidLevels(const int input)
void setBlockSize(const int input)
CvPoint2D32f * getPrevFeatures() const
Get the list of features.
static const vpColor green
long * getFeaturesId() const
Get the list of features id.
void setWindowSize(const int input)
void setTrackerId(int tid)
void setIsFeatureValid(funccheck input)
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented with OpenCV.
int getNbFeatures() const
Get the current number of features.
long * getPrevFeaturesId() const
Get the list of features id.
int getNbPrevFeatures() const
Get the previous number of features.
void setMinDistance(double input)
bool * getListOfLostFeature() const
Get the list of lost feature.
void setHarrisFreeParameter(double input)