Class TldRegionTracker<I extends ImageGray<I>,D extends ImageGray<D>>


public class TldRegionTracker<I extends ImageGray<I>,D extends ImageGray<D>> extends Object
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.
  • 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
      gridWidth - Number of tracks spawned along a side in the grid. Try 10
      featureRadius - Radius of KLT features being tracked. Try 5
      maxErrorFB - Maximum allowed forwards-backwards error
      gradient - Computes image gradient used by KLT tracker
      tracker - Feature tracker
      imageType - Type of input image
      derivType - Type of derivative image
  • Method Details

    • initialize

      public void initialize(PyramidDiscrete<I> image)
      Call for the first image being tracked
      image - Most recent video image.
    • declareDataStructures

      protected void declareDataStructures(PyramidDiscrete<I> image)
      Declares internal data structures based on the input image pyramid
    • process

      public boolean process(ImagePyramid<I> image, Rectangle2D_F64 targetRectangle)
      Creates several tracks inside the target rectangle and compuets their motion
      image - Most recent video image.
      targetRectangle - Location of target in previous frame. Not modified.
      true if tracking was successful or false if not
    • updateCurrent

      protected void updateCurrent(ImagePyramid<I> image)
      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

      protected void spawnGrid(Rectangle2D_F64 prevRect)
      Spawn KLT tracks at evenly spaced points inside a grid
    • getPairs

      public DogArray<AssociatedPair> getPairs()
    • getTracks

      public TldRegionTracker.Track[] getTracks()