Jafar
|
This class is a Jafar wrapper (using Image) to the KLT tracker. More...
This class is a Jafar wrapper (using Image) to the KLT tracker.
This class wraps all functions of the klt.h header, which contains all necessary functions to use Birchfield's KLT implementation. Some functions have been added to offer a superior level of use of the tracker. Only added functions are documented, for others please refer to the KLT lib documentation (http://www.ces.clemson.edu/~stb/klt/). All methods have the same name than the original function but with the "KLT" prefix removed.
#include <klt.hpp>
Public Member Functions | |
Klt (int maxDisplacement=50, int maxAccel=50, int securityMargin=10, int measureConfidence=10, int initSpeedConfidence=100) | |
constructor | |
KLT_TrackingContext | CreateTrackingContext (void) |
KLT_FeatureList | CreateFeatureList (int nFeatures) |
KLT_FeatureHistory | CreateFeatureHistory (int nFrames) |
KLT_FeatureTable | CreateFeatureTable (int nFrames, int nFeatures) |
void | FreeTrackingContext (KLT_TrackingContext tc) |
void | FreeFeatureList (KLT_FeatureList fl) |
void | FreeFeatureHistory (KLT_FeatureHistory fh) |
void | FreeFeatureTable (KLT_FeatureTable ft) |
void | SelectGoodFeatures (KLT_TrackingContext tc, image::Image &jImg, KLT_FeatureList fl) |
void | TrackFeatures (KLT_TrackingContext tc, image::Image &jImg1, image::Image &jImg2, KLT_FeatureList fl) |
void | ReplaceLostFeatures (KLT_TrackingContext tc, image::Image &jImg, int ncols, int nrows, KLT_FeatureList fl) |
void | SelectGoodFeaturesObject (KLT_TrackingContext tc, image::Image &jImg, KLT_FeatureList fl, int zone_x=-1, int zone_y=-1, int zone_w=-1, int zone_h=-1, tDate timeStamp=-1) |
select features in an image, restricted to a given area | |
void | TrackFeaturesObject (KLT_TrackingContext tc, image::Image &jImg1, image::Image &jImg2, KLT_FeatureList fl, bool replace=false, tDate timeStamp=-1) |
track features of the object from one image to the next, and replace features on the object if asked | |
int | CountRemainingFeatures (KLT_FeatureList fl) |
void | PrintTrackingContext (KLT_TrackingContext tc) |
void | ChangeTCPyramid (KLT_TrackingContext tc, int search_range) |
void | UpdateTCBorder (KLT_TrackingContext tc) |
void | StopSequentialMode (KLT_TrackingContext tc) |
void | SetVerbosity (int verbosity) |
float | ComputeSmoothSigma (KLT_TrackingContext tc) |
void | StoreFeatureList (KLT_FeatureList fl, KLT_FeatureTable ft, int frame) |
void | ExtractFeatureList (KLT_FeatureList fl, KLT_FeatureTable ft, int frame) |
void | StoreFeatureHistory (KLT_FeatureHistory fh, KLT_FeatureTable ft, int feat) |
void | ExtractFeatureHistory (KLT_FeatureHistory fh, KLT_FeatureTable ft, int feat) |
void | WriteFeatureListToPPM (KLT_FeatureList fl, KLT_PixelType *greyimg, int ncols, int nrows, char *filename) |
void | WriteImageToImg (image::Image &jGreyimg, image::Image &jRGBimg) |
copy grey image in rgb image | |
void | WriteFeatureListToImg (KLT_FeatureList fl, image::Image &jRGBimg) |
draw a representation of feature on the image | |
void | WriteBordersToImg (image::Image &jRGBimg, KLT_TrackingContext tc) |
draw a representation of the working area on the image | |
void | WriteKalmanToImg (image::Image &jRGBimg, KLT_TrackingContext tc) |
draw a representation of kalman informations on the image (positions, speeds, and variances) | |
void | WriteFeatureList (KLT_FeatureList fl, char *filename, char *fmt) |
void | WriteFeatureHistory (KLT_FeatureHistory fh, char *filename, char *fmt) |
void | WriteFeatureTable (KLT_FeatureTable ft, char *filename, char *fmt) |
KLT_FeatureList | ReadFeatureList (KLT_FeatureList fl, char *filename) |
KLT_FeatureHistory | ReadFeatureHistory (KLT_FeatureHistory fh, char *filename) |
KLT_FeatureTable | ReadFeatureTable (KLT_FeatureTable ft, char *filename) |
Public Attributes | |
TrackedObject | object |
Private Attributes | |
int | workingPos [2] |
int | prevWorkingPos [2] |
int | workingDims [2] |
int | prevWorkingDims [2] |
int | searchingZone [4] |
int | securityMargin |
filter::KalmanFilter * | kalman |
tDate | lastTimeStamp |
kalman filter (see filter jafar module) |
jafar::klt::Klt::Klt | ( | int | maxDisplacement = 50 , |
int | maxAccel = 50 , |
||
int | securityMargin = 10 , |
||
int | measureConfidence = 10 , |
||
int | initSpeedConfidence = 100 |
||
) | [inline] |
constructor
maxDisplacement | the maximum displacement in pixels from one frame to the next, determining the size of the processing area |
maxAccel | the maximum acceleration of the object in pixels by frames^2, determining the error of the kalman model (speed is constant) |
securityMargin | a margin to increase the size of the processing area |
measureConfidence | the confidence in the measure (barycenter of features representing the object) |
initSpeedConfidence | the confidence in the initial speed, that's to say the maximum value of initial speed (because we assume it to be 0 for the first frame) |
void jafar::klt::Klt::SelectGoodFeaturesObject | ( | KLT_TrackingContext | tc, |
image::Image & | jImg, | ||
KLT_FeatureList | fl, | ||
int | zone_x = -1 , |
||
int | zone_y = -1 , |
||
int | zone_w = -1 , |
||
int | zone_h = -1 , |
||
tDate | timeStamp = -1 |
||
) |
select features in an image, restricted to a given area
This function is an enhancement of the KLT lib's function SelectGoodFeatures, enabling to restrict the selection of features to a given area of the image, or more concretely to a given object.
tc | the tracking context (please refer to the KLT lib documentation) |
jImg | the image where select features |
fl | the feature list for storing found features (please refer to the KLT lib documentation) |
zone_x | the x of top left corner of the area where you want to select features in the first image |
zone_y | the y of top left corner of the area where you want to select features in the first image |
zone_w | the width of the area where you want to select features in the first image |
zone_h | the height of the area where you want to select features in the first image |
timeStamp | a time stamp of the image, if default (-1) time stamp is automatically increased of 1 at each frame, so that all speed units are in pixels /frame. If this field is used, to set different dt between frames, be carefull to set speeds in the appropriate unit |
void jafar::klt::Klt::TrackFeaturesObject | ( | KLT_TrackingContext | tc, |
image::Image & | jImg1, | ||
image::Image & | jImg2, | ||
KLT_FeatureList | fl, | ||
bool | replace = false , |
||
tDate | timeStamp = -1 |
||
) |
track features of the object from one image to the next, and replace features on the object if asked
This function is an enhancement of the KLT lib's functions TrackGoodFeatures and ReplaceLostFeatures, enabling to track features only in a small area (determined by a kalman filter) in order to speed up the processing, and to replace lost features on the object (with an elimination of features not on the object)
tc | the tracking context (please refer to the KLT lib documentation) |
jImg1 | the previous image. If sequentialMode is set, this image is generally not used, except if the size of the processing area is changing. So you should always give a correct parameter here. |
jImg2 | the new image where to track features |
fl | the feature list (please refer to the KLT lib documentation) |
replace | specify whether lost features should be replaced when lost or not |
timeStamp | cf SelectGoodFeaturesObject |
void jafar::klt::Klt::WriteBordersToImg | ( | image::Image & | jRGBimg, |
KLT_TrackingContext | tc | ||
) |
draw a representation of the working area on the image
jRGBimg | the destination image, which must be a RGB 3-channel image with same dimensions ncols and nrows than jGreyimage, and which MUST be already allocated ! |
tc | the tracking context used |
void jafar::klt::Klt::WriteFeatureListToImg | ( | KLT_FeatureList | fl, |
image::Image & | jRGBimg | ||
) |
draw a representation of feature on the image
fl | the feature list to draw |
jRGBimg | the destination image, which must be a RGB 3-channel image with same dimensions ncols and nrows than jGreyimage, and which MUST be already allocated ! |
void jafar::klt::Klt::WriteImageToImg | ( | image::Image & | jGreyimg, |
image::Image & | jRGBimg | ||
) |
copy grey image in rgb image
jGreyimage | the original grey image |
jRGBimg | the destination image, which must be a RGB 3-channel image with same dimensions than jGreyimage, and which MUST be already allocated ! |
void jafar::klt::Klt::WriteKalmanToImg | ( | image::Image & | jRGBimg, |
KLT_TrackingContext | tc | ||
) |
draw a representation of kalman informations on the image (positions, speeds, and variances)
jRGBimg | the destination image, which must be a RGB 3-channel image with same dimensions ncols and nrows than jGreyimage, and which MUST be already allocated ! |
tc | the tracking context used |
Generated on Wed Oct 15 2014 00:37:41 for Jafar by doxygen 1.7.6.1 |