Package boofcv.alg.tracker.hybrid
Class HybridTrackerScalePoint<I extends ImageGray<I>,D extends ImageGray<D>,TD extends TupleDesc<TD>>
java.lang.Object
boofcv.alg.tracker.hybrid.HybridTrackerScalePoint<I,D,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 Summary
Modifier and TypeFieldDescriptionprotected AssociateDescriptionSets2D<TD>
Used to associate features using their DDA descriptionprotected FastArray<Point2D_F64>
protected DogArray_I32
protected DetectDescribePoint<I,
TD> feature detector and describerprotected int
protected int
protected FastArray<Point2D_F64>
protected DogArray_I32
int
protected double
protected long
protected PyramidKltForHybrid<I,
D> The KLT tracker used to perform the nominal track updateprotected FastArray<HybridTrack<TD>>
all active tracks that have been tracked purely by KLTprotected DogArray<HybridTrack<TD>>
List of all tracks (active + inactive) and stores unused track data for future re-useprotected List<HybridTrack<TD>>
tracks which were dropped this frameprotected FastArray<HybridTrack<TD>>
tracks not visible in the current frame and were not updatedprotected List<HybridTrack<TD>>
recently spawned tracks -
Constructor Summary
ConstructorDescriptionHybridTrackerScalePoint
(PyramidKltForHybrid<I, D> trackerKlt, DetectDescribePoint<I, TD> detector, AssociateDescription2D<TD> associate, int tooCloseRadius) Configures tracker -
Method Summary
Modifier and TypeMethodDescriptionvoid
associateInactiveTracks
(I input) These tracks were dropped by KLT at some point in the past.protected HybridTrack<TD>
Creates a new track and sets the descriptorvoid
Drops all tracks and recycles the datavoid
If there are too many inactive tracks drop some of themboolean
dropTrack
(HybridTrack<TD> track) Stops tracking the specified track and recycles its data.dropTrackByAllIndex
(int index) Drops the track using its index in all.void
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 trackvoid
reset()
Sets the tracker into its initial state.void
Spawns new tracks from the list of unassociated detections.void
updateTracks
(PyramidDiscrete<I> pyramid, D[] derivX, D[] derivY) Updates the location and description of tracks using KLT.
-
Field Details
-
maxInactiveTracks
public int maxInactiveTracks -
rand
-
imageWidth
protected int imageWidth -
imageHeight
protected int imageHeight -
trackerKlt
The KLT tracker used to perform the nominal track update -
toleranceFB
protected double toleranceFB -
detector
feature detector and describer -
associate
Used to associate features using their DDA description -
tracksAll
List of all tracks (active + inactive) and stores unused track data for future re-use -
tracksActive
all active tracks that have been tracked purely by KLT -
tracksInactive
tracks not visible in the current frame and were not updated -
tracksSpawned
recently spawned tracks -
tracksDropped
tracks which were dropped this frame -
detectedDesc
-
knownDesc
-
detectedSet
-
knownSet
-
detectedPixels
-
knownPixels
-
totalTracks
protected long totalTracks
-
-
Constructor Details
-
HybridTrackerScalePoint
public HybridTrackerScalePoint(PyramidKltForHybrid<I, D> trackerKlt, DetectDescribePoint<I, TD> detector, AssociateDescription2D<TD> associate, int tooCloseRadius) Configures tracker- Parameters:
trackerKlt
- KLT tracker used nominallydetector
- Feature detectorassociate
- Association algorithmtooCloseRadius
- If tracks are less than or equal to this distance to each other some will be pruned
-
-
Method Details
-
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
Updates the location and description of tracks using KLT. Saves a reference to the input image for future processing. Also updates the `totalPureKlt` count.- Parameters:
pyramid
- Image pyramid of input.derivX
- Derivative pyramid of input x-axisderivY
- 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
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 callassociateInactiveTracks(I)
first. -
dropExcessiveInactiveTracks
public void dropExcessiveInactiveTracks()If there are too many inactive tracks drop some of them -
dropTrack
Stops tracking the specified track and recycles its data.- Parameters:
track
- The track being dropped- Returns:
- true if the track was being tracked and data was recycled false if not.
-
dropTrackByAllIndex
Drops the track using its index in all. Note that removeSwap is used so the order will change- Returns:
- The dropped track
-
dropAllTracks
public void dropAllTracks()Drops all tracks and recycles the data
-