National Instruments IMAQTM 用户手册

下载
页码 121
Chapter 2
Getting Measurement-Ready Images
© National Instruments Corporation
2-11
Use 
CWIMAQVision.GrayMorphology
 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 has the opposite effect of an erosion.
Opening—Removes bright pixels isolated in dark regions and smooths 
boundaries.
Closing—Removes dark pixels isolated in bright regions and smooths 
boundaries.
Proper-opening—Removes bright pixels isolated in dark regions and 
smooths the inner contours of particles.
Proper-closing—Removes dark pixels isolated in bright regions and 
smooths the inner contours of particles.
Auto-median—Generates simpler particles that have fewer details.
FFT
Use the Fast Fourier Transform (FFT) to convert an image into its 
frequency domain. In an image, details and sharp edges are associated 
with mid to high spatial frequencies because they introduce significant 
gray-level variations over short distances. Gradually varying patterns are 
associated with low spatial frequencies.
An image can have extraneous noise, such as periodic stripes, introduced 
during the digitization process. In the frequency domain, the periodic 
pattern is reduced to a limited set of high spatial frequencies. Also, the 
imaging setup may produce non-uniform lighting of the field of view, 
which produces an image with a light drift superimposed on the 
information you want to analyze. In the frequency domain, the light drift 
appears as a limited set of low frequencies around the average intensity of 
the image, which is the DC component. 
You can use algorithms working in the frequency domain to isolate and 
remove these unwanted frequencies from the image. Complete the 
following steps to obtain an image in which the unwanted pattern has 
disappeared but the overall features remain:
1.
Use 
CWIMAQVision.FFT
 to convert an image from the spatial domain 
to the frequency domain. This method computes the FFT of the image 
and results in a complex image representing the frequency information 
of the image.