# General

Below is a description of the settings found under the General tab of the DetectFlaw Property Sheet.

Parameter | Description
Image | This parameter must reference a spreadsheet cell that contains an Image data structure. By default, this parameter references cell A1 . This parameter can also reference other Image data structures, such as those returned by the Image Vision Data Access functions or Coordinate Transforms Functions.
Flaw Model Reference | Specifies a reference to a spreadsheet cell that contains either a valid TrainFlawModel data structure returned by a TrainFlawModel function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications., or a FlexFlawModel data structure returned by a FlexFlawModel function.
Inspection 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 under Edit in the property sheet toolbar to automatically stretch the region to cover the entire image. Note: The Inspection Region parameter must be defined within the bounds of the image; otherwise, the function will return #ERR. The Inspection Region will automatically be fixtured to the same input fixture A fixture is a coordinate location on the image that keeps the tool in the place determined by the fixture. specified in the referenced TrainFlawModel function. If the fixture reference is invalid, the fixture will default to 0,0,0.
X | The X-offset of the origin, in fixture coordinates.
Y | The Y-offset of the origin, in fixture coordinates.
Width | The width of the region.
Height | The height of the region.
Angle | The orientation, in fixture coordinates.
Curve | The angular deviation between the x-axis and the opposing boundary line of the region. The angular deviation between the region's x-axis and the opposing boundary line.
External Inspection Region or Path | Specifies a Cell References to a spreadsheet cell that contains aControls Functions. When this parameter is used, the TrainFlawModel tool ignores the Region and Fixture settings and inspects the image area specified by the referenced region. Note: If this parameter has been set as a reference to an external region or path, to use the function's internal Region, this parameter must be manually set to zero by entering the value 0 in place of the cell reference. Otherwise, the function will continue to reference the external region or path.
Image Resolution | 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. Note: If the Model Reference parameter is referencing a FlexFlawModel data structure returned by a FlexFlawModel function, this parameter will be disabled and the Image Resolution parameter settings of the FlexFlawModel function will be used instead.
1 = Fine (default) | Specifies that full image resolution will be utilized.
2 = Medium | Specifies that half image resolution will be utilized.
3 = Coarse | Specifies that quarter image resolution will be utilized.
Mask Image Controls | Specifies an external reference to a Button to control how the function processes the Mask Image. These references provide the ability to dynamically adjust the mask during run-time to ignore certain flaws.
Add Residual Residuals measure how far inlier points deviate from the fitted geometric model. The root-mean-squared (RMS) residual is the average distance of all inlier points from the model. The maximum residual is the largest distance among the inliers. Smaller residual values indicate a more accurate and less noisy model fit. | Specifies an external event to add the current residual image to the Mask Image.
Default Mask | A reference to a Button control that sets the Mask Image to its initially trained state, by regenerating the mask data from the model Image.
Defect Parameters | Specifies the limits for determining area and/or edge flaws. Area flaws are measured by deviations of the pixel greyscale value, and typically include defects such as blemishes or discolorations. Edge flaws are measured by the presence/absence of edge features, and typically include defects such as scratches, tears or extra features. Note: When applying the DetectFlaw function, if the tolerances for the Defect Parameters are narrow (i.e. ≤ 15 pixels, for instance), and the image encounters minor variations in image noise, the options Ignore Defect and Add Residual may not account for the variations. In these situations, attempt to broaden the tolerances for the Defect Parameters before applying the Ignore Defect or Add Residual options.
Minimum Contrast | Specifies the minimum contrast (1 to 255; default = 25) transition value to be considered as an edge or an area defect.
Normalize | Specifies whether or not the normalization of intensity levels in the residual image will be performed prior to inspecting the region for area defects.
0 = OFF (default) | Specifies that the function will not perform normalization of intensity levels prior to inspecting for area defects.
1 = ON | Specifies that the function will perform normalization of intensity levels prior to inspecting for area defects.
Area Defect Type | Specifies the type of area defects to identify. When enabled, the function will identify blobs of pixels in the residual image that exceed the specified Minimum Contrast and Minimum Area Defect Size values.
0 = None | Disables area defect detection.
1 = Both (default) | The function will identify defects that are caused by pixels in the currently acquired image that are either brighter or darker than those in the trained model.
2 = Light Defects | The function will only identify defects that are caused by pixels in the currently acquired image that are brighter than those in the trained model.
3 = Dark Defects | The function will only identify defects that are caused by pixels in the currently acquired image that are darker than those in the trained model.
Minimum Area Defect Size | Specifies the minimum area defect size (2 to 400000; default = 30), in pixels; an area below this value is not considered a defect.
Edge Defect Type | Specifies the type of edge defects to identify.
0 = None | The function will not identify edge defects.
1 = Both | The function will verify the presence/absence of both Missing Edges and Extra Edges.
2 = Missing Edges (default) | The function will verify that all of the previously trained edges in the model are present in the currently acquired image. Missing edges that exceed the specified Minimum Edge Defect Size value will be classified as a flaw.
3 = Extra Edges | The function will verify that there are not additional edges present in the currently acquired image that were not in the trained model. Extra edges that exceed the specified Minimum Edge Defect Size value will be classified as a flaw.
Minimum Edge Defect Size | Specifies the minimum length (2 to 1000; default = 5) of an edge to classify it as a missing and/or extra edge; detected edges shorter than this setting are not classified as defects.
Draw Edge Markings | Specifies whether or not the function will draw the detected edge marks, in green, on the image. The output markings indicate which pixels align with pixels in the trained Model Image. Pixels in the acquired image which coincide with a trained edge segment in the trained Model Image will be drawn in green. Pixels which fall outside of tolerances and are classified as either edge or area defects are drawn in red, and a red bounding box is placed around them.
0 = OFF (default) | Specifies that the function will not draw the edge marks on the image.
1 = ON | Specifies that the function will draw the edge mark on the image.
Draw Flaw Markings | Specifies whether or not the function will draw the detected flaw marks, in red, on the image. The output markings indicate which pixels align with pixels in the trained Model Image. Pixels in the acquired image which coincide with a trained edge segment in the trained Model Image will be drawn in green. Pixels which fall outside of tolerances and are classified as either edge or area defects are drawn in red, and a red bounding box is placed around them.
0 = OFF (default) | Specifies that the function will not draw the detected flaw marks, in red, on the image.
1 = ON | Specifies that the function will draw the detected flaw marks, in red, on the image.
Display Image | Specifies the type of output the function will generate.
0 = Live Image (default) | The function will generate the currently acquired image as the output image.
1 = Edge Image | The function will generate the edge model from the currently acquired image as the output image. This option is only available if the Edge Defect Type parameter is set to Missing Edges, Extra Edges or Both, or the function is referencing a FlexFlawModel data structure returned by a FlexFlawModel function in the Model Reference parameter.
2 = Model Image | The function will generate the trained model image, after being transformed based on fixture and scale, and, optionally, Flex algorithms.
3 = Mask Image | The function will generate the current mask image, after being transformed based on fixture and scale, and, optionally, Flex algorithms.
4 = Residual Image | The function will generate the residual image based on the flaw detection analysis. Note: If the residual image is being used as an output image, Area Defects parameter must be enabled. Otherwise, edge defects will still be drawn, but the output image will not be generated and an error message will be displayed.
Show | Specifies the display mode for the graphical overlays of the function on top of the image. The output markings indicate which pixels align with pixels in the trained Model Image. Note: When the DetectFlaw property sheet is open, all of the markings will be drawn on the image, if the Draw Edge Markings and Draw Flaw Markings parameters are enabled.
0 = hide all (default) | All graphics are hidden, except when the cell containing the function is highlighted in the spreadsheet.
1 = result graphics only | The enabled markings, defects and input region will be displayed at all times.
2 = show all: input and result graphics | Both the input region, detected defects, and detected edges will be displayed at all times. Note: The Draw Edge Markings and Draw Flaw Markings parameters must be enabled to display the detected defects and edges.