# DetectFlaw

The DetectFlaw 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. is used to identify flaws by comparing the trained data contained in a either a valid TrainFlawModel data structure returned by a TrainFlawModel function, or a FlexFlawModel data structure returned by a FlexFlawModel function, along with the currently acquired image. The DetectFlaw function is capable of identifying the following three types of flaws: Area Defects, Missing Edge Defects and/or Extra Edge Defects.

Area inspections verify whether or not there are defects such as scratches or stains on the surface of the object/part. Edge inspections verify whether or not there are extra or missing edges, or that the boundary of the object/part is consistent. Combining area and edge defects provides the highest degree of inspection verification.

Tip:

- One or more DetectFlaw functions may be referenced to a single TrainFlawModel function, which allows each DetectFlaw function to inspect different portions of the object/part using different settings, if necessary.
- To reduce the function's execution time, set the function's Image Resolution parameter in the General Tab to Medium or Coarse, which down-samples the image and decreases the function's sensitivity to image noise and very small variations.
- Additional image processing may be performed on the DetectFlaw output image when the Display Image parameter is set in the General Tab to either Edge Image, Model Image, Mask Image or 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. Image. For example, additional blob A blob is a group of pixels on the image that form a distinct pattern, typically used to represent objects, features, or areas of interest in object detection and segmentation tasks. image analysis could be performed by setting an DetectBlobs function's Image parameter to the use the Residual Image of the DetectFlaw function as an input.

## DetectFlaw Outputs

Returns | A DetectFlaw data structure containing the detected flaws, or #ERR if any of the input parameters are invalid. Note: The DetectFlaw data structure may be used as an Image input for other 2D Vision Tools.
Results | When DetectFlaw is initially inserted into a cell, a results table is created in the spreadsheet.