Chapter 2
Getting Measurement-Ready Images
©
National Instruments Corporation
2-9
IMAQ Vision for Visual Basic User Manual
Improve an Image
Using the information you gathered from analyzing the image, you may
want to improve the quality of the image for inspection. You can improve
the image with lookup tables, filters, grayscale morphology, and Fast
Fourier transforms (FFT).
Lookup Tables
Apply
lookup table
(LUT) transformations to highlight image details in
areas containing significant information at the expense of other areas.
A LUT transformation converts input grayscale values in the source image
into other grayscale values in the transformed image. IMAQ Vision
provides four methods that directly or indirectly apply lookup tables to
images:
•
CWIMAQVision.MathLookup
—Converts the pixel values of an
image by replacing them with values from a predefined lookup table.
IMAQ Vision has seven predefined lookup tables based on
mathematical transformations. For more information about these
lookup tables, refer to Chapter 5,
Image Processing
, in the
IMAQ
Vision Concepts Manual
.
•
CWIMAQVision.UserLookup
—Converts the pixel values of an
image by replacing them with values from a user-defined lookup table.
•
CWIMAQVision.Equalize2
—Distributes the grayscale values
evenly within a given grayscale range. Use this method to increase the
contrast in images containing few grayscale values.
•
CWIMAQVision.Inverse
—Inverts the pixel intensities of an image
to compute the negative of the image. For example, use this method
before applying an automatic threshold to the image if the background
pixels are brighter than the object pixels.
Filters
Filter the image when you need to improve the sharpness of transitions in
the image or increase the overall signal-to-noise ratio of the image. You can
choose either a lowpass or highpass filter, depending on your needs.
Lowpass filters remove insignificant details by smoothing the image,
removing sharp details, and smoothing the edges between the objects
and the background. You can use
CWIMAQVision.LowPass
or define
your own lowpass filter with
CWIMAQVision.Convolute
or
CWIMAQVision.NthOrder
.