Class BestMatchCapture

java.lang.Object
io.github.jspinak.brobot.action.internal.find.scene.BestMatchCapture

@Component public class BestMatchCapture extends Object
Captures and saves the best matching region when pattern searches fail or find low-similarity matches. This is useful for debugging why patterns aren't matching as expected.

When enabled, this component will:

  • Find the best match regardless of similarity threshold
  • Capture the matching region from the scene
  • Save it with descriptive filename including similarity score
  • Optionally save the pattern image for comparison
Since:
1.0
  • Constructor Details

    • BestMatchCapture

      public BestMatchCapture()
  • Method Details

    • captureBestMatch

      public void captureBestMatch(Pattern pattern, Scene scene, List<Match> actualMatches)
      Captures the best matching region for a pattern, regardless of similarity threshold.
      Parameters:
      pattern - The pattern being searched for
      scene - The scene being searched
      actualMatches - The matches found at the configured threshold (may be empty)
    • isCaptureEnabled

      public boolean isCaptureEnabled()
      Checks if capture is enabled.
    • setCaptureEnabled

      public void setCaptureEnabled(boolean enabled)
      Sets whether capture is enabled (useful for testing).