TrainPatMaxPattern
Extracts and trains a pattern from an image for use with the FindPatMaxPatterns function. For more information, see FindPatMaxPatterns.
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.TrainPatMaxPatterntrains 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-locationtechnologies 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
Syntax: TrainPatMaxPattern(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Pattern Region.X,Pattern Region.Y,Pattern Region.High,Pattern Region.Wide,Pattern Region.Angle,Pattern Region.Curve,External Region,Pattern Origin.Offset Row,Pattern Origin.Offset Column,Pattern Settings.Algorithm,Pattern Settings.Elasticity,Pattern Settings.Ignore Polarity,Pattern Settings.Sensitivity,Pattern Settings.Coarse Granularity,Pattern Settings.Fine Granularity,Reuse Training Images,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 Region 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 will be rotated or translated in relation to the Fixture. For more information, see Fixture and Vision Tools. Note: The default setting is (0,0,0), the top leftmost
corner of the image.
|
|||||||||||||||||||||||
Also known as the Region of Interest (ROI), specifies the region of the image that undergoes analysis and creates a rectangular image region that can be transformed and rotated. For more information, see Interactive Graphics Mode. Tip: With this parameter
selected, you can press the Maximize
Region button on the property sheet's toolbar to maximize the region and cover the entire image.
|
|||||||||||||||||||||||
This parameter can reference a spreadsheet cell that contains the following functions:
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:
|
|||||||||||||||||||||||
Specifies the row and column of the training pattern's origin, as offsets from the center of the training region.
|
|||||||||||||||||||||||
Specifies the settings for training the pattern.
|
|||||||||||||||||||||||
Reuse Training Image |
Specifies whether or not the image used to train the pattern is saved and used when modifying the Pattern Settings parameters.
|
||||||||||||||||||||||
Specifies the amount of time, in milliseconds (0 to 30000), that the function searches for a valid pattern 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 TrainPatMaxPatterngraphics on the image.
|
TrainPatMaxPattern Outputs
Returns |
A Patterns data structure containing a trained pattern, or #ERR if any of the input parameters are invalid. The function is Disabled by default to avoid accidentally training a new pattern on the next acquisition. |
When TrainPatMaxPatternis initially inserted into a cell, the Trained status automatically appears in the adjacent cell to the right. If a pattern cannot be trained, #ERR is inserted. Note: While in the function's property sheet, supplemental information strings are provided as suggestions for better training a pattern. For a list of possible information strings, click here.
|
TrainPatMaxPattern Vision Data Access Functions
One Vision Data Access function is automatically inserted into the spreadsheet:
GetTrained(Pattern) |
Returns 1 if a pattern has been successfully trained, and 0 if a pattern cannot be trained. |
For more information, see Patterns, Pattern Match, or Property Sheet.