Package boofcv.alg.similar
Class SimilarImagesFromTracks<Track>
java.lang.Object
boofcv.alg.similar.SimilarImagesFromTracks<Track>
- All Implemented Interfaces:
LookUpSimilarImages
- Direct Known Subclasses:
SimilarImagesTrackThenMatch
Processes frames from
PointTracker
and converts the tracking results into a LookUpSimilarImages
.
This is intended for scene reconstruction from video sequences.
- Results are ready as soon as
processFrame(java.util.List<Track>, long)
finishes - The unique string for each image is set to the frameID
- Frames can only be matched to each other with they are withing
searchRadius
of each other - No loop closure is performed
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Observations for a frame.static class
Describes how two frames are related to each other through common observations of the same featurestatic interface
Gets a unique ID from the trackstatic interface
Gets the pixel coordinate of the track -
Field Summary
Modifier and TypeFieldDescriptionList of all matches between framesQuick way to retrieve a frame based on its IDStores observations and track ID for every frameint
int
final ConfigLength
If the number of common tracks between two frames drops below this then they are considered to be disconnected.protected DogArray<AssociatedIndex>
int
Maximum number of frames in forwards and backwards direction which will be searched for being related.protected List<PointTrack>
-
Constructor Summary
ConstructorDescriptionSimilarImagesFromTracks
(SimilarImagesFromTracks.TrackToID<Track> lookupID, SimilarImagesFromTracks.TrackToPixel<Track> lookupPixel) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
connectFrames
(SimilarImagesFromTracks.Frame current, SimilarImagesFromTracks.Frame previous, FastAccess<AssociatedIndex> associated) Connects the two frames and remembers the associated features between themprotected SimilarImagesFromTracks.Frame
createFrameSaveObservations
(List<Track> tracks, long frameID) Create a new frame from the tracker's current observations.void
findSimilar
(String target, BoofLambdas.Filter<String> filter, List<String> similarImages) Given an imageID, it will find list of similar images.Returns the list of image ID's in the same order they were processed.void
initialize
(int width, int height) Resets all data structures and saves the image size.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
lookupPixelFeats
(String target, DogArray<Point2D_F64> features) Looks up pixel observations of features in the specified view.void
processFrame
(List<Track> tracks, long frameID) Process the latest observations from the tracker.
-
Field Details
-
searchRadius
public int searchRadiusMaximum number of frames in forwards and backwards direction which will be searched for being related. If less than zero there are no hard limit. -
minimumCommonTracks
If the number of common tracks between two frames drops below this then they are considered to be disconnected. If relative, then it's relative to the minimum number of observed tracks in each frame.. -
frames
Stores observations and track ID for every frame -
frameMap
Quick way to retrieve a frame based on its ID -
connections
List of all matches between frames -
imageWidth
public int imageWidth -
imageHeight
public int imageHeight -
tracks
-
pairs
-
-
Constructor Details
-
SimilarImagesFromTracks
public SimilarImagesFromTracks(SimilarImagesFromTracks.TrackToID<Track> lookupID, SimilarImagesFromTracks.TrackToPixel<Track> lookupPixel)
-
-
Method Details
-
initialize
public void initialize(int width, int height) Resets all data structures and saves the image size. Must be called before other functions -
processFrame
Process the latest observations from the tracker. Save the results and- Parameters:
tracks
- (Input) List of active tracks visible in the current frameframeID
- (Input) Identifier for this image/frame
-
createFrameSaveObservations
protected SimilarImagesFromTracks.Frame createFrameSaveObservations(List<Track> tracks, long frameID) Create a new frame from the tracker's current observations. -
connectFrames
protected void connectFrames(SimilarImagesFromTracks.Frame current, SimilarImagesFromTracks.Frame previous, FastAccess<AssociatedIndex> associated) Connects the two frames and remembers the associated features between them -
getImageIDs
Returns the list of image ID's in the same order they were processed.- Specified by:
getImageIDs
in interfaceLookUpSimilarImages
-
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
- 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
-
lookupPixelFeats
Description copied from interface:LookUpSimilarImages
Looks up pixel observations of features in the specified view.- Specified by:
lookupPixelFeats
in interfaceLookUpSimilarImages
- Parameters:
target
- ID of target imagefeatures
- Storage for pixel observations. 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
- 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
-