Package boofcv.alg.similar
Class SimilarImagesData
java.lang.Object
boofcv.alg.similar.SimilarImagesData
- All Implemented Interfaces:
LookUpSimilarImages
Storage for the raw results of finding similar images. Everything is stored in memory in an uncompressed format.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
All the information for a single view.static class
Specifies how two views are related by saying which image features are matched with which other image features. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String id, List<Point2D_F64> features) Adds a new view.void
findSimilar
(String target, BoofLambdas.Filter<String> filter, List<String> similarImages) Given an imageID, it will find list of similar images.Returns a list of all images by ID that it has in its data baseboolean
lookupAssociated
(String similarD, 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
reset()
Clears all references to other objectsvoid
setRelationship
(String viewA, String viewB, List<AssociatedIndex> matches) Used to specify the relationship between two similar views by providing which features match up
-
Field Details
-
listImages
-
imageMap
-
-
Constructor Details
-
SimilarImagesData
public SimilarImagesData()
-
-
Method Details
-
reset
public void reset()Clears all references to other objects -
add
Adds a new view.- Parameters:
id
- The unique ID for the viewfeatures
- List of image features. Pixel coordinates.
-
setRelationship
Used to specify the relationship between two similar views by providing which features match up- Parameters:
viewA
- The 'src' view of the matchesviewB
- The 'dst' view of the matchesmatches
- List of matching image features
-
getImageIDs
Description copied from interface:LookUpSimilarImages
Returns a list of all images by ID that it has in its data base- 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:
similarD
- 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
-