#include <CAMShiftTracker.h>
Public Member Functions | |
void | setVmin (int vmin=10) |
Sets the minimum V value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
void | setVmax (int vmax=256) |
Sets the maximum V value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
void | setSmin (int smin=30) |
Sets the minimum S value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
int | getVmin () const |
Gets the minimum V value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
int | getVmax () const |
Gets the maximum V value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
int | getSmin () const |
Gets the minimum S value (in the HSV color space) of a pixel for it to be processed by CAMShift. | |
SimpleManeuveringFilter & | getPositionFilter () |
Gets the SimpleManeuveringFilter object used to filter the x,y position. | |
SimpleManeuveringFilter & | getSizeFilter () |
Gets the SimpleManeuveringFilter object used to filter the size (width, height). | |
SimpleManeuveringFilter & | getAngleFilter () |
Gets the SimpleManeuveringFilter object used to filter the angle. | |
void | resetFilters () |
Resets all three SimpleManeuveringFilter objects to their default parameters. | |
void | setMinArea (int a=300) |
Sets the minimum area required for tracking. | |
int | getMinArea () |
Gets the currently set minimum area required for tracking. | |
void | run (IplImage *frame) |
Runs the tracker and processes the image (frame). | |
IplImage * | getImage () const |
Returns the last image received through the run() function. | |
IplImage * | getBackProject () const |
Returns an image of the "BackProject". | |
IplImage * | getHistogramImage () const |
Returns an image of the color histogram, representing the model. | |
CvHistogram * | getHistogram () const |
Returns the actual histogram, representing the model. | |
void | drawEllipse (IplImage *image) const |
Draws on the image an ellipse representing the currently tracked object. | |
CvBox2D | getTrackBox () const |
Returns the actual tracking information of the currently tracked object. | |
CvScalar | getTrackColor () const |
Returns the color representing the whole histogram. | |
void | learn (CvRect selection) |
Trains the tracker by building a color histogram from the given selection in the image. | |
void | forget () |
Makes the tracker ignore its histogram and return to an untrained state. | |
void | enableTracking (CvRect selection) |
Enables tracking as if the object is in selection, but does not train from selection. |
It provides a set of easy to use functions for parameter setup, and runs the CAMShift tracker algorithm in an appropriate manner for most applications. It also uses a SimpleManeuveringFilter to smooth out noise from its measured values.
To use this object, set the filters if desired, then call run() for every image you have. Then when you get to an image displaying a colored object you want to track, call learn() with a rectangle corresponding to the position and size of this object. The tracker will start tracking that color, and you can call getTrackBox() after every run() to find out where the object is now.
|
Draws on the image an ellipse representing the currently tracked object.
|
|
Enables tracking as if the object is in selection, but does not train from selection. This is useful if we load the histogram from somewhere else.
|
|
Makes the tracker ignore its histogram and return to an untrained state. Takes effect at the next run() call. |
|
Gets the SimpleManeuveringFilter object used to filter the angle.
|
|
Returns an image of the "BackProject". This grayscale image indicates the probability that a pixel is of the color stored in the histogram, 0 = 0.0 and 255 = 1.0. See the documentation of OpenCV for more details.
|
|
Returns the actual histogram, representing the model. The tracker will attempt to track the color represented by this histogram. See the documentation of OpenCV for more details.
|
|
Returns an image of the color histogram, representing the model. The tracker will attempt to track the color represented by this histogram. See the documentation of OpenCV for more details.
|
|
Returns the last image received through the run() function.
|
|
Gets the currently set minimum area required for tracking.
|
|
Gets the SimpleManeuveringFilter object used to filter the x,y position.
|
|
Gets the SimpleManeuveringFilter object used to filter the size (width, height).
|
|
Gets the minimum S value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|
|
Returns the actual tracking information of the currently tracked object. That is, the position, the size, and the angle.
|
|
Returns the color representing the whole histogram. This can be used to color representative objects in a GUI.
|
|
Gets the maximum V value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|
|
Gets the minimum V value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|
|
Trains the tracker by building a color histogram from the given selection in the image. The selection rectangle refers to the image as returned by getImage(). The color histogram will be updated after a call to this function and the run() function.
|
|
Runs the tracker and processes the image (frame).
|
|
Sets the minimum area required for tracking. The area is compared to what CAMShift returns in comp->rect divided by 255 (see OpenCV documention). So, the minimum area is basically a value indicated the minimum area in pixel^2 if the "probability" in the "backproject" of all pixels in that area were of 255. If this minimum is not reached, the tracker will try to latch on to something (else) in the image.
|
|
Sets the minimum S value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|
|
Sets the maximum V value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|
|
Sets the minimum V value (in the HSV color space) of a pixel for it to be processed by CAMShift.
|