Chapter 2 Getting Measurement-Ready Images
IMAQ Vision for LabWindows/CVI User Manual 2-4 ni.com
Source and Destination ImagesSome IMAQ Vision functions that modify the contents of an image have
source image and destination image input parameters. The source image
receives the image to process. The destination image receives the
processing results. The destination image can receive either another image
or the original, depending on your goals. If you do not want the contents of
the original image to change, use separate source and destination images.
If you want to replace the original image with the processed image, pass the
same image as both the source and destination.
Depending on the function, the image type of the destination image can be
the same or different than the image type of the source image. The function
descriptions in the IMAQ Vision for LabWindows/CVI Function Reference
include the type of images you can use as image inputs and outputs. IMAQ
Vision resizes the destination image to hold the result if the destination is
not the appropriate size.
The following examples illustrate source and destination images with
imaqTranspose():
•imaqTranspose(myImage, myImage);
This function creates a transposed image using the same image for the
source and destination. The contents of myImage change.
•imaqTranspose(myTransposedImage, myImage);
This function creates a transposed image and stores it in a destination
different from the source. The myImage image remains unchanged,
and myTransposedImage contains the result.
Functions that perform arithmetic or logical operations between two
images have two source images and a destination image. You can perform
an operation between two images and then either store the result in a
separate destination image or in one of the two source images. In the
lattercase, make sure you no longer need the original data in the source
image before storing the result over the data.
The following examples show the possible combinations using
imaqAdd():
•imaqAdd(myResultImage, myImageA, myImageB);
This function adds two source images (myImageA and myImageB) and
stores the result in a third image (myResultImage). Both source
images remain intact after processing.