Image Recognition Node
The ImageRecognition node locates buttons, icons, text regions, or any other visual target on screen. It compares pre-captured template images, writes the detected coordinates back to the context, and unblocks downstream MouseMove, MouseClick, or sub-pipeline nodes.
Configuration Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | âī¸ | Node name, e.g. find-submit. |
params | ImageRecognitionParams | âī¸ | Matching options, see below. |
retry | number | âī¸ | Retry attempts after failure (-1 means retry forever). |
interval | number | âī¸ | Retry interval in milliseconds. |
conditions | Conditions | Optional guards combining exist/not_exist/condition. | |
err_return | boolean | Stop immediately on failure, defaults to true. |
ImageRecognitionParams
| Field | Type | Required | Description |
|---|---|---|---|
images | string[] | âī¸ | Template list in priority order. |
optimization | ImageOptimization | Image tuning options, see below. |
ImageOptimization
| Field | Type | Default | Description |
|---|---|---|---|
resize | number | 1.0 | Scale factor before matching to adapt to different resolutions. |
imread_type | string | GRAYSCALE | OpenCV read mode. Supports COLOR or GRAYSCALE. |
YAML Example
- action_type: ImageRecognition
name: find-submit
retry: -1
interval: 500
params:
images:
- submit.png
- submit-alt.png
optimization:
resize: 0.8
imread_type: COLOR
err_return: trueWith retry: -1 the node keeps matching both templates until one succeeds and stores the coordinates under variables such as find-submit.submit.png.
Outputs
Every matched template emits three context variables:
{node-name}.{image-name}.x: detected X coordinate.{node-name}.{image-name}.y: detected Y coordinate.{node-name}.{image-name}: boolean flag set totrueon success.
For example, a node named find-submit matching submit.png produces:
find-submit.submit.png.x
find-submit.submit.png.y
find-submit.submit.png = trueDownstream MouseMove, MouseClick, or conditional nodes can reference these variables directly to move, click, or branch.
Usage Tips
- Crop templates tightly to reduce background noise during matching.
- Add multiple resolutions/themes to the
imagesarray and order them by priority. - Use
retry = -1when you must wait for UI elements to appear; otherwise specify a finite value to avoid blocking the pipeline. - After a successful match, reference the output inside
conditions.existso later nodes run only when the element is present.
Last updated on: