Guest Column | May 19, 2000

Hanks on Machine Vision: Identifying Features/Defects and Choosing Your Lighting

National Instruments Corporationssful vision systems applications hinge on clearly defining criteria for good parts and defects, and on selecting optimum lighting for the conditions.

By: John Hanks and Gail Folkins, <%=company%>

Today's test and manufacturing engineers and scientists are using personal computers to acquire and analyze images in industrial control, laboratory automation, and test and measurement applications. Achieving optimal results from a PC-based imaging system depends on several different components, including identifying your good and defective parts and also choosing the proper lighting and material handling techniques.

Identifying features/defects
To better automate the process in your vision system, you must clearly specify between a good part and one with a defect. Here are several questions to ask yourself:

  • What does a good part look like?
  • What are the most common defects?

To achieve this evaluation, you can use statistical techniques, such as ranking the defects from highest probability to lowest probability. Bottom line, if you cannot classify the defects, then the inspection process will prove difficult to automate. At this step, it is often helpful to involve a systems integrator or vision vendor. You can send these integrators or vendors both good and defective parts, then the vendors will advise you on the best means of solving your application.

Another solution in evaluating your defects or good components is to develop a test database. The question is, how can you create data for your database without a vision system that includes lighting, optics, cameras, frame grabber, and so on? At this stage, it is often useful to acquire images with an inexpensive camera, frame grabber, and lighting equipment so that you can evaluate whether your application can be easily solved. The assumption is that if you can create a prototype that works with poor images, you should be able to solve the application with optimal lighting and optics.

Lighting and material handling
Lighting equipment and part handling ensure that the image is acquired in a consistent manner, resulting in simpler software processing techniques. Overall, you want to streamline the amount of software development needed in both disciplines.

Lighting techniques—Illuminating the scene and object properly is an important step when developing a vision system. The objective is to separate the feature or part you wish to inspect from the surrounding background by as many gray levels or color grades as possible. If the feature you want to inspect is difficult to separate visually from the background or the defects do not stand out, the inspection task will prove difficult.

Lighting (i.e. conditioning the image) is in some ways analogous to signal conditioning in data acquisition system—the choice of lighting technique can greatly simplify the processing. Some lighting techniques to consider include ambient light, shadowing and reflecting, and the lifetime of the light source.

Ambient light is essentially time-varying noise. For instance, the changes in illumination between day and night represent ambient light. By positioning the lighting equipment properly or using a lighting tent, the surrounding light is blocked, thereby minimizing illumination problems caused by this type of varying light.

Shadowing and reflection are yet further examples of the importance of good lighting. If a material is highly reflective, for instance, it could cause bright spots or reflections in the image, making development of image processing software more difficult (see Figure 1).


Figure 1. The left image of the barcode on the reflective can uses a ring light and polarizing filter to eliminate reflections. The image on the right shows the result of not using the polarizing lens. (Courtesy of National Instruments)

A related consideration is shadowing. Depending on the position of the camera relative to the light source and the device under test, the camera itself can cast an unwanted shadow. Nondirectional, diffused top lighting in a dome apparatus provides a solution in this instance. This type of apparatus produces illumination that minimizes reflections and is similar to outdoor light on a cloudy day. An example of diffuse illumination is when inspecting metals parts, such as rivets and ball bearings, as well as electronic components.

When selecting your light source, one factor to keep in mind is the lifetime of the device. An array of red light-emitting diodes (LEDs), with their expected lifetime of about 60,000 hours (seven years) under continuous use, really shine in this respect. Aside from their longevity, red LEDs are the brightest, least expensive LEDs available. Because they are small, you can use a grid or array of LEDs to illuminate the scene.

Lighting solutions—A wide variety of lighting techniques to optimize your application exists, including directional, back lighting, strobe lighting, dark field illumination, diffuse, and so on. To help choose your light source, you can use software such as the Measurement & Automation Explorer software (National Instruments; Austin, TX) to acquire an image and calculate the histogram. You can use this histogram to characterize the image, verify that the lighting is appropriate, and ensure that there is optimal contrast between the background and the object under inspection.

In addition, lighting equipment vendors will also gladly consult with you on how to properly light both the scene and the part– Edmund Scientific Industrial Optics (Barrington, NJ) and Schott-Fostec (Auburn, NY) are two illumination vendors that can help.

Material handling techniques—The goal of material handling equipment is to position the feature and/or part so that you can properly capture the object. Material handling vendors provide conveyers, stages (x-y positioning), robotic arms, motors, and motion control hardware and software. Material handling venders will also gladly help you in specifying a system. Overall, your current manufacturing process and the speed of your production dictate the expense of the solution.

Machine vision vendors such as National Instruments offer combined vision software and hardware systems designed for ease of use and specifically built to meet the requirements of machine vision and image processing application developers who are under pressure to reduce cost and time to market. Software and hardware from the same company, designed to work together, make your overall system development easier.

Next month, read about choosing the resolution, camera, and hardware for your vision application. For more article on machine vision, visit our column Machine Vision column.

About the authors…
John Hanks and Gail Folkins are with National Instruments Inc. John has worked for National Instruments in application engineering, marketing, and product management. He has also worked for Siemens Medical Systems Magnetic Resonance Imaging Division as an imaging support engineer. Degrees include engineering B.S. from Texas A&M and an engineering M.S. degree from the University of Texas. As a researcher at the University of Texas he studied image-processing algorithms and develop a system for biomedical cell counting. John has more than fifty published articles on signal processing, machine vision, and measurement technologies. He can be reached at National Instruments, 11500 North Mopac Expressway, Bldg. B, Austin, TX 78759. Phone: (512) 794-0100; fax: (512) 683-5569; e-mail: John.hanks@ni.com.