TrackerFeatures tracks features using OpenCV's cvGoodFeaturesToTrack and cvCalcOpticalFlowPyrLK More...
#include <TrackerFeatures.h>
Public Member Functions | |
int | AddFeatures (IplImage *mask=NULL) |
add features to the previously tracked frame if there are less than min_features | |
void | ChangeSettings (int _max_features=100, int _min_features=90, double _quality_level=0.01, double _min_distance=10) |
Change settings while running. | |
bool | DelFeature (int index) |
Stop tracking the identified feature (with index for features array) | |
bool | DelFeatureId (int id) |
Stop tracking the identified feature (with feature id) | |
IplImage * | NewFeatureMask () |
Create and get the pointer to new_features_mask. | |
int | Purge () |
Purge features that are considerably closer than the defined min_distance. | |
void | Reset () |
Reset. | |
double | Reset (IplImage *img, IplImage *mask) |
Reset track features on specified mask area. | |
double | Track (IplImage *img) |
Track features. | |
double | Track (IplImage *img, bool add_features) |
Track features. | |
double | Track (IplImage *img, IplImage *mask) |
Track features. | |
TrackerFeatures (int _max_features=100, int _min_features=90, double _quality_level=0.01, double _min_distance=10, int _pyr_levels=1, int _win_size=3) | |
Constructor for TrackerFeatures tracks features using OpenCV's cvGoodFeaturesToTrack and cvCalcOpticalFlowPyrLK. | |
~TrackerFeatures () | |
Destructor. | |
Public Attributes | |
int | feature_count |
Track result: count of current features | |
CvPoint2D32f * | features |
Track result: current features | |
int * | ids |
Track result: ID:s for current features | |
int | prev_feature_count |
Track result: count of previous features | |
CvPoint2D32f * | prev_features |
Track result: previous features | |
int * | prev_ids |
Track result: ID:s for previous features | |
Protected Member Functions | |
double | TrackHid (IplImage *img, IplImage *mask=NULL, bool add_features=true) |
Reset track features on specified mask area. | |
Protected Attributes | |
int | frame_count |
IplImage * | gray |
IplImage * | img_eig |
IplImage * | img_tmp |
IplImage * | mask |
int | max_features |
double | min_distance |
int | min_features |
int | next_id |
IplImage * | prev_gray |
IplImage * | prev_pyramid |
int | pyr_levels |
IplImage * | pyramid |
double | quality_level |
char * | status |
int | win_size |
int | x_res |
int | y_res |
TrackerFeatures tracks features using OpenCV's cvGoodFeaturesToTrack and cvCalcOpticalFlowPyrLK
Definition at line 40 of file TrackerFeatures.h.
alvar::TrackerFeatures::TrackerFeatures | ( | int | _max_features = 100 , |
int | _min_features = 90 , |
||
double | _quality_level = 0.01 , |
||
double | _min_distance = 10 , |
||
int | _pyr_levels = 1 , |
||
int | _win_size = 3 |
||
) |
Constructor for TrackerFeatures tracks features using OpenCV's cvGoodFeaturesToTrack and cvCalcOpticalFlowPyrLK.
_max_features | The maximum amount of features to be tracked |
_min_features | The minimum amount of features. The featureset is filled up when the number of features is lower than this. |
_quality_level | Multiplier for the maxmin eigenvalue; specifies minimal accepted quality of image corners. |
_min_distance | Limit, specifying minimum possible distance between returned corners; Euclidian distance is used. If 0 given we use default value aiming for uniform cover: _min_distance = 0.8*sqrt(x_res*y_res/max_features)) |
_pyr_levels | Number of pyramid levels |
Definition at line 32 of file TrackerFeatures.cpp.
Destructor.
Definition at line 43 of file TrackerFeatures.cpp.
int alvar::TrackerFeatures::AddFeatures | ( | IplImage * | mask = NULL | ) |
add features to the previously tracked frame if there are less than min_features
Definition at line 227 of file TrackerFeatures.cpp.
void alvar::TrackerFeatures::ChangeSettings | ( | int | _max_features = 100 , |
int | _min_features = 90 , |
||
double | _quality_level = 0.01 , |
||
double | _min_distance = 10 |
||
) |
Change settings while running.
Definition at line 58 of file TrackerFeatures.cpp.
bool alvar::TrackerFeatures::DelFeature | ( | int | index | ) |
Stop tracking the identified feature (with index for features array)
Reimplemented in alvar::TrackerFeaturesEC.
Definition at line 105 of file TrackerFeatures.cpp.
bool alvar::TrackerFeatures::DelFeatureId | ( | int | id | ) |
Stop tracking the identified feature (with feature id)
Reimplemented in alvar::TrackerFeaturesEC.
Definition at line 115 of file TrackerFeatures.cpp.
IplImage * alvar::TrackerFeatures::NewFeatureMask | ( | ) |
Create and get the pointer to new_features_mask.
Definition at line 216 of file TrackerFeatures.cpp.
int alvar::TrackerFeatures::Purge | ( | ) |
Purge features that are considerably closer than the defined min_distance.
Note, that we always try to maintain the smaller id's assuming that they are older ones
Reimplemented in alvar::TrackerFeaturesEC.
Definition at line 122 of file TrackerFeatures.cpp.
void alvar::TrackerFeatures::Reset | ( | ) |
Reset.
Reimplemented in alvar::TrackerFeaturesEC.
Definition at line 100 of file TrackerFeatures.cpp.
double alvar::TrackerFeatures::Reset | ( | IplImage * | img, |
IplImage * | mask | ||
) |
Reset track features on specified mask area.
Reimplemented in alvar::TrackerFeaturesEC.
Definition at line 201 of file TrackerFeatures.cpp.
double alvar::TrackerFeatures::Track | ( | IplImage * | img | ) | [inline, virtual] |
double alvar::TrackerFeatures::Track | ( | IplImage * | img, |
bool | add_features | ||
) |
Track features.
Definition at line 207 of file TrackerFeatures.cpp.
double alvar::TrackerFeatures::Track | ( | IplImage * | img, |
IplImage * | mask | ||
) |
Track features.
Definition at line 211 of file TrackerFeatures.cpp.
double alvar::TrackerFeatures::TrackHid | ( | IplImage * | img, |
IplImage * | mask = NULL , |
||
bool | add_features = true |
||
) | [protected] |
Reset track features on specified mask area.
Definition at line 140 of file TrackerFeatures.cpp.
Track result: count of current features
Definition at line 70 of file TrackerFeatures.h.
CvPoint2D32f* alvar::TrackerFeatures::features |
Track result: current features
Definition at line 66 of file TrackerFeatures.h.
int alvar::TrackerFeatures::frame_count [protected] |
Definition at line 43 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::gray [protected] |
Definition at line 51 of file TrackerFeatures.h.
Track result: ID:s for current features
Definition at line 74 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::img_eig [protected] |
Definition at line 49 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::img_tmp [protected] |
Definition at line 50 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::mask [protected] |
Definition at line 55 of file TrackerFeatures.h.
int alvar::TrackerFeatures::max_features [protected] |
Definition at line 47 of file TrackerFeatures.h.
double alvar::TrackerFeatures::min_distance [protected] |
Definition at line 45 of file TrackerFeatures.h.
int alvar::TrackerFeatures::min_features [protected] |
Definition at line 46 of file TrackerFeatures.h.
int alvar::TrackerFeatures::next_id [protected] |
Definition at line 56 of file TrackerFeatures.h.
Track result: count of previous features
Definition at line 68 of file TrackerFeatures.h.
CvPoint2D32f* alvar::TrackerFeatures::prev_features |
Track result: previous features
Definition at line 64 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::prev_gray [protected] |
Definition at line 52 of file TrackerFeatures.h.
Track result: ID:s for previous features
Definition at line 72 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::prev_pyramid [protected] |
Definition at line 54 of file TrackerFeatures.h.
int alvar::TrackerFeatures::pyr_levels [protected] |
Definition at line 58 of file TrackerFeatures.h.
IplImage* alvar::TrackerFeatures::pyramid [protected] |
Definition at line 53 of file TrackerFeatures.h.
double alvar::TrackerFeatures::quality_level [protected] |
Definition at line 44 of file TrackerFeatures.h.
char* alvar::TrackerFeatures::status [protected] |
Definition at line 48 of file TrackerFeatures.h.
int alvar::TrackerFeatures::win_size [protected] |
Definition at line 57 of file TrackerFeatures.h.
int alvar::TrackerFeatures::x_res [protected] |
Definition at line 42 of file TrackerFeatures.h.
int alvar::TrackerFeatures::y_res [protected] |
Definition at line 42 of file TrackerFeatures.h.