Chapter 2
Getting Measurement-Ready Images
©
National Instruments Corporation
2-5
IMAQ Vision for LabWindows/CVI User Manual
•
imaqAdd(myImageA,
myImageA,
myImageB);
This function adds two source images and stores the result in the first
source image.
•
imaqAdd(myImageB,
myImageA,
myImageB);
This function adds two source images and stores the result in the
second source image.
Most operations between two images require that the images have the
same type and size. However, some arithmetic operations can work
between two different types of images, such as 8-bit and 16-bit images.
Some functions perform operations that populate an image. Examples of
this type of operation include reading a file, acquiring an image from an
IMAQ device, or transforming a 2D array into an image. This type of
function can modify the size of an image.
Some functions take an additional
mask
parameter. The presence of this
parameter indicates that the processing or analysis is dependent on the
contents of another image, the image mask.
Note
The image mask must be an 8-bit image.
If you want to apply a processing or analysis function to the entire image,
pass NULL for the image mask. Passing the same image to both the source
image and image mask also gives the same effect as passing NULL for the
image mask, except in this case the source image must be an 8-bit image.
Acquire or Read an Image
After you create an image reference, you can acquire an image into your
imaging system in three ways. You can acquire an image with a camera
through your IMAQ device, load an image from a file stored on your
computer, or convert data stored in a 2D array to an image. Functions that
acquire images, load images from file, or convert data from a 2D array to
an image automatically allocate the memory space required to
accommodate the image data.