Free cookie consent management tool by TermsFeed
 Try our pilot Ask AI feature to get answers from both Docs and the Community Knowledge Base, then share your feedback

Image Recognition Best Practices

Overview

Use these best practices to implement reliable image recognition in your robotic tasks. Following these guidelines helps you create maintainable automation that performs consistently across environments.

When to use image recognition

Use image recognition only when other actions like Browser Actions or Windows Automation Actions can't access UI elements. This typically occurs in Citrix environments or legacy applications without accessible UI elements.

Image preparation

Prepare high-quality images to ensure reliable recognition and optimal performance.

Capture guidelines

When capturing images:

  • Capture only what you need to uniquely identify the element.
  • Don't include window frames or unnecessary UI elements.
  • Focus on text, icons, or distinctive visual markers.
  • Avoid extra white space, especially in the top left corner.
  • Ensure the target image is fully visible on screen during capture.
  • Verify only one matching image exists on the screen when capturing.
  • Try different crop sizes to optimize performance.
  • Use PNG format for better matching accuracy.

Selection criteria

When selecting target images:

  • Choose unique visual elements that are unlikely to change.
  • Avoid images with dynamic content like timestamps or counters.
  • Select images with distinct visual boundaries and contrast.

Configuration best practices

Optimize action settings to balance accuracy, performance, and reliability.

Search areas

To improve search performance:

  • Define specific search regions when possible.
  • Use Screen Region instead of Full Screen.
  • Define the smallest practical search area.
  • Use From Y position for vertically scrolling content.

Tolerance settings

To configure tolerance effectively:

  • Start with default color and pixel tolerance settings.
  • Adjust only if needed—higher tolerance values reduce performance.
  • Test tolerance settings across different environments.
  • Balance accuracy with flexibility for your use case.

Wait times

To set appropriate timing:

  • Set timeouts of 3-5 seconds for most cases.
  • Remember: actions complete immediately when the image is found.
  • Use shorter wait times for static elements.
  • Consider network latency and application response times.

Resolution consistency

To maintain consistent performance:

  • Ensure capture and runtime resolutions are equal.
  • Account for different display scaling settings across environments.

Performance optimization

Implement strategies to maximize execution speed and minimize resource usage.

Search strategy

To optimize search performance:

  • Search for one image at a time when possible.
  • Order multiple images by likelihood of appearance.
  • Use specific images rather than generic ones.

Error handling

To build robust error handling:

  • Configure appropriate exception handling.
  • Implement fallback strategies for critical workflows.
  • Log image recognition failures for troubleshooting.

Maintenance and testing

Establish processes to ensure long-term reliability and cross-environment compatibility.

Version control

To manage images systematically:

  • Store support images in version control.
  • Document image capture conditions and environment.
  • Update images when UI changes occur.

Cross-environment testing

To ensure compatibility across environments:

  • Test image recognition across different screen resolutions.
  • Validate performance on various operating systems.
  • Verify resolution consistency between capture and runtime environments.

Troubleshooting common issues

Resolve typical problems that occur during image recognition implementation.

False positives

To address incorrect matches:

  • Reduce tolerance values if you get incorrect matches.
  • Use more specific image selections.
  • Implement additional validation steps.

Performance issues

To improve slow recognition:

  • Reduce search areas.
  • Lower tolerance values.
  • Use smaller, more focused images.

Feedback