Package boofcv.alg.tracker.tld
Class TldRegionTracker<I extends ImageGray<I>,D extends ImageGray<D>>
java.lang.Object
boofcv.alg.tracker.tld.TldRegionTracker<I,D>
Tracks features inside target's rectangle using pyramidal KLT and updates the rectangle using found motion.
A scale and translation model model is used. A major departure from the paper is that KLT forward-backward (FB)
error and robust model fitting is used to prune tracks and estimate motion.
In the paper FB and NCC error is used to prune tracks and a (in my opinion) hack is used by computing
median error values. The way the motion is computed is more
mathematically sound this way. NCC would provide a good sanity check, but is probably not needed.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTldRegionTracker
(int gridWidth, int featureRadius, double maxErrorFB, ImageGradient<I, D> gradient, PyramidKltTracker<I, D> tracker, Class<I> imageType, Class<D> derivType) Configures tracker -
Method Summary
Modifier and TypeMethodDescriptionprotected void
declareDataStructures
(PyramidDiscrete<I> image) Declares internal data structures based on the input image pyramidgetPairs()
void
initialize
(PyramidDiscrete<I> image) Call for the first image being trackedboolean
process
(ImagePyramid<I> image, Rectangle2D_F64 targetRectangle) Creates several tracks inside the target rectangle and compuets their motionprotected void
spawnGrid
(Rectangle2D_F64 prevRect) Spawn KLT tracks at evenly spaced points inside a gridprotected boolean
Tracks KLT features in forward/reverse direction and the tracking error metricsprotected void
updateCurrent
(ImagePyramid<I> image) Computes the gradient and changes the reference to the current pyramid
-
Constructor Details
-
TldRegionTracker
public TldRegionTracker(int gridWidth, int featureRadius, double maxErrorFB, ImageGradient<I, D> gradient, PyramidKltTracker<I, D> tracker, Class<I> imageType, Class<D> derivType) Configures tracker- Parameters:
gridWidth
- Number of tracks spawned along a side in the grid. Try 10featureRadius
- Radius of KLT features being tracked. Try 5maxErrorFB
- Maximum allowed forwards-backwards errorgradient
- Computes image gradient used by KLT trackertracker
- Feature trackerimageType
- Type of input imagederivType
- Type of derivative image
-
-
Method Details
-
initialize
Call for the first image being tracked- Parameters:
image
- Most recent video image.
-
declareDataStructures
Declares internal data structures based on the input image pyramid -
process
Creates several tracks inside the target rectangle and compuets their motion- Parameters:
image
- Most recent video image.targetRectangle
- Location of target in previous frame. Not modified.- Returns:
- true if tracking was successful or false if not
-
updateCurrent
Computes the gradient and changes the reference to the current pyramid -
trackFeature
protected boolean trackFeature()Tracks KLT features in forward/reverse direction and the tracking error metrics -
spawnGrid
Spawn KLT tracks at evenly spaced points inside a grid -
getPairs
-
getTracks
-