Get Largest Rectangle Activity
The Get Largest Rectangle activity identifies and extracts the largest rectangular object within a specified image file. This activity returns the precise coordinates and dimensions of the detected rectangle, enabling further automation based on its location and size.
| Field | Description | Requirement |
|---|---|---|
| Image File Name | The full path and name of the image file to be processed. | Required |
| Return X-Position | The variable name to assign the found x-coordinate (horizontal position) of the largest rectangle. | Required |
| Return Y-Position | The variable name to assign the found y-coordinate (vertical position) of the largest rectangle. | Required |
| Return Width | The variable name to assign the found width of the largest rectangle. | Required |
| Return Height | The variable name to assign the found height of the largest rectangle. | Required |
Action Types & Examples
Return X-Position
- Format: Digit
- Example Result:
300
Return Y-Position
- Format: Digit
- Example Result:
280
Return Width
- Format: Digit
- Example Result:
150
Return Height
- Format: Digit
- Example Result:
75
Implementation Examples
Field Setup - Image File Name: C:\Robusta\robusta.png
Execution Parameters - Return X-Position: xPositionValue - Return Y-Position: yPositionValue - Return Width: widthValue - Return Height: heightValue
Technical Notes
The
Return X-PositionandReturn Y-Positionvariables can be directly utilized in other activities, such as the Mouse activity within Keyboard & Mouse Operations. For instance, if the activity returns300forxPositionValueand280foryPositionValue, these values can be passed as${xPositionValue}and${yPositionValue}to theX PositionandY Positionfields of a Mouse activity configured for aLEFT_CLICKaction. This enables precise interaction with the detected rectangle's location.