17.12.2018 Views

Image Acquisitionand Proces

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Image</strong> Acquisition 57<br />

source LabVIEW Webcam library, released in July 2002, allows images to be captured<br />

on machines running nearly any version of Windows at speeds of 7 to 10 frames per<br />

second at 320 × 240 × 24 resolution. The library relies on a simple dynamic link library<br />

(DLL) that communicates with the Video for Windows (VFW) programming interface<br />

in order to initiate, configure, begin and end a capture session with an imaging device.<br />

Labeling it a “Webcam library” is a slight misnomer, as VFW allows for communication<br />

with practically any imaging device with a fully supported Windows driver.<br />

3.4.2 FUNCTIONALITY<br />

The Webcam library consists of two sets of VIs built around the low-level functionality<br />

of the DLL. The first set assists in the capturing of images using the DLL<br />

described previously. The second set provides a means of converting captured images<br />

to the IMAQ format for processing, to the LabVIEW picture format for display on<br />

the front panel, and to the bitmap format for file storage. When used together, the<br />

capture and conversion VIs provide a straightforward means of acquiring and working<br />

with image data from consumer-grade devices. A number of example uses of<br />

the Webcam library are provided in the subsequent discussions.<br />

3.4.2.1 Single and Continuous Capture with Display<br />

Only two VIs are required to capture a single image from an imaging device and<br />

display it on the front panel. The Webcam Snapshot VI can be coupled with the<br />

Webcam Flat to Picture VI to accomplish this goal as shown in Figure 3.17.<br />

FIGURE 3.17 Continuous Capture with Display.<br />

A slightly more complex configuration of VIs is required to capture images<br />

continuously. The Webcam Snapshot VI used in the single-shot acquisition shown<br />

in Figure 3.17 initializes a session, grabs a single image, and then immediately closes<br />

the session. A similar approach is taken when performing a continuous capture,<br />

except that the grab, conversion and display operations are repeated inside a loop,<br />

with the necessary initialization and discarding VIs outside, as shown in Figure 3.18.<br />

3.4.2.2 Single Capture with <strong>Proces</strong>sing and Display<br />

Any Webcam library image can easily be converted to the IMAQ format for image<br />

processing and analysis using the LabVIEW Vision Toolkit. The Webcam Flat to<br />

IMAQ VI is capable of creating a new buffer or using an existing IMAQ buffer to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!