Smoothing object boundaries in grayscale images

NI Vision Builder AI Vision Assistant

Smoothing object boundaries in grayscale images

  1. Click Grayscale»Gray Morphology or select Gray Morphology in the Grayscale tab of the Processing Functions palette.
  2. Select one of the three following morphological functions from the Gray Morphology list:
    • Proper Open—Smoothes boundaries of objects and fills small holes.
    • Proper Close—Smoothes boundaries of objects and removes small particles.
    • Auto Median—Smoothes boundaries of objects.
  3. Set the Size of the Structuring Element.
  4. Click the cells of the structuring element that you want to have a value of 0.
  5. Click OK to apply the morphology and add this step to the script.
Tips  
  • The structuring element is a 2D array used as a binary mask to define the neighborhood of a pixel. You can modify the structuring element by clicking its cells. If a cell is black, it has a value of 1. If a cell is white (empty), it has a value of 0.
  • Experiment with different coefficients and the Kernel Size to get the results you want.

Related Topics

Expanding (dilating) objects in grayscale images

Filling gaps and holes (close) in grayscale images

Filling holes and smoothing right angles

Gray Morphology (Grayscale»Gray Morphology)

Reducing (eroding) objects in grayscale images

Removing small objects (open) from grayscale images

Smoothing an image with filtering

Smoothing object boundaries in binary images