- java.lang.Object
-
- boofcv.alg.tracker.tld.TldTracker<T,D>
-
public class TldTracker<T extends ImageGray,D extends ImageGray> extends java.lang.ObjectMain class for Tracking-Learning-Detection (TLD) [1] (a.k.a Predator) object tracker for video sequences. TLD tracks an object which is specified by a user using a rectangle. The description of the object is dynamically updated using P and N constraints.
To start tracking
initialize(ImageGray, int, int, int, int)must first be called to specify the region being tracked. Then each time a new image in the sequences arrivestrack(ImageGray)is called. Be sure to check its return value to see if tracking was successful or not. If tracking fails one frame it can recover. This is often the case where an object becomes obscured and then visible again.NOTE: This implementation is based the description found in [1]. The spirit of the original algorithm is replicated, but there are a several algorithmic changes. The most significant modifications are as follow; 1) The KLT tracker used to update the rectangle does not use NCC features to validate a track or the median based outlier removal. Instead a robust model matching algorithm finds the best fit motion. 2) The non-maximum suppression algorithm has been changed so that it computes a more accurate local maximum and only uses local rectangles to compute the average response. 3) Fern selection is done by selecting the N best using a likelihood ratio conditional on the current image. 4) Learning only happens when a track is considered strong. See code for more details. Note, this is not a port of the OpenTLD project.
[1] Zdenek Kalal, "Tracking-Learning-Detection" University of Surrey, April 2011 Phd Thesis.
-
-
Constructor Summary
Constructors Constructor and Description TldTracker(TldParameters config, InterpolatePixelS<T> interpolate, ImageGradient<T,D> gradient, java.lang.Class<T> imageType, java.lang.Class<D> derivType)Configures the TLD tracker
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description TldParametersgetConfig()TldDetection<T>getDetection()Rectangle2D_F64getTargetRegion()Returns the estimated location of the target in the current imageTldTemplateMatching<T>getTemplateMatching()Rectangle2D_F64getTrackerRegion()voidinitialize(T image, int x0, int y0, int x1, int y1)Starts tracking the rectangular region.booleanisPerformLearning()static int[]selectPyramidScale(int imageWidth, int imageHeight, int minSize)Selects the scale for the image pyramid based on image size and feature sizevoidsetPerformLearning(boolean performLearning)booleantrack(T image)Updates track region.
-
-
-
Constructor Detail
-
TldTracker
public TldTracker(TldParameters config, InterpolatePixelS<T> interpolate, ImageGradient<T,D> gradient, java.lang.Class<T> imageType, java.lang.Class<D> derivType)
Configures the TLD tracker- Parameters:
config- Configuration class which specifies the tracker's behavior
-
-
Method Detail
-
initialize
public void initialize(T image, int x0, int y0, int x1, int y1)
Starts tracking the rectangular region.- Parameters:
image- First image in the sequence.x0- Top-left corner of rectangle. x-axisy0- Top-left corner of rectangle. y-axisx1- Bottom-right corner of rectangle. x-axisy1- Bottom-right corner of rectangle. y-axis
-
track
public boolean track(T image)
Updates track region.- Parameters:
image- Next image in the sequence.- Returns:
- true if the object could be found and false if not
-
selectPyramidScale
public static int[] selectPyramidScale(int imageWidth, int imageHeight, int minSize)Selects the scale for the image pyramid based on image size and feature size- Returns:
- scales for image pyramid
-
isPerformLearning
public boolean isPerformLearning()
-
setPerformLearning
public void setPerformLearning(boolean performLearning)
-
getTemplateMatching
public TldTemplateMatching<T> getTemplateMatching()
-
getTargetRegion
public Rectangle2D_F64 getTargetRegion()
Returns the estimated location of the target in the current image- Returns:
- Location of the target
-
getTrackerRegion
public Rectangle2D_F64 getTrackerRegion()
-
getConfig
public TldParameters getConfig()
-
getDetection
public TldDetection<T> getDetection()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG