# Run Params

Use the Run Params tab to specify how to perform the pattern search.

Configure the following parameters:

Parameter | Description
--- | ---
Number to Find | You should set this value to the maximum number of pattern instances that you ever expect to find in your input image. If the Return All Results parameter is false, the number of results returned by the PatMax RedLine tool will always be less than or equal to the value you specify. If Return All Results is true, you might get additional results.
Accept Threshold | Only instances of the pattern that receive scores greater than or equal to this threshold are accepted. Valid range is from zero to one. You should supply an acceptance threshold that is lower than the lowest score you ever expect to receive from a valid instance of your pattern.
Contrast Fraction Threshold | Only instances of the pattern that have a contrast fraction greater than or equal to this threshold are accepted. Valid range is from zero to one. It is computed by dividing the average contrast of the matching image features by the average contrast of the trained pattern features. If this ratio exceeds one, it is reported as exactly one. You can discard results with very low contrast (relative to the pattern) by setting the Contrast Fraction Threshold. You should supply a non-zero value that is lower than the lowest contrast fraction you ever expect to receive from a true instance of your pattern.
Accuracy Mode | The PatMax RedLine tool may run faster if your application can tolerate lower accuracy. The accuracy of a result pose (including its position, rotation, and scale) is highly dependent upon the quality of the trained pattern and the contents of the runtime image. For most applications the Standard accuracy mode gives a good trade-off between accuracy and speed. If you desire more accuracy and are willing to sacrifice some speed, you can use the Accurate mode. If you desire more speed and are willing to sacrifice some accuracy, you can use the Fast mode. Fast mode is especially useful if you are searching for multiple pattern instances and only want to know how many were found.
Coarse Accept Threshold Fraction | Sets the fraction of the accept threshold that should be used to evaluate candidate scores during the coarse phase of the PatMax RedLine tool's run time. The PatMax RedLine tool first finds candidate patterns at coarse granularity. High-scoring coarse results are then refined at fine granularity. A coarse result is considered "high-scoring" if its score exceeds an internally-computed coarse accept threshold. By default, the PatMax RedLine tool determines the coarse accept threshold automatically. In exceptional cases you may need to override the automatic computation. You can override the automatic computation by setting Coarse Accept Threshold Fraction Enabled to true. The coarse accept threshold will then be computed by multiplying together the coarse accept threshold fraction, specified by this value, and the Accept Threshold.
Return All Results | Sets whether the PatMax RedLine tool should return only the results that you asked for or it should also return results that are similar. If the PatMax RedLine tool fails to return all of the results that you expect, it may be useful to set this property to true. This allows the PatMax RedLine tool to return additional results that are similar to the ones you asked for. Additional results will not always be present, but if they are present you can inspect them to see if the PatMax RedLine tool is finding your desired result and then excluding it from the final set of results because it fails to meet one of the acceptance conditions. You can then adjust the relevant acceptance condition so that the desired result is returned.
Ignore Polarity | Sets whether to ignore the polarity of edge features when searching for patterns. If true, the polarity of the pattern features is ignored. If false, only patterns whose polarity matches the trained pattern will be found. The polarity of a feature indicates whether the edge describes a light-to-dark transition in the image or a dark-to-light transition. You should ignore polarity if instances of your pattern may have edge features whose polarity is the opposite of the trained ones. In this case your pattern should receive approximately the same score regardless of whether some, all, or none of the features have opposite polarity.
Score Using Clutter | Sets whether the PMRedLine tool should reduce the score of results that contain extraneous features at the found image location. Extraneous features are known as clutter. They appear in the run-time image at locations which should be empty. A pattern's score is reduced as the amount of clutter increases, but the score will never go negative. A clutter measurement is computed, and reported in each result, only if ScoreUsingClutter is set to true. Otherwise, each result reports a clutter value of -1. The clutter value is a ratio. It is computed by dividing the number of clutter features at the found location by the number of features in the trained pattern. This ratio can be larger than one. Clutter features are extra features that appear in the run-time image at locations which should be empty. The corresponding area of the train image is called "empty" when: it lies within the train region, it contains no features, and it is not masked as "Don't Care".
Timeout | Sets the maximum execution time (in milliseconds) allowed for a PatMax RedLine tool to run. This value only applies if Timeout is set to true.
Zone Angle | Specifies the angle of rotation that is allowable when the PatMax RedLine tool performs a pattern search. You can specify a nominal value that the PMRedLine results must match exactly or you can click: To specify a range of values .
Zone Scale | Specifies the scale value that is allowable when the PatMax RedLine tool performs a pattern search. You can specify a nominal value that the PatMax RedLine results must match exactly or you can click: To specify a range of values.
XY Overlap | Two result candidates are said to overlap in area if the fraction of their area that overlaps is greater than this threshold value. The valid range of the threshold is from zero to one. The tool discards the weaker pattern instance when two pattern instances overlap for all degrees of freedom (DOF) as well as area.