Chapter 2
Getting Measurement-Ready Images
©
National Instruments Corporation
2-11
IMAQ Vision for LabWindows/CVI User Manual
Convolution Filter
The
imaqConvolve()
function allows you to use a predefined set of
lowpass and highpass filters. Each filter is defined by a kernel of
coefficients. Use
imaqGetKernel()
to retrieve predefined kernels. If the
predefined kernels do not meet your needs, define your own custom filter
using a 2D array of floating point numbers.
Nth Order Filter
The
imaqNthOrderFilter()
function allows you to define a lowpass or
highpass filter depending on the value of
N
that you choose. One specific
Nth order filter, the median filter, removes speckle noise, which appears as
small black and white dots. Use
imaqMedianFilter()
to apply a median
filter. For more information about Nth order filters, refer to Chapter 5,
Image Processing
, of the
IMAQ Vision Concepts Manual
.
Grayscale Morphology
Perform grayscale morphology when you want to filter grayscale
features of an image. Grayscale morphology helps you remove or
enhance isolated features, such as bright pixels on a dark background.
Use these transformations on a grayscale image to enhance non-distinct
features before thresholding the image in preparation for particle analysis.
Grayscale morphological transformations compare a pixel to those pixels
surrounding it. The transformation keeps the smallest pixel values when
performing an erosion or keeps the largest pixel values when performing
a dilation.
Refer to Chapter 5,
Image Processing
, of the
IMAQ Vision Concepts
Manual
for more information about grayscale morphology
transformations.
Use
imaqGrayMorphology()
to perform one of the following seven
transformations:
•
Erosion—Reduces the brightness of pixels that are surrounded by
neighbors with a lower intensity.
•
Dilation—Increases the brightness of pixels surrounded by neighbors
with a higher intensity. A dilation produces the opposite effect of an
erosion.
•
Opening—Removes bright pixels isolated in dark regions and smooths
boundaries.