Why Flexible Automation | Getting Started with AEi | News | About AEi | Site Index | Contact AEi

Tutorial: Machine Vision

Overview

This tutorial is meant to be a brief introduction to machine vision. It covers the basics of machine vision and some basic issues to consider when choosing system components.

When designing a system keep in mind that the price of both hardware and software components is continuously decreasing due to ever greater specialization among companies in the field. Most suppliers have concentrated their product development effort on one of the basic elements.
Open architecture systems are able to take advantage of this specialization in much the same way that the PC can be optimized for the user very cost-effectively with standard components around an open architecture.

There are 5 basic elements of a PC-based machine vision system. These are as follows:

  1. Camera
  2. Optics
  3. Illumination
  4. Image Acquisition Hardware
  5. Machine Vision Software

These basic elements are described below:

Cameras

Infrared vs. Visible Spectrum Infrared cameras are typically used in heat mapping applications. They can also be useful in applications where the ambient visible light may be variable and it is critical that any analysis is not affected by the changes in ambient light. Infrared cameras are more costly and are not needed for the majority of machine vision imaging applications.

Progressive Scan vs. Interlaced Interlaced cameras can be more cost effective for stationary or slow moving applications. For fast moving applications, especially where strobes are used for lighting, it is advisable to use progressive scan (non-interlaced) cameras with higher-end frame grabbers that support these cameras.

Analog vs. Digital Digital cameras have higher resolution than analog cameras and can also Transfer data at higher rates than analog cameras.

Digital Area vs. Digital Line Scan Digital linescan cameras are typically used for very high speed applications where the part moves in a single direction past the 'line' aperture of the camera. If area cameras are used in high speed applications, they will most likely need to be coupled with strobe lighting to "freeze" the image to prevent blurring.

Optics

The image captured by the camera can at best be as good as the lens through which it was taken. Lenses vary in optical quality and price. Basic choices for lenses are the f-stop range, focal length, zoom or fixed magnification, telecentric or conventional.

F-stop

The lower the minimum f-stop, the more light passes through the camera, enabling operation in lower light conditions.

Focal length

The focal length defines the image field of view the camera will see at a given distance from the camera.

Zoom vs. Fixed

Zoom lenses are more flexible than fixed magnification lenses, but they also let less light through.

Telecentric vs. Conventional lens

Telecentric lenses reduce viewing angle error and magnification error common in conventional lenses, especially around the edges of the image.

Calculating Lens Field of View for Different Imager Formats

The relationship between lens field of view size, distance to the object, and lens focal length depends on the CCD format, approximated as follows:

1/3" Format 1/2" Format 2/3" Format
H = (4.3 * D) / F H = (6.4 * D) / F H = (8.8 * D) / F
V = (3.2 * D) / F V = (4.8 * D) / F V = (6.4 * D) / F
F = (4.3 * D) / H F = (6.4 * D) / H F = (8.8 * D) / H
F = (3.2 * D) / V F = (4.8 * D) / V F = (6.4 * D) / V

Where:
H = horizontal width of field of view in millimeters
V = vertical height of field of view in millimeters
D = distance to object in millimeters
F = lens focal length in millimeters

Illumination

Illumination is critical to a vision system's success. The following is an introduction to some of the different types of lighting available:

Directional Light

This includes high pressure sodium and quartz halogen. These highly directional light sources can produce sharp shadows and don't provide uniform illumination.

Diffuse Light

This gives the most uniform illumination of features of interest.

Back Lighting

Back lighting is used to more reliably detect shapes and make dimensional measurements

Strobe Lighting

Strobes are necessary when area cameras are used in high speed applications. The strobe lighting freezes the image to prevent blurring.

Image Acquisition Hardware

An image acquisition board or frame grabber is required to bring the camera image information into the PC in a PC-based machine vision system. For analog cameras, the camera signal must be converted to a digital format by the frame grabber. The frame grabber then sends the image information to PC memory and/or the video display card. For digital cameras, a digital image acquisition board is used. Image information is transferred from the camera to the board in a digital form. Digital cameras have the advantage of lower noise, higher potential frame rates, and higher potential resolution. Digital cameras and image acquisition boards are more expensive than analog systems, especially high resolution digital cameras. However, the price differential between analog and digital systems is continuously decreasing.

Most contemporary image acquisition cards are available in PCI bus format for high speed data transfer to both PC memory and display. The use of technologies such as bus mastering plus DirectDraw is increasingly common to support the highest possible transfer rates with little computer CPU load.
Some other important features of image acquisition boards for PC-based machine vision include the following:

Multiple Cameras Support

Most contemporary image acquisition boards support multiplexing of 2 to 4 cameras. Some advanced image acquisition boards support acquisition from multiple cameras simultaneously and independently. This feature and multi-threading application software can be used to implement more complex machine vision systems very cost effectively.

Triggering and Strobe Modes

Image acquisition boards typically support on board external triggering abilities for timing image acquisition. Some boards also support configurable strobe light control and synchronization. These features require compatible application software to be utilized.

Configurable Digital I/O

Some image acquisition boards support on board configurable I/O lines for interfacing with other devices and controllers. For example, different output lines could be set high or low at different times during an inspection cycle to indicate the results of the inspection (cycle completed, inspection passed, inspection failed, etc.). This feature again requires compatible application software to be utilized.

Machine Vision Software

Application software for PC-based machine vision is typically created using one of the three following approaches:

  1. Use machine vision libraries with custom code developed using Visual C/C++, Visual Basic, or Java.
  2. Use graphical programming environments that use icons to represent machine vision and other control/display functions.
  3. Use configurable application software for machine vision.

The traditional approach of using machine vision libraries with custom code developed using Visual C/C++, Visual Basic, or Java has been made more effective in the last few years due to falling prices for available third party libraries and more comprehensive analysis tools available in these libraries. The development and debugging environments for the software languages also continue to improve. This approach provides the most flexibility in the features that can be included in the machine vision application. However, custom software must still be developed for each application. This is simply not viable for many end users as well as systems integrators and equipment manufacturers. Equipment manufacturers that use machine vision for flexible automation equipment they produce need a process oriented "programming" approach for their end customers to use that can be learned quickly by non-programmers.

The graphical programming environments can sometimes be easier to learn and develop with than traditional programming. However, this is not universally true. Further, some of the graphical programming environments were not originally developed for industrial machine vision but were instead developed for general purpose data acquisition. This imposes architectural limitations and other constraints that hamper application development and performance efficiency. Many of the graphical programming environments include primarily lower level image analysis building blocks or elements that require significant effort to assemble into a complete machine vision software system. Further, a significant amount of graphical programming is still required to implement a complete application that includes common requirements such as automated alignment, configurable ROIs, and adjustable result tolerances. And, as with traditional programming, the graphical programming must be done again and again for each new application.

The concept behind configurable machine vision application software is to provide the equipment manufacturer, systems integrator, or end user with a point and click teaching environment to define the machine vision system functions. If executed effectively, configurable machine vision software can be setup quickly and easily to execute different functions with little training. To maintain this goal, configurable machine vision systems typically support only a basic subset of machine vision functions. This is viable for many basic machine vision applications but not for all applications. This is particularly true for applications where advanced vision functions, motion control, and customizable user interfaces or teaching environments are required. These are common needs of automation equipment manufacturers and systems integrators when implementing machine vision.

Additional approaches and tools are required to overcome the limitations of the approaches described above. This includes the following:

  1. Open architecture motion control libraries.
  2. Configurable application software for machine vision that can be extended with option modules.
  3. Hybrid development packages that support point and click programming plus comprehensive scripting, motion control functionality, and a customizable teaching environment.

The FlexAuto™ software package provides a combination of many of the ease of use features of a configurable machine vision system plus support for comprehensive control logic implementation, sophisticated motion control, and a customizable teaching environment.