31 TrackerStat::TrackerStat(
int binsize) :
f(100,90) {
42 if (img == NULL)
return -1;
67 if (img == NULL)
return -1;
92 double x = x_curr - x_pred;
93 double y = y_curr - y_pred;
94 double theta_pred = atan2((
double)y_pred-(
y_res/2), (
double)x_pred-(
x_res/2))*180.0/3.1415926535;
95 double theta_curr = atan2((
double)y_curr-(
y_res/2), (
double)x_curr-(
x_res/2))*180.0/3.1415926535;
106 double xx = *x - (
x_res/2);
107 double yy = *y - (
y_res/2);
108 double kosini = cos(
rotd*3.1415926535/180);
109 double sini = sin(
rotd*3.1415926535/180);
110 *x = ((kosini * xx) - (sini * yy)) +
xd + (
x_res/2);
111 *y = ((sini * xx) + (kosini * yy)) +
yd + (
y_res/2);
CvPoint2D32f * features
Track result: current features
TrackerStatRot(int binsize=8, int binsize_rot=3)
Constructor.
double Track(IplImage *img)
Track features.
int prev_feature_count
Track result: count of previous features
TFSIMD_FORCE_INLINE const tfScalar & y() const
void Clear()
Clear the histogram.
int * prev_ids
Track result: ID:s for previous features
CvPoint2D32f * prev_features
Track result: previous features
HistogramSubpixel hist_rot
This file implements a statistical tracker.
double Track(IplImage *img)
Translation tracker (the simplest possible)
virtual void Compensate(double *x, double *y)
TFSIMD_FORCE_INLINE const tfScalar & x() const
int feature_count
Track result: count of current features
int * ids
Track result: ID:s for current features
int GetMax(double *dim0, double *dim1=0, double *dim2=0)
Get the maximum from the histogram This finds the maximum bin(s) and averages the original values con...
void AddDimension(int binsize)
Add dimension with a binsize.
void Inc(double dim0, double dim1=0, double dim2=0)
Increase the histogram for given dimensions.
double Track(IplImage *img)
Translation + rotation tracker.
TrackerStat deduces the optical flow based on tracked features using Seppo Valli's statistical tracki...
double rotd
Track result rotation in degrees
double xd
Track result x-translation in pixels
double yd
Track result y-translation in pixels
virtual void Compensate(double *x, double *y)