Class TrackerMeanShiftComaniciu2003<T extends ImageBase>
- java.lang.Object
-
- boofcv.alg.tracker.meanshift.TrackerMeanShiftComaniciu2003<T>
-
public class TrackerMeanShiftComaniciu2003<T extends ImageBase> extends java.lang.ObjectMean shift tracker which adjusts the scale (or bandwidth) to account for changes in scale of the target and is based off of [1]. The tracker seeks to minimize the histogram error within the sampled region. The mean-shift region is sampled using an oriented rectangle and weighted using a 2D gaussian. The target is modeled using a color histogram of the input image, which can be optionally updated after each frame is processed. It can also be configured to not allow scale changes, which can improve stability.
Scale selection is done using sum-of-absolute-difference (SAD) error instead of Bhattacharyya as the paper suggests. Situations where found that two errors counteracted each other when using Bhattacharyya and the incorrect scale would be selected even with perfect data.
Another difference from the paper is that mean shift records which hypothesis has the best SAD error. After mean-shift stops iterating it selects the best solution. This is primarily helpful in situations where mean-shift doesn't converge in time and jumped away from the solution.
[1] Dorin Comaniciu, Visvanathan Ramesh, and Peter Meer,"Kernel-Based Object Tracking." IEEE Transactions on Pattern Analysis and Machine Intelligence 25.4 (2003): 1.
-
-
Constructor Summary
Constructors Constructor and Description TrackerMeanShiftComaniciu2003(boolean updateHistogram, int maxIterations, float minimumChange, float gamma, float minimumSizeRatio, float scaleChange, LocalWeightedHistogramRotRect<T> calcHistogram)Configures tracker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RectangleRotate_F32getRegion()voidinitialize(T image, RectangleRotate_F32 initial)Specifies the initial image to learn the target descriptionvoidtrack(T image)Searches for the target in the most recent image.
-
-
-
Constructor Detail
-
TrackerMeanShiftComaniciu2003
public TrackerMeanShiftComaniciu2003(boolean updateHistogram, int maxIterations, float minimumChange, float gamma, float minimumSizeRatio, float scaleChange, LocalWeightedHistogramRotRect<T> calcHistogram)Configures tracker.- Parameters:
updateHistogram- If true the histogram will be updated using the most recent image. Try true.maxIterations- Maximum number of mean-shift iterations. Try 30minimumChange- Mean-shift will stop when the change is below this threshold. Try 1e-4fgamma- Scale weighting factor. Value from 0 to 1. Closer to 0 the more it will prefer the most recent estimate. Try 0.1minimumSizeRatio- Fraction of the original region that the track is allowed to shrink to. Try 0.25scaleChange- The scale can be changed by this much between frames. 0 to 1. 0 = no scale change. 0.1 is recommended value in paper. no scale change is more stable.calcHistogram- Calculates the histogram
-
-
Method Detail
-
initialize
public void initialize(T image, RectangleRotate_F32 initial)
Specifies the initial image to learn the target description- Parameters:
image- Imageinitial- Initial image which contains the target
-
track
public void track(T image)
Searches for the target in the most recent image.- Parameters:
image- Most recent image in the sequence
-
getRegion
public RectangleRotate_F32 getRegion()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG