FindPatterns
FindPatterns consists of two functions: one function extracts area or edge-based patterns or models, while the second function searches an image for a previously trained model.
Whether the function is training or finding, its execution depends on which of the parameters are forcing the update. Updating any of the model parameters causes the model to be returned. Updating the Image, the Fixture, the Find Region, or any of the search parameters causes the f unction to execute a search.
FindPatterns Inputs
Syntax: FindPatterns(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Model Region.X,Model Region.Y,Model Region.High,Model Region.Wide,Model Region.Angle,Model Settings.Model Type,Model Settings.Coarseness,Model Settings.Accuracy,Model Settings.Offset Row,Model Settings.Offset Column,Model Settings.ForceTrain,Model Settings.Patterns,Find Region.X,Find Region.Y,Find Region.High,Find Region.Wide,Find Region.Angle,Number to Find,Angle Range,Scale Tolerance,Thresh: Accept,Thresh: Confuse,Timeout,Show)
Parameter | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies a reference to a spreadsheet cell that contains an Image data structure; by default, this parameter references A0, the cell containing the AcquireImage Image data structure. This parameter can also reference other Image data structures, such as those returned by the Vision Tool Image functions or Coordinate Transforms Functions. |
|||||||||||||||||||||||||||||||
Defines the Model and Find Regions of Interest (ROI)relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the ROI relative to a Fixture ensures that if the Fixture is rotated or translated, the ROI are rotated or translated in relation to the Fixture. For more information, see ROI, Fixture, or Vision Tools Functions. The default setting is (0,0,0), the top leftmost corner of the image.
|
|||||||||||||||||||||||||||||||
Specifies the rectangular image region that are used to extract the model pattern. For more information, see Interactive Graphics Mode.
|
|||||||||||||||||||||||||||||||
Specifies model training parameters.
|
|||||||||||||||||||||||||||||||
Specifies the region of the image that is used to define where the search for the pattern is performed. A rectangular image region is created, that can be transformed and rotated. With this parameter selected, optionally press the Maximize Region button on the property sheet's toolbar to automatically stretch the region to cover the entire image.
|
|||||||||||||||||||||||||||||||
Specifies the maximum number of pattern matches to return (0 to 255; default = 1). Note: Although the maximum number of patterns that can be returned is 255, when the Model Settings parameter is set to Edge model, other settings, especially Coarseness, Accuracy and Scale Tolerance, can drastically reduce the number of patterns returned. If more patterns need to be found, it is recommended to use the FindPatMaxPatterns function. For more information, see FindPatMaxPatterns.
|
|||||||||||||||||||||||||||||||
Specifies the function's +/- tolerance to pattern rotation (0 to 180; default =15). The function still finds patterns that are outside of the specified range, but the accuracy may be somewhat compromised. An Angle Range setting greater than 0 reduces the speed at which patterns are located. |
|||||||||||||||||||||||||||||||
Specifies the function's tolerance to changes in pattern scale.
|
|||||||||||||||||||||||||||||||
Specifies the minimum acceptable pattern response score (0 to 100; default = 50). The function returns the Number to Find pattern responses that exceed the Thresh: Accept limit. |
|||||||||||||||||||||||||||||||
Specifies the maximum expected pattern response score (0 to 100; default = 70)for a pattern in the image that is not a true instance of the model. Setting this search parameter helps the function know which pattern responses to investigate and which can be safely ignored. This parameter is also known as a confusion threshold. |
|||||||||||||||||||||||||||||||
Specifies the amount of time, in milliseconds (0 to 30000; default = 5000), that the function searches for patterns before execution is halted and #ERR is returned. Setting the value to 0 disables the setting and a timeout is not applied. |
|||||||||||||||||||||||||||||||
Specifies the display mode for FindPatterns graphics on the image.
|
FindPatterns Outputs
Returns |
A Patterns data structure containing a model and a list of pattern responses sorted by score, or #ERR if any of the input parameters are invalid. |
Results |
When FindPatterns is initially inserted into a cell, a result table is created in the spreadsheet. |
FindPatterns Vision Data Access Functions
The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table. For more information, see Patterns.
Row |
GetRow(Patterns, Index) |
The row coordinate of the pattern position. |
Col |
GetCol(Patterns, Index) |
The column coordinate of the pattern position. |
Angle |
GetAngle(Patterns, Index) |
The orientation of the pattern position. |
Scale |
GetScale(Patterns, Index) |
The size of the pattern found compared to the trained model, as a percentage of the model size. |
Score |
GetScore(Patterns, Index) |
The pattern response score. |