The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "IMAGESEARCH"
Line 14: | Line 14: | ||
=== Parameters === | === Parameters === | ||
+ | *POS | ||
+ | *:Find the n-th image. Same as the POS attribute in [[TAG]] | ||
*IMAGE | *IMAGE | ||
*:The path to the image to be searched. | *:The path to the image to be searched. | ||
*CONFIDENCE | *CONFIDENCE | ||
*:The confidence level, i.e. level of similarity between the input and the remote picture. Must between 1 and 100. | *:The confidence level, i.e. level of similarity between the input and the remote picture. Must between 1 and 100. | ||
+ | *ALGORITHM | ||
+ | *:Optional parameter to select the image recognition algorithm. "A" stands for a new, general purpose algorithm with is optimized for web pages. "B" uses a classic algorithm based on edge detection. For typical websites we recommend to use A. Method B will be useful if your website or image changes color, as method B is color-blind (it looks at the shapes). | ||
The time used by the IMAGESEARCH command is added to the measured response time. | The time used by the IMAGESEARCH command is added to the measured response time. |
Revision as of 19:40, 11 February 2009
Searches for the the input image specified via the IMAGE attribute. The input image is searched on the currently displayed website using image recognition algorithms. CONFIDENCE specifies how closely the found image must match the input image. A value of 100 means exact match. If the input image is not found at the given confidence level an error occurs.
If the image is found then !IMAGEX and !IMAGEY hold the coordinates of where it was found.
Syntax
IMAGESEARCH IMAGE=image_file CONFIDENCE=n
Since iMacros V6.30
IMAGESEARCH POS=x IMAGE=image_file CONFIDENCE=n [ALORITHM=A/B]
Parameters
- POS
- Find the n-th image. Same as the POS attribute in TAG
- IMAGE
- The path to the image to be searched.
- CONFIDENCE
- The confidence level, i.e. level of similarity between the input and the remote picture. Must between 1 and 100.
- ALGORITHM
- Optional parameter to select the image recognition algorithm. "A" stands for a new, general purpose algorithm with is optimized for web pages. "B" uses a classic algorithm based on edge detection. For typical websites we recommend to use A. Method B will be useful if your website or image changes color, as method B is color-blind (it looks at the shapes).
The time used by the IMAGESEARCH command is added to the measured response time. If you use a CONFIDENCE value below 100 than the image recognition search can take a few seconds (depending on your PC and the size of the image you look for). The smaller the searched image the faster is the search.
If speed is critical we recommend to use CONFIDENCE=100. In this case only a very fast binary comparison is done. When the image does not change size or color, the binary comparison can be used.
FAQ:
Q: Is it possible to set the folder that the IMAGESEARCH command uses to load images from? It seems to default to: C:\Users\Public\Documents\iMacros\datasources\
A: There are two options
- Change the default datasource folder
- Or, use the specific path directly in the command, e. g. IMAGESEARCH IMAGE=d:\testimages\image1.bmp CONFIDENCE=100
Examples
Example macro: Demo-ImageRecognition