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);
109 int globalcountFeatures;
116 double harris_free_parameter;
123 IplImage *prev_image;
125 IplImage *prev_pyramid;
129 int countPrevFeatures;
131 CvPoint2D32f *features;
132 CvPoint2D32f *prev_features;
135 long *prev_featuresid;
141 bool *lostDuringTrack;
147 funcevent OnInitialize;
148 funcinfo OnFeatureLost;
149 funcinfo OnNewFeature;
150 funcinfo OnMeasureFeature;
151 funccheck IsFeatureValid;
165 void addFeature(
const int &
id,
const float &x,
const float &y);
173 void getFeature(
int index,
int &
id,
float &x,
float &y)
const;
190 void getPrevFeature(
int index,
int &
id,
float &x,
float &y)
const;
203 void initTracking(
const IplImage *I,
const IplImage *mask = NULL);
206 void track(
const IplImage *I);
218 void setBlockSize(
const int input) {initialized = 0; block_size=input;}
227 void setInitialGuess(CvPoint2D32f **guess_pts);
234 void setMaxFeatures(
const int input);
263 void setQuality(
double input) {initialized = 0; quality=input;}
272 void setUseHarris(
const int input) {initialized = 0; use_harris=input;}
275 void suppressFeature(
int index);
281 unsigned int thickness=1);
282 static void display(
const vpImage<vpRGBa>& I,
const CvPoint2D32f* features_list,
284 unsigned int thickness=1);
287 const long *featuresid_list,
const int &nbFeatures,
289 static void display(
const vpImage<vpRGBa>& I,
const CvPoint2D32f* features_list,
290 const long *featuresid_list,
const int &nbFeatures,