This class contains the "short term tracking" part of the algorithm. More...
#include <LKTracker.h>
Classes | |
struct | LKPyramid |
Internal representation for an image pyramid. More... | |
struct | Point2D |
Simple representation for 2D (sub pixel) image points. More... | |
Public Member Functions | |
const std::vector< int > * | getDebugPoints () const |
A list of points [x0,y0,...,xn,yn] that where considered as inliers in the last iteration. | |
void | initFirstFrame (unsigned char *img) |
Sets up the internal image pyramid. | |
void | initFirstFrame (const Matrix &img) |
Sets up the internal image pyramid. | |
LKTracker (int width, int height) | |
Constructor. | |
void | processFrame (const Matrix &curImage, std::vector< ObjectBox > &bbox, std::vector< bool > &isDefined) |
Computes the optical flow for each object. | |
bool | processFrame (const Matrix &curImage, ObjectBox &bbox, bool dotracking=true) |
An adapter for the single object case. | |
~LKTracker () | |
Destructor. | |
Private Member Functions | |
float | median (std::vector< float > *vec, bool compSqrt=false) const |
double | NCC (const Matrix &aMatrix, const Matrix &bMatrix) const |
void | pyramidLK (const LKPyramid *prevPyramid, const LKPyramid *curPyramid, const Point2D *prevPts, Point2D *nextPts, char *status, int count) const |
Private Attributes | |
std::vector< int > | ivDebugPoints |
int | ivHeight |
int | ivIndex |
LKPyramid * | ivPrevPyramid |
int | ivWidth |
This class contains the "short term tracking" part of the algorithm.
Definition at line 47 of file LKTracker.h.
motld::LKTracker::LKTracker | ( | int | width, |
int | height | ||
) | [inline] |
Constructor.
Definition at line 51 of file LKTracker.h.
motld::LKTracker::~LKTracker | ( | ) | [inline] |
Destructor.
Definition at line 54 of file LKTracker.h.
const std::vector<int>* motld::LKTracker::getDebugPoints | ( | ) | const [inline] |
A list of points [x0,y0,...,xn,yn] that where considered as inliers in the last iteration.
Definition at line 68 of file LKTracker.h.
void motld::LKTracker::initFirstFrame | ( | unsigned char * | img | ) |
Sets up the internal image pyramid.
Definition at line 113 of file LKTracker.h.
void motld::LKTracker::initFirstFrame | ( | const Matrix & | img | ) |
Sets up the internal image pyramid.
Definition at line 119 of file LKTracker.h.
float motld::LKTracker::median | ( | std::vector< float > * | vec, |
bool | compSqrt = false |
||
) | const [inline, private] |
Computes median of a vector
Definition at line 565 of file LKTracker.h.
double motld::LKTracker::NCC | ( | const Matrix & | aMatrix, |
const Matrix & | bMatrix | ||
) | const [inline, private] |
void motld::LKTracker::processFrame | ( | const Matrix & | curImage, |
std::vector< ObjectBox > & | bbox, | ||
std::vector< bool > & | isDefined | ||
) |
Computes the optical flow for each object.
bbox | List of current object boxes, they are replaced with the new boxes |
isDefined | Must have the same size as bbox. True for each object that is currently defined and should be tracked. Is set to false if tracking failed. |
Definition at line 151 of file LKTracker.h.
bool motld::LKTracker::processFrame | ( | const Matrix & | curImage, |
ObjectBox & | bbox, | ||
bool | dotracking = true |
||
) |
An adapter for the single object case.
Definition at line 140 of file LKTracker.h.
void motld::LKTracker::pyramidLK | ( | const LKPyramid * | prevPyramid, |
const LKPyramid * | curPyramid, | ||
const Point2D * | prevPts, | ||
Point2D * | nextPts, | ||
char * | status, | ||
int | count | ||
) | const [inline, private] |
Computes optical flow for each tracking point.
Based on the technical report "Pyramidal Implementation of the Lucas Kanade Feature Tracker: Description of the algorithm" by Jean-Yves Bouguet
Definition at line 436 of file LKTracker.h.
std::vector<int> motld::LKTracker::ivDebugPoints [private] |
Definition at line 91 of file LKTracker.h.
int motld::LKTracker::ivHeight [private] |
Definition at line 88 of file LKTracker.h.
int motld::LKTracker::ivIndex [private] |
Definition at line 90 of file LKTracker.h.
LKPyramid* motld::LKTracker::ivPrevPyramid [private] |
Definition at line 89 of file LKTracker.h.
int motld::LKTracker::ivWidth [private] |
Definition at line 87 of file LKTracker.h.