Interface SceneRecognition<T extends ImageBase<T>>

All Superinterfaces:
All Known Implementing Classes:

public interface SceneRecognition<T extends ImageBase<T>>
extends VerbosePrint
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:
  1. Learn a model from a set of images by calling learnModel(java.util.Iterator<T>)
  2. Add images for later retrieval by calling addImage(java.lang.String, T)
  3. 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
You can also save models and your image database by using functions in RecognitionIO.
  • Method Details

    • learnModel

      void learnModel​(Iterator<T> images)
      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

      void addImage​(String id, T image)
      Adds a new image to the database
      id - The unique ID for this image
      image - 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.
      queryImage - (Input) image being processed
      filter - (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
      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

      List<String> getImageIds​(@Nullable @Nullable List<String> storage)
      Returns a list of image IDs in the database
      storage - (Optional) Storage for the list of images. If null a new instance is created
      List of all the image IDs.
    • getImageType

      ImageType<T> getImageType()
      The image data type which can be processed