Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Capture and process camera data

Knowing how a frame grabber works will help you choose the best one for vision applications.

Jon Titus, Editorial Director -- Test & Measurement World, 4/15/2002

Run your own tests

Ask most people involved with machine vision what a vision system comprises and they'll tell you a camera, a computer, and software. There's another key component—the frame-grabber board—that deserves attention. This board plugs into a computer and connects one or more cameras to the computer's main bus. Because this board converts analog signals into the digital information that machine-vision software will process, it plays a key role in ensuring a vision system has good data to work with.

In addition to acquiring image data, frame grabbers provide other I/O functions such as triggering a camera, turning lights on and off, and communicating with programmable logic controllers (PLCs). Input lines can sense external on/off events such as the arrival of a product at the proper position for image acquisition.

Figure 1. The Data Translation DT3162 provides a complete frame grabber that puts out several camera-control signals that let the board work with a variety of camera types. This board streams its data to main memory over the PCI bus. Courtesy of Data Translation.


Frame-grabber boards (Figure 1), usually just called frame grabbers, come in several varieties. These boards differ in the types of cameras they work with and how they manipulate image data prior to sending it to a PC's main memory. But no matter what type of camera signal a frame grabber accepts or how it gets data to a PC's memory, it still has one main function: to convert an image into useful data.

Most area-scan monochrome cameras used in machine-vision applications put out standard analog NTSC or PAL signals that connect directly to a frame grabber. The frame grabber's front-end circuits filter out extraneous information and separate timing signals from video signals. One of the timing signals, called horizontal sync, works with a phase-locked loop (PLL) to recreate an accurate pixel clock on the board. This clock synchronizes the frame grabber's operations with the video data coming from the camera. In particular, the pixel clock determines when the frame grabber's analog-to-digital converter (ADC) will digitize the video portion of the camera's signal. You can set up the PLL circuit to provide the correct timing for the ADC for a specific camera type. Each analog-to-digital conversion produces a digital value for a single pixel in the received image. For an 8-bit ADC, the pixels range from black (0) to white (255) along a gray scale.

In general, frame grabbers offer either 8-bit or 10-bit resolution. Some provide both and let you choose which resolution to use. Most machine-vision applications operate nicely with 8-bit data, although some metrology applications that use subpixel measurement techniques can benefit from the higher resolution. For this article, I'll assume 8-bit pixel data.

Because a frame grabber that processes analog signals relies on reconstructed timing information, the board's circuits can introduce errors in digitized data. Two types of errors, rms noise and nonlinearity, arise from the analog electronics. The rms noise represents the electrical noise produced in all electronic circuits. For a frame grabber, an rms noise value of less than 0.7 LSB is very good, and an rms noise value of less than 0.5 LSB is deemed excellent (Ref. 1).

Nonlinearity errors appear as digitization differences between standard gray-scale values "seen" by a camera and the values actually produced by the frame grabber's ADC. Good design can keep nonlinearity values under 0.5 LSB.

Figure 2. To properly convert an image signal, a frame-grabber’s ADC must sample close to the middle of each pixel’s signal. A small amount of jitter in the ADC’s timing can introduce digitization errors. (Signals exaggerated to show details.)
Pixel accuracy also depends on the reconstructed pixel clock. The CCD or CMOS photodetector used in a camera provides an x-y array of individual light sensors. The camera reads out the sensor voltages one after the other, row by row, to produce a stream of pixel voltages. The frame grabber's ADC must sample and convert each pixel's voltage as close as possible to the center of the pixel's period (Figure 2). If the measurement point drifts away from this center point, the digitized value can vary from the pixel's true gray-scale value. The small timing errors—called jitter—result from small differences between the pixel clock in the camera and the pixel-clock signal reproduced on the frame-grabber board. Pixel jitter of ±5 ns or less is considered good. You can obtain pixel-jitter information from manufacturers' data sheets, or you can put together a simple test setup to measure pixel jitter (Ref. 2).

Although most machine-vision applications in the electronics industry rely on monochrome cameras, some applications require the use of color cameras. The frame grabbers used with color operate in a similar fashion, but they provide three ADCs, one per color—red, green, and blue. So, the same concerns about pixel jitter and noise apply to the frame grabbers used with color cameras. Keep in mind, though, that the three ADCs produce three bytes per pixel, so the interface for a single color camera takes three times as much circuitry as that for a monochrome camera. And each color pixel takes three times as much memory.

Cameras perform conversions

Traditionally, monochrome and color machine-vision systems have relied on analog signals to transmit video information from cameras to host computers. But the ambient electrical noise present in industrial facilities can disrupt those signals. To help alleviate the noise problem, camera manufacturers have started to transfer some frame-grabber functions from the host computer to the camera itself. Thus, many newer camera perform analog-to-digital conversions close to the image sensor to help eliminate timing errors and reduce the effects of ambient noise. Unlike the NTSC or PAL signals that require only a single coaxial cable, digital-camera transmissions require a set of parallel wires.

Cameras that perform their own analog-to-digital conversions carry a higher price tag, but they still require a frame grabber to serve as a simple digital interface to a PC. Such a frame grabber acquires the digital data from the camera—usually sent as low-voltage differential signals—and reassembles the bits into bytes that represent pixels in the original image.

Some camera manufacturers have adopted the Camera Link standard that further simplifies camera-to-PC connections. The Camera Link standard mandates a specific type of connector and cable, so vision systems no longer need expensive custom cables. This standard provides for several types of transmissions and specifies the signals used for data and camera control (Ref. 3). As a result, a Camera Link camera should easily connect to any Camera Link-compatible frame grabber.

Thanks for some memory

Figure 3. National Instruments PCI-1409 frame grabber can work with as many as four video sources. The board’s ADC offers either 8- or 10-bit resolution, and the board can store 16 Mbytes of image data. Courtesy of National Instruments.
The digitized image data—whether it comes from an onboard ADC or from a digital camera—must eventually get transferred onto the host PC's data bus and into the host's main memory. Some frame-grabber boards transfer the data onto the bus immediately, while others (Figure 3) give you the option of temporarily storing the data before moving it to the PC.

Whether or not you choose a frame grabber with onboard memory depends on how fast you need to get images to a host computer's main memory. If you have an application that taxes the PC's bus, or that doesn't need immediate access to an image, you might choose to temporarily store the image data rather than put it on the bus as soon as it arrives from a camera.

Applications that can tolerate some latency between acquiring an image and processing it may route image data into onboard memory and later transfer it to main memory all in one block rather than in small pieces. Or, an application could set up the memory to act like a first-in, first-out (FIFO) buffer. As the onboard memory accepts new data, the memory pushes the previous image onto the bus.

Look up pixel values

In addition to temporarily storing data, some frame grabbers can process pixel data prior to transferring it to a PC's memory. This "preprocessing" takes some of the image-processing burden off the host CPU. One of the simplest processing tasks involves altering the contrast in an image. Assume you have adjusted light sources to get the best possible range of gray-scale values in images of electronic assemblies you want to inspect, but in each image, the assembly still looks too dark. In effect, the image contains pixel values "compressed" at the black end of the gray scale.

Figure 4. a) Due to imaging conditions, pixels may cluster within the gray scale; in this example, they cluster at the black end. b) Using a LUT to spread the pixels across the entire gray scale will ease the task of locating details in an image by enhancing the differences between gray levels. In effect, the LUT operation gives machine-vision software a larger range of pixel values to work with.
A standard histogram that plots number of pixels vs. gray-scale value for these images shows a clump of values at the black end of the gray scale (Figure 4a). If you could somehow "stretch" those values across the entire gray scale, the contrast in the new images might improve. Many frame-grabber boards include a look-up table (LUT), actually a small amount of fast onboard memory, for just this sort of operation. The LUT can "translate" the small range of gray-scale values, and in effect "expand" them to fill almost the entire 8-bit gray scale (Figure 4b). In effect, the frame-grabber circuit uses each pixel value to address the LUT, which reads out a new "translated" pixel value. This operation takes place one pixel at a time as the individual pixel values pass through the frame grabber.

You also could use an LUT to produce binary—black-or-white—pixels in an image. Pixels with gray-scale values equal to or less than a threshold you set get translated to black, and pixels with values greater than the threshold get set to white. The resulting image contains only black and white pixels. Such images lend themselves to pixel-counting applications that can detect changes from one image to the next (Ref. 4). Those changes could signal a missing component or an extra component. You use machine-vision software that comes with a frame grabber to calculate and set up the LUT values. Even though a frame-grabber board comes with an LUT, you don't have to use it.

This sort of simple onboard processing can improve image contrast, reduce noise, and perform other simple tasks. By increasing the quality of the image as pixel data passes through a frame grabber, the board can help reduce false failures detected by the PC's machine-vision software. In most cases, the onboard processing takes less time than an equivalent operation in an application program.

Add a real processor

You also can buy frame grabbers that include general-purpose processors, field-programmable gate arrays (FPGAs), or specialized image-processor chips. Once programmed, these devices can perform complicated operations such as convolutions and correlations, feature extraction, edge detection, and so on. Performing some or all of the image-analysis tasks right on the frame-grabber board reduces the software burden that would otherwise fall on the host PC. And some production lines move too fast for PC-based application programs to keep up with them.

Continuous sheets of product—often called a web—move rapidly, and a machine-vision system must detect defects immediately. In a web-type inspection system, a frame grabber, working with a line-scan camera, builds a continuous image a line at a time and processes the image on the fly. Applications such as the high-speed high-resolution inspection of semiconductor wafers or the continuous monitoring of sheet film or sheet metal require an onboard processor.

Manufacturers may provide processing functions on a frame-grabber board or as add-on daughter cards. And some suppliers refer to programmable frame grabbers as accelerator boards, so be aware that a board given the "accelerator" label also may process images without needing to interact with a host PC. To further confuse the nomenclature, note that not all frame grabbers that include an FPGA or other programmable device can process pixels on the fly. Manufacturers may provide an FPGA to let a frame grabber reconfigure camera settings, bus-control logic, or other settings.

Figure 5. The onboard Xilinx FPGA (white IC) on the Datacube MaxRevolution board gives users the opportunity to develop image-processing software that runs without interaction from the host PC. The FPGA can offer a speed advantage in high-speed image-acquisition and image-processing applications. Courtesy of 
Datacube.
To use advanced processors or FPGAs, you don't need to understand their architecture. The MaxRevolution frame-grabber board (Figure 5) from Datacube comes with high-level programming tools—Visual Chip Studio and Video Layered Library—that let users program an onboard Xilinx FPGA. The tools provide algorithm building blocks that you connect graphically during program development.

The XSYS Smart Framegrabber from PLD Applications provides access to the onboard complex programmable logic device (CPLD) that controls operations. Developers can adapt the CPLD to handle special-purpose operations or to apply algorithms to image data. But doing so requires knowledge of the CPLD's architecture and access to programming tools, available from Altera (San Jose, CA; www.altera.com), the CPLD chip vendor. PLD Applications will, however, help OEMs with custom applications.

Not everyone needs an onboard processor, though. Computers with lots of memory, dual Pentium processors, and high-speed buses can tackle all but the most demanding image-processing and machine-vision tasks.

End users: Buy a package

If you're not an OEM or a system integrator, consider buying frame-grabber boards and software from the same vendor. By buying a "package," you'll ensure the hardware and software will "plug and play." Frame-grabber suppliers want buyers to get machine-vision systems up and running quickly—nothing beats testing hardware and software under real conditions. High-level development tools often let you quickly configure an application so you can test the frame-grabber board, the camera, and lighting setups.

Software tools sold by frame-grabber suppliers ease application development by providing menu choices, drop-and-drag application tools, and configuration wizards. Developers can concentrate on lighting, contrast, image sizing, and so on, rather than on how to pass arguments to algorithm libraries. If developers want to use C, C++, or Visual Basic, they'll find a variety of ActiveX controls, dynamic-link libraries (DLLs), and other routines bundled with most high-level machine-vision tools (Ref. 5).

During your deliberations, look at each supplier's line of frame grabbers. One type of board may meet today's needs, but you may need more powerful boards, or boards for different cameras, in a new application. Frame grabbers in a manufacturer's product line may require different drivers, but using a different type of board shouldn't force you to rewrite a lot of code. The same applications software, function calls, libraries, and ActiveX controls should work across a product line.

As you look at frame-grabber hardware and software, keep the future in mind. In the next few years, you can expect to see increasing adoption of the Camera Link standard, higher image-data bandwidths, and larger image sizes. And as the prices for color cameras drop, you'll find more applications that can take advantage of color images. You want to ensure your supplier recognizes these trends and either already has products that work with large-format cameras, color cameras, or cameras that use the Camera Link interface or has such products in its near-term plans.

For more information

To locate frame-grabber suppliers, use the online Buyer's Guide at www.tmworld.com and search on the keywords frame grabber.

The following company information appeared in the original print version of this article. For up-to-date information about companies, visit the Frame Grabbers portion of our Buyer's Guide.


Manufacturers of programmable frame grabbers
Advanced Products and Design Div.
San Diego, CA
858-527-6100
www.titansystemscorp.com/divisions/apd
Alacron
Nashua, NH
603-891-2750
www.alacron.com
Coreco Imaging
Billerica, MA
978-670-2000
www.coreco.com
Datacube
Danvers, MA
978-777-4200
www.datacube.com
Euresys
Dallas, TX
514-684-3993
www.euresys.com
i2S Line Scan
Niskayuna, NY
888-842-7872
www.i2S-linescan.com
Leutrek Vision/Atlantek Microsystems
Burlington, MA
781-238-0213
www.leutrek.com
Matrox Electronic Systems
Dorval, QC, Canada
514-822-6000
www.matrox.com
PLD Applications
Aix-en-Provence, France
+33-442-393-600
www.plda.com
RVSI Acuity CiMatrix
Canton, MA
781-821-0830
www.rvsi.com (Click on "Acuity CiMatrix" button)
   


References
  1. Gregory, Robert H., and John C. Hotchkiss, "How to choose a frame grabber," Laser Focus World, September 2000. p. 153. www.laserfocusworld.com.
  2. "Pixel Jitter in Frame Grabbers," Sensoray, Tigard, OR. www.sensoray.com/html/pixjiter.htm.
  3. Titus, Jon, "PCs and cameras plug and play," Test & Measurement World, March 2001. p. 35. www.tmworld.com/archives.
  4. Titus, Jon, "Put vision sensors on the line," Test & Measurement World, April 2002. p. 47. www.tmworld.com/archives .
  5. Titus, Jon, "Software makes machine vision easier," Test & Measurement World, October 15, 2001. p. 17. www.tmworld.com/archives.


  • Author Information
    Jon Titus has written software and designed computer/instrument interfaces. He worked in electronics for 10 years and spent nine years at EDN magazine prior to joining T&MW in 1993. He has a BS from WPI, an MS from RPI, and a PhD from VPI.

     

  •  

    Run your own tests

    You can obtain information about ADC characteristics such as noise, nonlinearity, offset, and so on from the device manufacturer's data sheets. But a frame grabber depends on so many other circuits that you can't establish performance specifications simply by consulting a data sheet. Your best bet is to actually try a frame grabber with a camera to see how it works. Although you could run electronic tests by feeding the frame grabber a "golden" video signal produced by an arbitrary waveform generator or other signal source, it's impractical to do so. It takes too much time and effort to produce such a golden signal for an ARB.

    You can test a frame grabber by using standard gray-scale test images that provide many levels of gray or that furnish a complete gray scale, from white to black. You also can buy test patterns that show how well a frame grabber can distinguish between alternating black and white lines. After a frame grabber digitizes one of these patterns, you can relate the test pattern's actual gray-scale values to those put out by the frame grabber. Edmund Industrial Optics (Barrington, NJ; www.edmundoptics.com) and Sine Patterns (Pittsford, NY; www.sinepatterns.com) produce a variety of gray-scale and geometric test patterns. The Society of Motion Picture and Television Engineers (SMPTE; White Plains, NY; www.smpte.org) also sells imaging standards. (Before you run any tests, ensure your test area is well lit and your camera is in focus.)

    Email
    Print
    Reprint
    Learn RSS

    Talkback

    We would love your feedback!

    Post a comment

    » VIEW ALL TALKBACK THREADS

    Related Content

    Related Content

     

    By This Author

    Sponsored Links



     
    Advertisement
    SPONSORED LINKS

    More Content

    • Blogs
    • Podcasts

    Blogs

    • Martin Rowe
      Rowe's and Columns

      August 11, 2008
      Grachanen wins NCSLI award
      At last week's NCSL International Workshop and Symposium, Chris Grachanen was awarded the NCSLI Educ...
      More
    • Martin Rowe
      Rowe's and Columns

      August 8, 2008
      Have you seen Test Ideas?
      The August print issue of T&MW features a new column called "Test Ideas." For this fir...
      More
    • » VIEW ALL BLOGS RSS

    Podcasts

    Advertisements





    NEWSLETTERS
    Click on a title below to learn more.

    Test Industry News (3 Times Per Month)
    Machine-Vision & Inspection (Monthly)
    Communications Test (Monthly)
    Design, Test & Yield (Monthly)
    Automotive, Aerospace & Defense (Monthly)
    Instrumentation (Monthly)
    Resource Center E-Alert (Monthly)
    ©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
    Use of this Web site is subject to its Terms of Use | Privacy Policy
    Please visit these other Reed Business sites