Chapter2 GettingMeasurement-Ready Images
IMAQVision for LabWindows/CVI User Manual 2-8 ni.com
Attach Calibration InformationIf you want to attach the calibration information of the current setup to
each imagey ou acquire, useimaqCopyCalibrationInfo().This
functiontakes in a source image containing the cali bration information and
ad estination image that you want to calibrate. The output image is your
inspectionimage with the calibration information attached to it. For
detailed information about calibration, see Chapter 6, Calibration.
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
geometricaltransforms) void the calibration information. Use imaqWriteVisionFile()
to savethe image and all of the attached calibration informat ion to a file.
Analyze an ImageOnce you acquireand 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
inspectiontask.
•Toobtain t he 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.
UseimaqHistogram() to analyze the overall grayscale distribution in the
image. Use the histogram of the image to analyze two important criteria
thatdefine the quality of an imag e—saturation and contrast. If your image
is underexposed(do es not haveenough light) the majority o f your pixels
willhave low intensity values, which appear as a concentration of peaks on
theleft side of your histogram. If your image is overexposed (has too much
light) the majority of your pixels will have ahi gh intensity values, which
appearas aco ncentration of peaks on the right side of your histogram. If
yourimage has an appropriate amount of contrast, your histogram will have
distinct regionso f pixelconcentrations. Use th eh istogram information to
decide if the image quality is high enough to separate objects of interest
from the background.
Ifthe image quality meets your needs, use the histogram to determine the
rangeo fpixel values that correspond to objects in the image. You can use