TrainPatMaxPattern
Extracts and trains a pattern from an image for use with the FindPatMaxPatterns function.
TrainPatMaxPattern Overview
A PatMax® pattern is a collection of geometric features where each feature is a point on the boundary between two regions of dissimilar pixel values. TrainPatMaxPattern trains a pattern, then FindPatMaxPatterns is used to locate one or more instances of that pattern in an image. PatMax offers three key features that distinguish it from other pattern-location technologies available in machine vision:
- High-speed location of objects whose appearance is rotated, scaled, and/or stretched
- Location technology that is based on object shape, not on greyscale values
- Very high accuracy
PatMax differs from other pattern-location technologies in that it is not based on pixel grid representations that cannot be efficiently and accurately rotated or scaled. Instead, PatMax uses a feature-based representation that can be transformed quickly and accurately for pattern matching.
TrainPatMaxPattern Inputs
| Parameter | Description | ||||||||||||||||||||
|
Image |
This parameter must reference
a spreadsheet cell that contains an Image data structure. By
default, this parameter references cell |
||||||||||||||||||||
|
Fixture |
Defines the Region of Interest (ROI) relative to a Fixture input or the output of the image coordinate system for the Vision Tools function. Setting the ROI relative to a Fixture ensures that if the Fixture is rotated or translated, the ROI is rotated or translated in relation to the Fixture. Note: 2D projections use real world units but fixturing with 2D tools requires input in pixel values. When using a 2D projection from a 3D point cloud as a Fixture, convert the real world units to pixel values using the TransWorldToPixel function.
The default setting is (0,0,0), the top leftmost corner of the image.
|
||||||||||||||||||||
|
Pattern Region |
Also known as the Region of Interest (ROI), specifies the region of the image that undergoes analysis. Double-click on the Region parameter to create an Interactive Graphics Mode that you can transform and rotate. Select this parameter and press the Maximize Region button on the Job Edit toolbar of the property sheet to automatically stretch the region to cover the entire image.
|
||||||||||||||||||||
|
Note: The Fixture and Region parameters must be defined
within the bounds of the image. Otherwise, the function returns #ERR.
|
|||||||||||||||||||||
|
External Region |
This parameter uses Cell References to an Annulus, Circle, Region, EditAnnulus, EditCircle, EditCompositeRegion, EditPolygon, and EditRegion. When this parameter is used, the function ignores the Region and Fixture settings and inspects the image area specified by referenced region. If an EditCompositeRegion control is referenced, the inspection area can be a mix of shapes. Each shape in the composite region can be assigned as added to or subtracted from (masking) the inspection area. Note: If this parameter has been set as a reference to an external region, to use the internal Region of the function, this parameter must be manually set to zero by entering the value 0 in place of the cell reference. Otherwise, the function continues to reference the external region.
|
||||||||||||||||||||
|
Pattern Origin |
Specifies the X and Y of the training pattern's origin, as offsets from the center of the training region.
|
||||||||||||||||||||
|
Pattern Settings |
Specifies the settings for training the pattern.
|
||||||||||||||||||||
| Train Event |
Specifies Cell References to a cell containing a model training event trigger. Note: Training occurs when either the property sheet is open or when an event trigger such as a button or other conditionally enabled cell is non-zero.
|
||||||||||||||||||||
| Reuse Training Image |
Specifies whether or not the image used to train the pattern is saved and used when modifying the Pattern Settings parameters.
|
||||||||||||||||||||
|
Timeout |
Specifies the amount of time, in milliseconds (0 to 30000), that the function will search for a valid pattern before execution is halted and an #ERR is returned. Setting the value to 0 will disable the setting and a timeout will not be applied. |
||||||||||||||||||||
|
Show |
Specifies the display mode for TrainPatMaxPattern graphics on the image.
|
||||||||||||||||||||
TrainPatMaxPattern Outputs
|
Returns |
A Patterns data structure containing a trained pattern, or #ERR if any of the input parameters are invalid.
|
|||
|
Results |
When TrainPatMaxPattern is initially inserted into a cell, the Trained status will automatically appear in the adjacent cell to the right. If a pattern cannot be trained, then #ERR will be inserted. One Patterns Vision Data Access functions is automatically inserted into the spreadsheet:
Note: While in the function's property sheet, supplemental information strings are provided as suggestions for better training a pattern. Possible information strings include:
To insert information strings into the spreadsheet, use the GetInfoString Vision Data Access function. |