Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Exists on screen action Version 9 (Python)

Группа действий: Машинное зрение

Описание

Данное действие предназначено для проверки (в течение заданного времени) существования на экране изображений схожих с образцом.

Иконка действия

Image Removed

Параметры действия

Входные параметры

Action group: Vision

...

Description

This action is intended to check (for a specified time) the existence of images similar to the sample on the screen.

Action icon

Image Added

Action parameters

Input parameters

Sample image - The path to the sample image file. Supported image formatsИзображение с образцом          Путь к файлу с изображением образца. Поддерживаемые форматы изображений: (jpeg, jpg, bmp, png, tif, tiff). 

Степень сходства                         Коэффициент сходства между образцом и искомой областью. Максимальное значение равно «1». 

Similarity rate - The similarity coefficient between the sample and the searched area. The maximum value is "1". 

Timeout, ms - Time during which the specified object will be expected to appear. Timeout is set in milliseconds. Type Таймаут, мс                                  Время, в течении которого будет ожидаться появление заданного объекта. Тайм-аут задаётся в миллисекундах. Тип - Robin.Numeric. 

Выходные параметры

Результат  Возвращает «true», если шаблонное изображение найдено на экране иначе «false».

Настройки

...

Путь к изображению для распознавания.

Допустимые расширения: ".jpeg", ".jpg", ".bmp", ".png", ".tif", ".tiff"

Если алгоритм не нашел расширение файла или тип файла неприменим, будет выведено предупреждение.

Output parameters

Result - Returns "true" if the template image is found on the screen otherwise "false".

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Sample imagePath to sample image file. Supported image formats: (jpeg, jpg, bmp, png, tif, tiff)Robin.ImageC:\doc\img.pngYes
Similarity rateCoefficient of similarity between the sample image and the target area. The maximum value is «1».Robin.Numeric
Yes
Timeout (ms)The time during which the appearance of the specified object will be expected. Time-out is set in millisecondsRobin.Numeric
No
Results
ResultReturns «true» if the sample image is found on the screen otherwise «false»Robin.Booleantrue

Special conditions of use

The search image resolution and the screen resolution must match for the action to work correctly.  For this purpose it is recommended to make a screenshot of the image.

If the result is "false" and the object is present on the screen, it means that it is necessary to specify the similarity rate with the search image.

The most effective way to use files with the extension ".png"

Example of use

Task

It is necessary to determine whether an image exists on the screen and display a dialog box with a message: image found on the screen or image not found on the screen. 

Image Added

Solution

Use the actions "Exists on screen action", "If", "Show message". 

Implementation

  1. Assemble a robot scheme consisting of actions: 
    Image Added

  2. Set the parameters of the "Exists on screen action" action. 
    Image Added

  3. Set the "If" action parameter. 
    Image Added

  4. Customize "Show message" action parameters for true and false branches. 
    Image Added
    Image Added

  5. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. Image Added

The image is found on the screen. The corresponding dialog box is displayed

...

Изображение

...

Необходимый коэффициент сходства между изображением и искомой областью.

Максимальное значение равно "1" .

...

Число

...

Время, в течении которого будет осуществляться поиск заданного объекта.

Задается в мс.

...

Переменная, в которую будет сохранен результат проверки.

  • "True", если объект существует.
  • "False", если объект не существует или не был найден.

...

Особые условия использования

Разрешение изображения для поиска и разрешение экрана должно совпадать для корректности отработки действия.  Для этого рекомендуется делать скриншот изображения.

Если результат "false", а объект на экране присутствует, значит есть необходимость уточнить степень сходства с изображением для поиска.

Наиболее эффективно применение файлов с расширением ".png"

Пример использования 

Задача

Необходимо определить существует ли на экране изображение и вывести диалоговое окно с сообщением: изображение найдено на экране или изображение не найдено на экране. 

Image Removed

Решение

Воспользоваться действиями "Существует на экране", "Если", "Сообщение". 

Реализация

...

Результат

Программный робот отработал успешно. 

Image Removed

Изображение найдено на экране. Отображено соответствующее диалоговое окно