Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Image/Pixel-Color Operations

GFP. - Get Find Parameter

Previous Top Next


MiniRobotLanguage (MRL)

 

GFP. Get Find Pattern Parameter

Read internal Parameters for the Find Pattern Commands

 

 

Intention

 

This command helps to manage the Standard-Parameters for the Find-Pattern Commands.

To have the Find-Pattern Commands use only 3 Parameters, all less important Parameters can be set using the SFP.-Command.

The GFP-Command will help you to read these additional Parameters and several more Parameters that are set by the System.

 

Such Parameters are for example the Color-Tolerance and the number of "needed Pixel-Hits".

Hereby Pixel-Hits are the number of Pixels that do match the Pattern using the given Color-Tolerance.

 

 

Use SFP. and GFP. to set and Read the default Parameters

 

' Set and Read the value of "MaxResults"

SFP.mr|12

GFP.mr|$$RES

MBX.$$RES

ENR.

 

' Set the maximum Number of used CPU-Cores to 8

SFP.CPU|8

GFP.CPU|$$RES

MBX.$$RES

 

 

Explanation for the Parameter-Names:

 

"MaxResults" or "Mr"

This will tell the Pattern-Engine to stop searching for more results after this number of results has been found.

 

"PixelHits" or "Ph"

This number will tell the Engine how many Pixels from the Target must match the Source Pattern (taking the Color-Tolerance into account)

so that the Location is been marked as a "Hit". This Parameter must be set depending on the Pattern Size. If you leave it at "0" a default, calculated value is taken (85%).

 

"ColorTolerance" or "Ct"

This number will define the Color-Tolerance that the Pattern-Search Engine applies to each Pixel before marking it as "valid" or "Invalid".

The higher this value, the more possible results can be found.

 

"DebugMode" or "db"

This number can only be 0 or 1. If set to one, after there have been results found, a Console Window will appear and list all the found results together with some technical informations, like the "Pixelhits" that have matched for the Find. Using the Debugmode you can find the best values for Tolerance and Pixelhits by looking over the results. If nothing is found, possibly no Console Window will appear.

 

"CPU"

Number of CPU-Cores in the System. If change this, the Subprogrammes may use less CPU-Cores and work possibly slower. If you set it too high (Higher then the real number of available CPU-Cores)  then the System may become overloaded and get unresponsible. Best leave at the default value that is calculated when the Robot starts.

 

"Snap_Border" or "sb"

This can be set to 0, 1 or 2 and will influence the Bordersize that is taken when Snapshoting a Window.

"0" - Client-Area only

"1" - Whole Window

"2" - Whole WIndow without Border

It depends on the Target which is the best setting.

 

XSize, YSize

This gives you the X- and Y-Resolution of the last Snapshot, using any of the Pattern-Commands that do Snapshot a Window. Including ANA.Snap.

There are no know use cases where you would like to change these numbers. Doing so may have unforeseeable Side-Effects on some commands.

 

 

 

 

 

Syntax

 

GFP.P1[|P2]

 

Parameter Explanation

 

P1 - Parameter-Name this is the Name of the Parameter that is going to be changed. Please note that some Parameters-Names refer to "read-only" Parameters that can not be changed or may result in strange side-effects if you change them.

 

MaxResults

PixelHits

ColorTolerance

DebugMode

HWnd

Use_First

Snap_Border

CPU

 

Then there are several "Read Only" Parameter-Names

LastSnap (RO)

XSize (RO)

YSize (RO)

Result (RO)

 

 

  P2 -  opt. Variable The variable will return the value that is stored inside the given Parameter. If omitted TOS is used for the result.

 

 

Example

-

 

 

Remarks

-

 

Limitations:

The values are not checked for validity. Specifying nonsense values may have unforeseeable side-effects.

 

 

See also: