Package boofcv.alg.similar
Class SimilarImagesTrackThenMatch<Image extends ImageBase<Image>,TD extends TupleDesc<TD>>
java.lang.Object
boofcv.alg.similar.SimilarImagesFromTracks<PointTrack>
boofcv.alg.similar.SimilarImagesTrackThenMatch<Image,TD>
- All Implemented Interfaces:
LookUpSimilarImages
,VerbosePrint
public class SimilarImagesTrackThenMatch<Image extends ImageBase<Image>,TD extends TupleDesc<TD>>
extends SimilarImagesFromTracks<PointTrack>
implements VerbosePrint
First track features sequentially, then use
FeatureSceneRecognition
to identify
loops. Association results are saved and memory usage will grow approximately linearly with the number of
images.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Describes the relationship between two imagesNested classes/interfaces inherited from class boofcv.alg.similar.SimilarImagesFromTracks
SimilarImagesFromTracks.Frame, SimilarImagesFromTracks.Match, SimilarImagesFromTracks.TrackToID<Track>, SimilarImagesFromTracks.TrackToPixel<Track>
-
Field Summary
Modifier and TypeFieldDescriptionint
Limit on number of returned images made during a query.int
Minimum number of frames (by ID) away two frames need to be for loop closure logic to connect themFields inherited from class boofcv.alg.similar.SimilarImagesFromTracks
connections, frameMap, frames, imageHeight, imageWidth, minimumCommonTracks, pairs, searchRadius, tracks
-
Constructor Summary
ConstructorDescriptionSimilarImagesTrackThenMatch
(DescribePoint<Image, TD> describer, AssociateDescriptionHashSets<TD> featureAssociator, FeatureSceneRecognition<TD> recognizer, BoofLambdas.Factory<PackedArray<TD>> factoryPackedDesc) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkSimilarConnection
(int frameIdx, int matchedFrameIdx, List<String> similarImages) Checks to see if these two frames are similar and if so it will connect them.void
findSimilar
(String target, BoofLambdas.Filter<String> filter, List<String> similarImages) Given an imageID, it will find list of similar images.void
Call this function after it's done tracking.boolean
lookupAssociated
(String viewB, DogArray<AssociatedIndex> pairs) Looks up pairs of associated features from a similar image which was returned in the most recent call toLookUpSimilarImages.findSimilar(java.lang.String, boofcv.misc.BoofLambdas.Filter<java.lang.String>, java.util.List<java.lang.String>)
.void
processFrame
(Image image, List<PointTrack> tracks, long frameID) Processes a frame.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> options) Methods inherited from class boofcv.alg.similar.SimilarImagesFromTracks
connectFrames, createFrameSaveObservations, getImageIDs, initialize, lookupPixelFeats, processFrame
-
Field Details
-
minimumRecognizeDistance
public int minimumRecognizeDistanceMinimum number of frames (by ID) away two frames need to be for loop closure logic to connect them -
limitQuery
public int limitQueryLimit on number of returned images made during a query. Sequential results are filtered and do not need to be compensated for.
-
-
Constructor Details
-
SimilarImagesTrackThenMatch
public SimilarImagesTrackThenMatch(DescribePoint<Image, TD> describer, AssociateDescriptionHashSets<TD> featureAssociator, FeatureSceneRecognition<TD> recognizer, BoofLambdas.Factory<PackedArray<TD>> factoryPackedDesc)
-
-
Method Details
-
processFrame
Processes a frame. Updates the relationship between features using tracks and descriptors computed at the track's pixel coordinate- Parameters:
image
- (Input) Image most recent image tin the sequencetracks
- (Input) List of active tracks visible in the current frameframeID
- (Input) Identifier for this image/frame
-
finishedTracking
public void finishedTracking()Call this function after it's done tracking. It will then attempt to connect disconnected frames to each other -
findSimilar
public void findSimilar(String target, @Nullable BoofLambdas.Filter<String> filter, List<String> similarImages) Description copied from interface:LookUpSimilarImages
Given an imageID, it will find list of similar images. Similarity is defined from the perspective of the 'target', so viewA might think viewB is similar to it, but viewB might think viewA is not similar to it.- Specified by:
findSimilar
in interfaceLookUpSimilarImages
- Overrides:
findSimilar
in classSimilarImagesFromTracks<PointTrack>
- Parameters:
target
- (Input) ID of target imagefilter
- (Input) Filter results by ID. true = keep, false = reject. Null means no filter.similarImages
- (Output) Storage for IDs of similar images. Cleared upon each call
-
lookupAssociated
Description copied from interface:LookUpSimilarImages
Looks up pairs of associated features from a similar image which was returned in the most recent call toLookUpSimilarImages.findSimilar(java.lang.String, boofcv.misc.BoofLambdas.Filter<java.lang.String>, java.util.List<java.lang.String>)
. The src will be the target in 'findSimilar' and the dst will be the requested similar image.- Specified by:
lookupAssociated
in interfaceLookUpSimilarImages
- Overrides:
lookupAssociated
in classSimilarImagesFromTracks<PointTrack>
- Parameters:
viewB
- ID of a similar image to the target when callingLookUpSimilarImages.findSimilar(java.lang.String, boofcv.misc.BoofLambdas.Filter<java.lang.String>, java.util.List<java.lang.String>)
.pairs
- Storage for associated features. Cleared upon each call- Returns:
- true if views are similar and have known associations. False if not and results should be ignored
-
checkSimilarConnection
protected void checkSimilarConnection(int frameIdx, int matchedFrameIdx, List<String> similarImages) Checks to see if these two frames are similar and if so it will connect them. NOTE: We can't save the results here with the results from the sequential tracker since the filter could have changed since the last time similar was called. -
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> options) - Specified by:
setVerbose
in interfaceVerbosePrint
-