FlexFlawModel
The FlexFlawModel function is used to construct optional Flex algorithms, which help compensate for acceptable process variations in the TrainFlawModel function, allowing the DetectFlaw function to better classify flaws. For more information, see DetectFlaw. The FlexFlawModel function measures the displacement within the TrainFlawModel or Mask function's Region, by comparing the trained Edge Model against the Edge Model in the currently acquired image. For more information, see TrainFlawModel or Mask.
FlexFlawModel Overview
The FlexFlawModel function operates within the ROI specified by the referenced TrainFlawModel function. During inspection, the function will translate, rotate and scale the trained Edge Model to the current location and orientation of the part, based on the fixture and scale values in the referenced TrainFlawModel function. The FlexFlawModel function will then extract the edges within the ROI, at the specified Image Resolution value. These extracted edges will be compared against the trained Edge Model. The function then calculates an initial Match Score, and if this first score is too low, the function will return #ERR. Provided the Match Score is high enough, the function executes the Flex algorithm, based on the Flex Recipe values. Afterward, the function calculates a final Flex Score.
Building the Flex algorithms, by adjusting the Flex Parameters, allows the model to "stretch" to compensate for acceptable variations that would otherwise be classified as flaws. This stretching also helps the model more closely resemble the part in the currently acquired image. Flex may be applied to align the part prior to running the DetectFlaw function to reduce false rejects.
The Flex algorithms help compensate for the following:
- Positional errors, such as slight movements from image to image.
- Lens or perspective distortion.
- Acceptable part variations, such as slight differences in shape or surface values.
- Pixel lengthening, such as that associated with line scan images.
- The part's scale changes in the image.
FlexFlawModel Inputs
Syntax: FlexFlawModel(TrainFlawModel,Image Resolution,Minimum Edge Strength,Minimum Match Score,Flex Parameters.Flex Recipe,Flex Parameters.Flex Grid Size,Flex Parameters.Allow Enclosed Segment Flex,Flex Parameters.Enclosed Segment Flex,Flex Parameters.Allow Line Segment Flex,Flex Parameters.Line Segment Flex,Flex Parameters.Line Segment Maximum Line Size,Flex Parameters.Allow Pixel Flex,Flex Parameters.Pixel Flex,Draw Options,Display Image,Show)
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies a reference to a spreadsheet cell that contains a valid TrainFlawModel data structure returned by a TrainFlawModel function. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies an image processing resolution for the function, which allows the function to down-sample the inspection image. This parameter specifies the resolution used to perform flaw detection, as well as the resolution of the output image and markings on the image. Tip: Use the Medium or Coarse settings to reduce the execution time of the function, or to decrease the function's sensitivity to image noise and very small variations.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the minimum required greyscale intensity transition (5 to 255; default = 20) to extract edge features from the image. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the initial minimum match score (10 to 100; default = 30) to initiate the use of the Flex Parameters. If the initial match score is less than this value, then the Flex Parameters will not process and the function will result in #ERR. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the limits to the flex type and the amount of flex which can be tolerated.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies which results the function will draw on the image.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the type of output image the function will generate.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the display mode for FlexFlawModel graphical overlays on top of the image. Pixels that match those in the trained model will be colored green; pixels that do not match will be colored yellow; pixels that are missing from the Mask Image will be colored blue; extra pixels in the Mask Image will be colored dark magenta; extra edge defects will be colored magenta; and missing edge and area defect pixels will be colored in red.
|
FlexFlawModel Outputs
Returns |
A FlexFlawModel data structure containing the Flex algorithm modified model data, or #ERR if any of the input parameters are invalid. |
Results |
When FlexFlawModel is initially inserted into a cell, to the right of the data structure, two cells are automatically populated with Vision Data Access functions: GetMatchScore and GetFlexScore. GetMatchScore returns a value indicating the edge match score prior to the Flex algorithm being applied, and GetFlexScore returns a value indicating the edge score after the Flex algorithm has been applied. For more information, see Flaw Detection. |