Package boofcv.abst.scene
Interface SceneRecognition<T extends ImageBase<T>>
- All Superinterfaces:
VerbosePrint
- All Known Implementing Classes:
WrapFeatureToSceneRecognition
Implementations of this interface seek to solve the problem of "have I seen this scene before, but from the
same or different perspective? If so find those images". For example, this should be used if you want to find
images of a mountain taken from a different angle or zoom. Implementations may or may not apply geometric
constraints to ensure that it is the same scene.
Usage Example:
- Learn a model from a set of images by calling
learnModel(java.util.Iterator<T>)
- Add images for later retrieval by calling
addImage(java.lang.String, T)
- Call
query(T, boofcv.misc.BoofLambdas.Filter<java.lang.String>, int, org.ddogleg.struct.DogArray<boofcv.abst.scene.SceneRecognition.Match>)
to find the set of N images which are most similar to the passed in image
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
References a match in the database to the query image -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new image to the databasevoid
Removes all images from the database.getImageIds
(@Nullable List<String> storage) Returns a list of image IDs in the databaseThe image data type which can be processedvoid
learnModel
(Iterator<T> images) Learns a model by finding the most distinctive features in the provided set of images.boolean
query
(T queryImage, BoofLambdas.Filter<String> filter, int limit, DogArray<SceneRecognition.Match> matches) Finds the best matches in the database to the query image.Methods inherited from interface org.ddogleg.struct.VerbosePrint
setVerbose
-
Method Details
-
learnModel
Learns a model by finding the most distinctive features in the provided set of images. Images are not added to the database. -
clearDatabase
void clearDatabase()Removes all images from the database. The model is not modified -
addImage
Adds a new image to the database- Parameters:
id
- The unique ID for this imageimage
- The image
-
query
boolean query(T queryImage, @Nullable BoofLambdas.Filter<String> filter, int limit, DogArray<SceneRecognition.Match> matches) Finds the best matches in the database to the query image.- Parameters:
queryImage
- (Input) image being processedfilter
- (Input) Used to filter results so that known matches don't pollute the results.limit
- (Input) The maximum number of results it will return. If ≤ 0 then all matches are returned.matches
- (Output) Set of matches found in best first order. List is always cleared- Returns:
- true if at least one valid match was found or false if no valid matches could be found. If false that means matches is empty. This is strictly a convenience.
-
getImageIds
Returns a list of image IDs in the database- Parameters:
storage
- (Optional) Storage for the list of images. If null a new instance is created- Returns:
- List of all the image IDs.
-
getImageType
The image data type which can be processed
-