Chapter2 GettingMeasurement-Ready Images
IMAQVision for LabWindows/CVI User Manual 2-6 ni.com
Acquiring an ImageUse 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 IMAQdevice 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 youcall this
function, it acquires the nexti ncoming video frame on an IMAQ
deviceyou have already initialized using imgInterfaceOpen() and
imgSessionOpen().Use this fun ction for high-speed single capture
applications.
•Acquireimages continually through a grab acquisit ion. Grab functions
perform high-speed acquisitions that loop continually on one buffer.
UseimaqSetupGrab() to start the acquisi tion. Use imaqGrab() to
returna copy of the current image. Use imaqStopAcquisition() to
stop the acquisition.
•Acquirea fixed number of images using a sequence acquisition. Set up
the acquisition using imaqSetupSequence().Use
imaqStartAcquisition()to acquire the number of images you
requested duringsetup. If you want to acquire only certain images,
supplyimaqSetupSequence() with a table describing the number of
frames to skip after each acquired frame.
•Acquireimages continually through a ringed buffer acquisition. Set up
the acquisition using imaqSetupRing().Use
imaqStartAcquisition()to start acquiring i mages into the
acquired ring buffer.To get an image from the ring, call
imaqExtractFromRing()or imaqCopyRing().Use
imaqStopAcquisition()to stop the acquisi tion.
Note Youmust use the imgClose() to release resources associated with the image
acquisitiondevice.
Reading a FileUse imaqReadFile()to open and read data from a file stored on your
computerinto the image reference. You can read from image files stored in
severalstandardformats:BMP,TIFF,JPEG,PNG,andAIPD.The
software automatically converts the pixels it reads into the type of image
you pass in.