Class HybridTrackerScalePoint<I extends ImageGray<I>,D extends ImageGray<D>,TD extends TupleDesc<TD>>


public class HybridTrackerScalePoint<I extends ImageGray<I>,D extends ImageGray<D>,TD extends TupleDesc<TD>> extends Object

Combines a KLT tracker with Detect-Describe-Associate type trackers. Features are nominally tracked using KLT, but after KLT drops a track it is deactivated and made dormant. Upon request, it will attempt to reactivate a dormant track by associating it with newly detected features. After a track has been reactivated it will be tracked normally.

  • Field Details

  • Constructor Details

    • HybridTrackerScalePoint

      public HybridTrackerScalePoint(PyramidKltForHybrid<I,D> trackerKlt, DetectDescribePoint<I,TD> detector, AssociateDescription2D<TD> associate, int tooCloseRadius)
      Configures tracker
      trackerKlt - KLT tracker used nominally
      detector - Feature detector
      associate - Association algorithm
      tooCloseRadius - If tracks are less than or equal to this distance to each other some will be pruned
  • Method Details

    • createNewTrack

      protected HybridTrack<TD> createNewTrack()
      Creates a new track and sets the descriptor
    • reset

      public void reset()
      Sets the tracker into its initial state. Previously declared track data structures are saved for re-use.
    • updateTracks

      public void updateTracks(PyramidDiscrete<I> pyramid, D[] derivX, D[] derivY)
      Updates the location and description of tracks using KLT. Saves a reference to the input image for future processing. Also updates the `totalPureKlt` count.
      pyramid - Image pyramid of input.
      derivX - Derivative pyramid of input x-axis
      derivY - Derivative pyramid of input y-axis
    • pruneActiveTracksWhichAreTooClose

      public void pruneActiveTracksWhichAreTooClose()
      KLT tracks can drift towards each other (camera moving away) and this is often a bad situation as little new information is added by each track
    • associateInactiveTracks

      public void associateInactiveTracks(I input)
      These tracks were dropped by KLT at some point in the past. See if any of the recent detection match them
    • spawnNewTracks

      public void spawnNewTracks()
      Spawns new tracks from the list of unassociated detections. Must call associateInactiveTracks(I) first.
    • dropExcessiveInactiveTracks

      public void dropExcessiveInactiveTracks()
      If there are too many inactive tracks drop some of them
    • dropTrack

      public boolean dropTrack(HybridTrack<TD> track)
      Stops tracking the specified track and recycles its data.
      track - The track being dropped
      true if the track was being tracked and data was recycled false if not.
    • dropTrackByAllIndex

      public HybridTrack<TD> dropTrackByAllIndex(int index)
      Drops the track using its index in all. Note that removeSwap is used so the order will change
      The dropped track
    • dropAllTracks

      public void dropAllTracks()
      Drops all tracks and recycles the data