Chapter 2
Getting Measurement-Ready Images
IMAQ Vision for LabWindows/CVI User Manual
2-8
ni.com
Attach Calibration Information
If you want to attach the calibration information of the current setup to
each image you acquire, use
imaqCopyCalibrationInfo()
. This
function takes in a source image containing the calibration information and
a destination image that you want to calibrate. The output image is your
inspection image with the calibration information attached to it. For
detailed information about calibration, refer to Chapter 6,
Note
Because calibration information is part of the image, it is propagated throughout
the processing and analysis of the image. Functions that modify the image size, such as
geometrical transforms, void the calibration information. Use
imaqWriteVisionFile()
to save the image and all of the attached calibration information to a file.
Analyze an Image
After you acquire and display an image, you may want to analyze the
contents of the image for the following reasons:
•
To determine whether the image quality is high enough for your
inspection task.
•
To obtain the values of parameters that you want to use in processing
functions during the inspection process.
The histogram and line profile tools can help you analyze the quality of
your images.
Use
imaqHistogram()
to analyze the overall grayscale distribution in the
image. Use the histogram of the image to analyze two important criteria
that define the quality of an image—saturation and contrast. If your image
is underexposed, or does not have enough light, the majority of your pixels
will have low intensity values, which appear as a concentration of peaks on
the left side of your histogram. If your image is overexposed, or has too
much light, the majority of your pixels will have high intensity values,
which appear as a concentration of peaks on the right side of your
histogram. If your image has an appropriate amount of contrast, your
histogram will have distinct regions of pixel concentrations. Use the
histogram information to decide if the image quality is high enough to
separate objects of interest from the background.