Chapter 2
Getting Measurement-Ready Images
IMAQ Vision for LabWindows/CVI User Manual
2-6
ni.com
Acquiring an Image
Use one of the following methods to acquire images with a National
Instruments image acquisition (IMAQ) device:
•
Acquire a single image using
imaqEasyAcquire()
. When you call
this function, it initializes the IMAQ device and acquires the next
incoming video frame. Use this function for low-speed single capture
applications where ease of programming is essential.
•
Acquire a single image using
imaqSnap()
. When you call this
function, it acquires the next incoming video frame on an IMAQ
device you have already initialized using
imgInterfaceOpen()
and
i
mgSessionOpen()
. Use this function for high-speed single capture
applications.
•
Acquire images continually through a grab acquisition. Grab functions
perform high-speed acquisitions that loop continually on one buffer.
Use
imaqSetupGrab()
to start the acquisition. Use
imaqGrab()
to
return a copy of the current image. Use
imaqStopAcquisition()
to
stop the acquisition.
•
Acquire a fixed number of images using a sequence acquisition. Set up
the acquisition using
imaqSetupSequence()
. Use
imaqStartAcquisition()
to acquire the number of images you
requested during setup. If you want to acquire only certain images,
supply
imaqSetupSequence()
with a table describing the number of
frames to skip after each acquired frame.
•
Acquire images continually through a ringed buffer acquisition. Set up
the acquisition using
imaqSetupRing()
. Use
imaqStartAcquisition()
to start acquiring images into the
acquired ring buffer. To get an image from the ring, call
imaqExtractFromRing()
or
imaqCopyRing()
. Use
imaqStopAcquisition()
to stop the acquisition.
Note
You must use the
imgClose()
to release resources associated with the image
acquisition device.
Reading a File
Use
imaqReadFile()
to open and read data from a file stored on your
computer into the image reference. You can read from image files stored in
several standard formats: BMP, TIFF, JPEG, PNG, and AIPD. The
software automatically converts the pixels it reads into the type of image
you pass in.