Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Image/Pixel-Color Operations > Pattern-Search >

Image/Pixel-Color Operations

Pattern Recording

Previous Top Next


Supported Pattern-Sizes

The following Pattern-Sizes are supported:

 

 4x16

 4x32

 4x64

 8x8

 8x16

 8x32

 8x64

 9x9 

 10x10 

 11x11 

 12x12 

 16x8 

 24x8

 32x4 

 32x8 

 32x16

 40x8 

 48x8 

 56x8

 64x6 

 64x8 

 96x4    

 96x8 

 98x6

 128x4

 128x8  

 

 

The "Debug-Flag"

 
The Debug Flag has been constantly enhanced during development. Currently the following Options are supported:

 

1 - Switch Debug Console ON

 

2 - Use "Snap again" during Search. This will update the Snapshot using the Parameters from the last taken Snapshot.

 

4 - Use "X-Ray Search". This will start an enhanced search that is more color-independent and takes much longer time.

    Especially together with Option "64 -Extended Search" it may find a lot more results.
    Using this Option, the most upper Line and the most left Line are ignored.

    Therefore this Option will reduce the effective Pattern-Size by -1 in X- and Y-Direction.

    For example a Pattern that was size "8x8" will be a Pattern size "7x7", this is important when you specify  needed "Pixelhits".

 

8 - If added, this will disable one Layer of "Fuzzy-Logic". This Flag will make the Search more sensitive to small color-differences

 

16 - If used, this Flag will internally invert the Images. Use it preferably with Option "4 - X-Ray Search".

 

32 - If used, this Flag will internally complement the Images. Use it preferably with Option "4 - X-Ray Search".

 

64 - "Extended Search". This search uses longer time, but returns more results. Use it preferably with Option "4 - X-Ray Search"

 

 

 

Use Picture-File as Pattern

 

Generally you can use any picture file for the Pattern-Search commands.

Please be aware that the resolution of the picture in the Image Register must be one of the allowed Pattern Resolutions.

Please use only Picture-File Formats that do compress losseless.

Lossless compression reduces file size without removing any bits of information. These are for example: ".bmp", ".png".

Do not use: ".jpg".

 

For this specify a Filepath/Filename.

$$FIL=?pattern\MyPattern.bmp

LFP.$$FIL

 

Use Inline-Data Pattern

 

You can use Inline Data for the Pattern-Search commands.

Instead of specifying a Filepath/Filename, you just specify

LFP.ID:$$DTA

The term ID: tells the Robot that the following variable contains Inline-Data.

And therefore will only be carefully binary resolved.

 

Use Image-Register as Pattern

 

You can use a Picture that is in teh Image-Register for the the Pattern-Search commands.

Please be aware that the resolution of the picture in the Image Register must be one of the allowed Pattern Resolutions.

Instead of specifying a Filepath/Filename, you just specify

LFP.IR:($$Num+1)

The term IR: tells the Robot that the following variable is numeric and specifies the Image-Register Number to use..

 

 

How to record Patterns

 

When recording a Pattern you should take a few things into account if you want the Pattern to be found faster.

Here are some good and bad examples:

 

Here is a good Pattern

A good Pattern contains contrasted Pixels in the first Line and on the first 5 Pixesl. Such Patterns will be found very fast.

You can test this if you press the "Check Pattern" button in the HE-Recorder.

A good Pattern should be found in less than a second on a good Computer. Even on a 4K Screen.

 

 

PGood   CheckPat1 PGood1

This is a good Pattern that will be found quickly.

 

 

 

   Now lets see a less good Pattern.

 

This Pattern has two Speed-Penalties:

1. Its a large Pattern with 32x16 Points

2. The Top-Lines are all empty

 

Still it will be found in a Second.

Please do not wonder if not all possible Finds are being marked.

Default the number of finds is now limited to 10.

The finds must not be sequential, due to the multi-threading core of the Find-Pattern Engine.

Also the sequence of the Finds is not guaranteed to always be in the same order.

 

 

LGBP2LGP1

This Pattern is not so good as its larger and the Top-Lines all have the same colour.

 

 

 

A Pattern that is just few Lines is also not a very good Pattern.

Also choose the smallest possible Pattern-Size to optimize for Speed.

 

Bader1 Bader2 Bader3

 

 

Bader4

Pattern that do not contain a lot of Information should try to have these in the upper left corner.

 

 

 

And finally this Pattern is a the worst case for the Pattern-Find Engine:

 

NoGoPat

This Pattern is just the Background color.

 

A Pattern that is just a Background Color is not a Pattern and can not easily be matched.

The Pattern-Engine will search and find also this Pattern, but depending on how often the color is available, this may take a while.

 

 

 

 

 

Remarks

-

 

Limitations:

-