Class MovingObjectSelector
java.lang.Object
io.github.jspinak.brobot.analysis.motion.MovingObjectSelector
Identifies moving objects by analyzing motion patterns across three consecutive scenes. This
class implements an algorithm that distinguishes true moving objects from background changes by
tracking consistent motion trajectories.
The algorithm works by:
- Finding overlapping regions between scene transitions
- Identifying opposite-direction movements that indicate object motion
- Verifying consistent distances to confirm the same object is moving
A moving object is identified when:
- A match region overlaps between two scene transitions
- There's a match in the opposite direction (>150° difference)
- The distances are consistent, indicating the same object
This approach effectively filters out camera movements and background changes, focusing on objects that move independently within the scene.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMovingObjectSelector
(DistanceCalculator distance) Constructs a MovingObjectSelector instance with distance calculation utility. -
Method Summary
-
Constructor Details
-
MovingObjectSelector
Constructs a MovingObjectSelector instance with distance calculation utility.- Parameters:
distance
- utility for calculating distances and angles between matches
-
-
Method Details
-
select
Selects moving objects by analyzing motion patterns across three scenes. The algorithm identifies objects that move in opposite directions between scene transitions, which indicates independent object motion rather than camera movement or background changes.The returned list contains three sublists:
- Index 0: Matches from scene 1 (starting positions)
- Index 1: Overlapping matches in scene 2 (intermediate positions)
- Index 2: Matches from scene 3 (final positions)
- Parameters:
matchList1
- matches representing changes between scenes 1 and 2matchList2
- matches representing changes between scenes 2 and 3maxDistance
- maximum allowed distance for related matches- Returns:
- list of three lists containing matches for each scene's moving objects
-