Class SimilarImagesFindOptions


public final class SimilarImagesFindOptions extends BaseFindOptions
Configuration for find operations that compare images for similarity.

This class encapsulates parameters specific to finding similar images between two ObjectCollections. The first ObjectCollection contains base images for comparison, and the second ObjectCollection contains images to compare against the base images. For each image in the second collection, it finds the best matching image from the first collection and returns a Match object with similarity scores.

This is particularly useful for:

  • Screen state recognition - determining which known screen is currently displayed
  • Image classification - categorizing images based on similarity to known templates
  • Change detection - finding which images have changed between collections
  • Duplicate detection - identifying similar or duplicate images across collections

The similarity comparison is performed at the Pattern level, where each StateImage's patterns are compared to find the best match. The larger image automatically becomes the scene, while the smaller becomes the search target.

Example usage:


 // Create options for finding similar images
 SimilarImagesFindOptions options = new SimilarImagesFindOptions.Builder()
     .setSimilarity(0.85) // Minimum similarity threshold
     .setComparisonMethod(ComparisonMethod.BEST_MATCH)
     .build();

 // First collection contains base images
 ObjectCollection baseImages = new ObjectCollection.Builder()
     .withImages(knownScreens)
     .build();

 // Second collection contains images to compare
 ObjectCollection compareImages = new ObjectCollection.Builder()
     .withImages(capturedScreens)
     .build();

 // Perform comparison
 ActionResult result = action.perform(options, baseImages, compareImages);
 // Result contains one Match per image in compareImages
 
Since:
2.0
See Also:
  • Method Details

    • getFindStrategy

      public FindStrategy getFindStrategy()
      Description copied from class: BaseFindOptions
      Gets the find strategy for this options instance.

      Subclasses should override this method to return their specific strategy. For example, PatternFindOptions would map its Strategy enum to FindStrategy, while ColorFindOptions would return FindStrategy.COLOR.

      Specified by:
      getFindStrategy in class BaseFindOptions
      Returns:
      The find strategy to use for this find operation
    • forScreenRecognition

      public static SimilarImagesFindOptions forScreenRecognition()
      Creates a configuration optimized for screen state recognition.

      This preset uses high similarity thresholds and strict comparison to accurately identify which known screen state is currently displayed.

      Returns:
      SimilarImagesFindOptions configured for screen recognition
    • forDuplicateDetection

      public static SimilarImagesFindOptions forDuplicateDetection()
      Creates a configuration optimized for finding duplicate images.

      This preset uses very high similarity thresholds to identify images that are nearly identical.

      Returns:
      SimilarImagesFindOptions configured for duplicate detection
    • forChangeDetection

      public static SimilarImagesFindOptions forChangeDetection()
      Creates a configuration optimized for change detection.

      This preset uses lower similarity thresholds and includes all results to identify which images have changed between collections.

      Returns:
      SimilarImagesFindOptions configured for change detection
    • getComparisonMethod

      public SimilarImagesFindOptions.ComparisonMethod getComparisonMethod()
    • isIncludeNoMatches

      public boolean isIncludeNoMatches()
    • isReturnAllScores

      public boolean isReturnAllScores()