public class MaxGeoKeyFrameManager extends Object implements VisOdomKeyFrameManager
Designed to be frame rate independent and maximize geometric information across frames. Old frames are kept as long as possible and attempts to drop/skip over bad frames due to motion blur.
Nested Class Summary
Nested Classes Modifier and Type Class Description
protected static class
Fields Modifier and Type Field Description
doubleIf the fraction of the image covered by features drops below this the current frame is a new keyframe
protected @Nullable PrintStream
Constructors Constructor Description
Modifier and Type Method Description
PointTracker<?> tracker, VisOdomBundleAdjustment.BCamera camera)(After the current frame becomes a keyframe new tracks are spawned from it.
FastAccess<VisOdomBundleAdjustment.BCamera> bundleCameras)(Resets the manager into it's initial state.
VisOdomBundleAdjustment<?> sba)(Perform different checks that attempt to see if too much has changed.
PointTracker<?> tracker, int maxKeyFrames, int newFrames, VisOdomBundleAdjustment<?> sba)(Selects frames to discard from the scene graph.
VisOdomBundleAdjustment<?> sba, int totalDiscard)(Selects an older frame to discard.
PrintStream out, @Nullable Set<String> configuration)(@Nullable
minimumCoveragepublic double minimumCoverageIf the fraction of the image covered by features drops below this the current frame is a new keyframe
discardKeyIndicesprotected final DogArray_I32 discardKeyIndices
histogramprotected Histogram2D_S32 histogram
verbose@Nullable protected @Nullable PrintStream verbose
MaxGeoKeyFrameManagerpublic MaxGeoKeyFrameManager(double minimumCoverage)
initializeResets the manager into it's initial state. Specifies number of cameras and their shape.
selectFramesToDiscardpublic DogArray_I32 selectFramesToDiscard(PointTracker<?> tracker, int maxKeyFrames, int newFrames, VisOdomBundleAdjustment<?> sba)Selects frames to discard from the scene graph. The most recent frame(s) (highest index value) is assumed to be the current tracker frame.
- Specified by:
tracker- Feature tracker
maxKeyFrames- Maximum number of allowed key frames
newFrames- Number of new frames added
sba- scene graph
- Returns a list of frames to discard. They are in sequential order from least to greatest.
keepCurrentFrameprotected boolean keepCurrentFrame(VisOdomBundleAdjustment<?> sba)Perform different checks that attempt to see if too much has changed. If too much has changed then the current keyframe should be kept so that new features can be spawned and starvation avoided.
- true if it should keep the current frame
selectOldToDiscardprotected void selectOldToDiscard(VisOdomBundleAdjustment<?> sba, int totalDiscard)Selects an older frame to discard. If a frame has zero features in common with the current frame it will be selected. After that it scores frames based on how many features it has in common with the other frames, excluding the current frame.
totalDiscard- How many need to be discarded
handleSpawnedTracksAfter the current frame becomes a keyframe new tracks are spawned from it. This passes in that new information
setVerbosepublic void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)