Package io.github.jspinak.brobot.action.internal.find.match


package io.github.jspinak.brobot.action.internal.find.match
Match processing, transformation, and collection management utilities.

This package provides comprehensive tools for working with Match objects, including adjustment, filtering, transformation, and collection management. These utilities ensure that raw matches from various sources are properly processed into actionable results.

Core Components

  • invalid reference
    io.github.jspinak.brobot.action.internal.find.match.MatchAdjuster
    - Applies position and dimension adjustments to matches based on ActionConfig settings
  • MatchCollectionUtilities - Provides essential operations for managing match collections including filtering and limiting
  • MatchContentExtractor - Captures visual and text content from matched regions for further processing
  • MatchToStateConverter - Transforms matches into State objects for dynamic state generation and learning

Match Processing Pipeline

  1. Raw Match Creation - Matches created by various find strategies
  2. Position Adjustment - Apply offsets and resize operations
  3. Content Extraction - Capture images and text from match regions
  4. Collection Management - Filter, sort, and limit match sets
  5. State Conversion - Transform matches into reusable states when needed

Match Adjustment Features

The MatchAdjuster supports various transformations:

  • Position Offsets - Move match locations by specified amounts (addX/addY)
  • Relative Resizing - Adjust dimensions proportionally (addW/addH)
  • Absolute Resizing - Set exact dimensions (absoluteW/absoluteH)
  • Batch Processing - Apply adjustments to entire collections efficiently

Collection Management

MatchCollectionUtilities provides:

  • Adding matches from various sources to ActionResults
  • Limiting match counts based on action strategies
  • Filtering matches by score or other criteria
  • Sorting matches for optimal selection

Content Extraction

MatchContentExtractor captures:

  • Visual Content - BufferedImage and Mat representations
  • Text Content - OCR extraction when required
  • Scene Context - Links to source scenes for reference
  • Timing - Runs after all adjustments for accuracy

Dynamic State Learning

MatchToStateConverter enables:

  • Converting successful matches into reusable StateImage objects
  • Grouping related matches into cohesive State objects
  • Supporting adaptive automation that learns from results
  • Building new states during exploration phases

Integration Points

These utilities integrate throughout the find system:

  • Called by all find strategies to process results
  • Work with ActionConfig to apply user preferences
  • Support both individual and batch operations
  • Maintain consistency across different match sources
See Also: