The text of a manual · part 5 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 4 - Staging Considerations for Vision Applications, pages 43 to 51
Pages 43 to 51 of 404, from Bulletin 2803 VIM Vision Input Module User Manual
The original document is the PDF (26 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 2803-VIM2
Page 43
Chapter
4
Staging Considerations Vision Applications for
Objectives
The objective of this chapter is to provide information for maximizing image quality during inspections through the application of “staging,” which includes such considerations as lighting options, lens functionality and selection, and workpiece positioning in the vision system’s field of view.
Image Quality
Successful vision applications require image quality. Image quality refers to the quality of the presentation of the workpiece or workpiece features to the machine vision system. Image quality helps determine the feasability, precision, and consistency in vision inspections. To use the VIM2 vision system effectively, present a quality image to the VIM2 vision system.
Chapter
One way to determine the feasability of your application is through the use of the video monitor. For example, keep the following rule of thumb in mind when setting up your vision application using the VIM2 vision system: Ifyou don’t see workpiece features of interest clearly in the video monitor, then you probably won’t be able to inspect it with the vision system. Image quality is accomplished through the process of “staging,” which is the topic of the remainder of this chapter.
Staging
The term “staging” refers to the application of lighting, camera, and lens to present the workpiece features to the vision system for inspection. Through the process of staging, you create a vision “workstage,” the area where the vision inspections take place. There are two main objectives in the design of a workstage: 1) To make the features of interest clearly visible 2) To reduce clutter in the image and eliminate irrelevant features from the image. This chapter discusses speciIic tools and techniques to achieve the required image quality. Two key elements which affect image quality, focus and image contrast, are discussed in the next two sections.
Page 44
Chapter 4-2
Focus
4.
Staging Considerations for Vision Applications
The collection of light through the camera lens is a critical step in the formation of the image. The lens must be set at the proper distance from the workpiece and then properly focused. Lens focus determines the sharpness of the features in the image. Image features such as edges and thin sections must be clearly focused to prevent a loss of clarity due to blurring. Blurred images may change appearance as the binary threshold levels are changed. This is because features like edges may appear as blurred transitions from white to gray to black and threshold changes move the apparent positionof the edge along with the changing gray level of the blurred edge. This problem is not encountered when edges have crisp contrast with no blurring. Blurring can be caused by rapid motion in high-speed applications. In this case, you can use a strobe light to stop the action and eliminate the motion blurring. Poor focus also impairs the ability to see small detail. Small features may be blurred and lose the sharp definition required for precision measurements. If you wish to inspect features at different distances from the camera, you may want to increase the depth of field (depth of focus) of your lens. To do this, you narrow the aperture (increase the F-stop setting), and add more light to the workstage to compensate for the loss of brightness. You can also restrict the depth of field to defocus a busy background. In any case, experimentation is critically important.
Image Contrast
Image contrast is extremely important to the successful application of the VIM2 module. An ideal contrast situation can be created through the use of backlighting. Backlighting illuminates the object from the rear. The workpiece blocks the light and appears as a solid black silhouette against a bright, white background. This distinct contrast in gray scale, from the very dark object to the very bright background, makes it very easy to set an acceptable threshold and makes the vision system relatively insensitive to small variations in light level. Features that have only minor variation in gray-scale intensity (low contrast) are more difficult to separate. When setting up your application, try to create as much crisp, well-focused contrast as possible between features of interest and the background. This ensures that the thresholds will be more easily set and that consistent measurements will more easily be obtained.
Page 45
Chapter
The importance of Lighting
4
Staging Considerations for Vision Applications 4-3
We have seen that focus and image contrast are key elements in image formation. Both of these elements are highly dependent upon the lighting provided in the inspection area, or workstage. Because light is the medium used by the vision system to make measurements, it is crucial that the workstage lighting both be appropriate for the intended inspection, and also be consistent from one inspection to the next. You should light the workstage as best suits your application. Before lighting the workstage, you should consider workpiece’s features, color and reflectivity, as well as the background, in order to determine which type of lighting works best. The image received by the vision system is partially the result of direct and reflected light. The camera “sees” only the light intensity; it does not see color. The gray level of a feature in the workstage is determined by the interaction of light and the surfaces of objects in the workstage area. When light strikes a surface, it can be absorbed, transmitted, or reflected. l
Absorbed Light A red object appears red because all the light rays except red are absorbed. Dark objects absorb a lot of light. Light objects absorb very little light and reflect most of it away.
l
Transmitted Light Light passes through many types of glasses and plastics. The light path is often radically modified by this transmission. This light is called transmitted light.
l
Reflected Light Light that is not absorbed or transmitted is reflected. The two types of reflected light are specular and diffuse, and usually both types are present. A glossy magazine cover exhibits both types of reflection. When held at a certain angle, light is reflected directly into the reader’s eyes (specular reflection), and the print cannot be observed. When tilted slightly, the specular reflections are directed away from the reader and the diffusely reflected light allows the print to be observed. Figure 4.1 shows both types of reflection.
Page 46
Chapter 4-4
4
Staging Considerations for Vision Applications
The /m,portance of Lighting (continued)
Specular Reflection
Diffuse Reflection
I
Light source
Different
Figure 4.1 Specular and Diffuse Reflection I I I I
Types of Lrgh ting
Several types of lighting devices may be used with the VIM2 module. Many of these may be ordered directly from Allen-Bradley as accessories. See your local representative for details. 1. Incandescent Lighting Incandescent lamps are popular because they are economical and their intensity is easily adjusted. However, ordinary incandescent lamps have limitations since they exhibit a constant degradation in light during their operating life. Using a halogen light source results in a more consistent light output. 2. Fluorescent Lighting Fluorescent lamps produce less heat than incandescent lamps yet produce the same amount of light. Some fluorescent lamps, in multiple-lamp fixtures, provide large, diffuse illumination. Circular fluorescent bulbs are excellent for illuminating small objects. Some fluorescent lamps flicker at a rate of 60 Hz. This is the same rate as the video frame rate. This flicker may cause some jitter in the image. This jitter is most apparent in image areas such as edges.
Page 47
Chapter
Different
Types of Llgh ting (continued)
4
Staging Considerations for Vision Applications 4-5
3. Strobe Lamps When an object is moving past the camera at high speeds, a strobe lamp flash of light can “freeze” the motion to create clear images. The strobe produces high intensity light for a very short period of time. The brightness of the strobe flash may vary from flash to flash. The timing of the flash must be synchronized so that the workpiece is present when the camera scans the area. The VIM2 module can trigger an accessory strobe light through the trigger output on the swingarm.
Methods of Lighting
In addition to evaluating what type of lighting is most appropriate, you must also determine the optimal placement of the light source(s). Lighting methods fall into two categories - direct lighting (backlighting), and indirect lighting (front lighting).
Direct f ighting (Backlighting)
When direct lighting is used, light travels directly from the source to the camera lens, and is not reflected. The workpiece is placed between the light source and the lens, producing a silhouette. Direct lighting is also called backlighting because the light comes from behind the workpiece. Backlighting allows detection of edge features only. Features that fall within the workpiece edges are not detected. Figure 4.2 shows an example of diffuse backlighting. Figure 4.2 Example of Diffuse Backlighting
Diffuse Backlighting
Camera
This form of direct illumination is useful when a high-contrast silhouette is required. This is the most easily constructed of all backlighting methods. This approach works especially well with flat workpieces; a well defined silhouette is produced.
Page 48
Chapter 4-6
/direct Lighting (Fran t Lighting)
4
Staging Considerations for Vision Applications
When using indirect lighting, light is reflected from the workpiece to the camera lens, making surface features visible. This technique is also called front lighting. Front lighting allows the vision system to capture normally visible features of the part and to make distinctions based upon gray-level appearances. It may also cast shadows or create reflections which may or may not be useful. Indirect lighting is used when surface features must be inspected, or where backlighting is not possible. Figure 4.3 illustrates several examples of indirect lighting. Figure 4.3 Examples of Indirect Lighting
Front Lighting - Directed
Bright Field
Directed bright field lighting places the camera near the angle of reflected light. This is the area of brightest intensity in most cases. This is particularly true of highly reflective parts with glossy surfaces or light colors. The shadows cast by bright field lighting may be used to create strong contrast between a feature in the workstage and its shadow. Use directed lighting to create strong contrast between features of interest and their background areas.
Front Lighting - Diffuse Reflection
Diffuse reflection is usually preferred to directed bright field lighting because it offers a wider range of gray values for image analysis. This is because the image is the result of the light absorbing and diffusing qualities of the features, not the reflecting qualities. A commonly used method is to place the illumination source at 45 degrees to the workpiece surface and the camera viewing angle, assuming the camera is perpendicular to the surface.
Front Lighting - Directed Dark Field
Q
Directed dark field is a side lighting technique where the angle of illumination (angle of incidence) is very shallow. A very small amount of the diffusely reflected light reaches the camera, and the surface appears dark. Any abrupt change in surface height causes a bright reflection into the camera’s lens, often with an accompanying dark shadow next to it. Surface flaws such as scratches and bumps are often detected using this technique.
Page 49
Chapter indirect Lighting (Front Lighting) (continued)
4
Staging Considerations for Vision Applications 4-7
Bright Field Front Lighting The image is greatly impacted by the angular relationship of the lighting and camera. This is because most reflected light bounces off of a surface at an angle equal to the angle of incidence (angle of approach). The camera lens collects the most light if its angle of incidence is along the axis of the reflected light. This bright reflection creates a bright image in the camera field of view and is referred to as “Bright Field”lighting (see Figure 4.3). Bright Field lighting can produce glare which may or may not be useful. Diffuse Front Lighting Diffuse lighting moves the camera out of the main reflected beam to collect the secondary light that is diffused (scattered) by the object surface. The angle is enough to reduce glare and still catch strong illumination from the diffused light. Dark Field Front Lighting Dark field lighting places the camera at such an extreme angle, away from the angle of reflection, that very little light is reflected or diffused to the camera and a dark image is formed. Directed dark field lighting is often used to highlight surface variations such as scratches and pits. Backdrops You can create high contrast between the workpiece and background simply by providing an appropriate backdrop. For example, a medium gray object appears light against a black background and dark against a white background. You can also place the backdrop far enough from the workpiece that it is out of focus enough to eliminate clutter.
Lens Selection and Adjustment
Another factor in quality image formation is lens selection and use. The lens projects the image of the workstage into the camera and onto the image collection electronics (the image array). The lens must form a sharp, even, undistorted image for consistent measurements to be achieved. A brief discussion of the subject is presented here.
How a Lens Works
Lenses bend light rays as they move from air into glass and then emerge from the glass into the air. (The degree the light rays bend depends on the angle of incidence and the indices of refraction for glass and air.) Figure 4.4 shows two simple lenses focusing light onto the image plane. In solidstate video cameras, the image plane is a photosensitive array on an integrated circuit. A broad selection of lenses is available to meet a variety of application requirements.
Page 50
Chapter
4
4-8
How a Lens Works (con timed)
Staging Considerations for Vision Applications
Field of View Lens selection is largely determined by the field of view (FOV) required to see the full area of interest in the work stage (see page 4-10 to determine FOV size). When considering the required FOV, allow room for variation in part position from inspection to inspection, if applicable. The FOV is the area (field) seen by the camera and viewed on the video monitor. There may be several lenses capable of meeting your FOV requirements. Each of the lenses has a different standoff distance for the same size FOV (see table 4.A or 4.B). Figure 4.4 Relationship of the Focal Length of a Lens to Standoff Distance Given a Constant Field of View
Lens I
Field of View Camera
Both Workstages Have the Same Field of View
/
I--
Standoff Distance
Short Focal Distance (f) With Short Standoff - 12.5mm Lens
I
Lens Extension Tube
I--
-
Standoff Distance w-f
Longer Focal Distance (9 With Longer Standoff - 25mm Lens w
Page 51
Chapter
How a Lens Works (con tin ued)
4
Staging Considerations for Vision Applications 4-9
Lens Standoff Distance From the Workpiece Standoff is the ideal distance between the lens and the item being inspected. The standoff for a given field of view is determined by the fixed array size and the focal length of the lens. The focal length is the distance between the lens center and the image plane (image array in this case) when objects in the field of view are in focus. Lenses are measured by their focal length. A lens with a short focal length, such as a 12.5 mm lens, has a shorter standoff for a given field of view than a 25 mm lens. This is illustrated in Figure 4.4. The camera should be mounted far enough away so that it does not interfere with the process or with the workstage lighting. Other considerations might include keeping away from parts that are hot or that emit vapors or dust; all of which degrade the performance of the system. Lens Aperture (F-stop) Settings You can control the amount of light collected by the lens using the F-stop ring located around the camera lens. The Fstop acts much like the pupil of your eye, controlling the amount of light that comes in contact with the lens. The F-stop number indicates the relative amount of light that passes through the lens aperture. As the F-stop setting increases, the aperture and the brightness of the image decrease, but the depth of field (depth of focus) increases (see Figure 4.5). A typical set of lens F-stop values is 2.8,4,5.6, 8,11, and 16. For each step up in F-stop value (e.g., going from 2.8 to 4), the image brightness decreases by l/2. Adjust the F-stop to obtain the best possible image contrast, after the lens has been focused. Note: Always switch the monitor display to the “live” analog image before adjusting the camera focus or F-stop. To do this, touch the light pen to the top half of the monitor screen; repeat until the live analog image appears (assuming your VIM2 system is connected and powered up, of course see Chapter 5 for connection and power-up information). If your workpiece has features at different distances from the camera, you may need to increase the depth of field. To do this, increase the F-stop setting. If the inspected surface of the workpiece is basically two-dimensional (as in most cases), a large depth of field is not necessary, and you can use smaller F-stop settings. Note: When you change F-stop settings, you will have to adjust the brightness compensation range and threshold image settings (see Chapter 8), and/or adjust the lighting intensity in the workstage to compensate.