Setting Up the Surface Flaw Defect Detection Tool Mask

Once the Surface Flaw Defect Detection Tool has been added, an internal mask may be created to highlight areas for inspection, while excluding other areas.

  1. Go to the Mask tab and check the Enable Mask checkbox to turn on the mask.
  2. Determine how the mask will be generated: the largest segment or edges. By default, edges are used (the Mask Method parameter is set to Edge Mask by default) to generate an image mask based on edge magnitude. With this image mask, only edge pixels are masked, and all other pixels are to be shown. If choosing largest segment, the feature area to be inspected should become the largest segment, thus excluding the background from being inspected.
  3. Set the Mask Display Image parameter to the type of mask you want to generate to help highlight the features of the mask by displaying the indexed and color-coded segments.
  4. Begin by adjusting the Mask Smoothing Factor parameter to ensure that the edges in the image are being properly highlighted.
  5. Next, adjust the Maximum Small Hole Fill Size, Median Kernel Size and Erode Mask Count parameters. These can be used to fill holes, smooth borders and/or remove narrow strips in the image mask, respectively. If Edge Mask is selected, the Maximum Small Hole Fill Size parameter should be set to 0.
  6. Once the mask is correctly highlighting the desired features while excluding others, press the Train button to set the mask.
Note: All parameter changes, except the region, will update the mask and force it to be re-trained. If the region is moved or re-sized, the Train button must be pushed to update the mask accordingly.