The text of a manual · part 4 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 3 - Theory of Operation
Pages 31 to 42 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 31
Chapter
Chapter Objectives
3
Theory of Operation
This chapter describes some basic principles of machine vision inspection theory, and provides an overview of how the VIM2 module inspection tools work.
The VIM2 Module Imaging Process
The VIM2 module is designed to receive input from a solidstate video camera. The camera collects light using thousands of light-sensitive elements. Collectively, the light seen in these elements forms the “image” used by the VIM2 module for inspection.
Characteristics of Images
The video image seen on the monitor is made up of many small picture elements referred to as “pixels.” The pixels are arranged in a rectangular array consisting of horizontal rows of pixels and vertical columns of pixels (see Figure 3.1). Figure 3.1 Pixels Arranaed in Rows and Columns
RO, CO Vertical Columns
252 R252 c254 f
Page 32
Chapter
3-2
ChJrJcteristics of images (continued)
3
Theory of Operation
The Camera Array The camera is set up so that the image of a workpiece is focused on the camera’s array of light sensitive elements. Each element responds with an electrical signal corresponding to the intensity of the light which falls upon it. These signals are then sent to the VIM2 module. The Camera Scanning Process The camera scans the light sensitive elements and transfers the readings to the VIM2 module using a “raster scan” method. The scan starts at the upper left-hand corner of the array and moves horizontally across the top row of pixels. It then scans across row two in the same manner. This raster scanning process continues until all of the rows are scanned. Figure 3.2 lmaae
Scannina
Pattern and lmaae
Coordinates
0.0 b\ *
-Y D I R E C T I 0 N
I +Y 252,233 -x
+
+
+x
DIRECTION
Image Coordinates Features within the video image are located in terms of Xand Y-coordinates. The coordinate references allow the VIM2 to track feature positions and measurements (see Figure 3.2). The X-coordinate designates the pixel column. X-coordinate values increase moving to the right of the screen. The Y-coordinate designates the pixel row. The Ycoordinate values increase moving toward the bottom of the screen. All X- and Y-coordinate values are positive.
Page 33
Chapter
Gray Level Con version
3
Theory of Operation 3-3
Analog values for brightness are collected by each light sensitive element in the camera’s array. These analog values are converted to digital values by the VIM2 module. This is called analog-to-digital (A/D) conversion. The VIM2 module assigns digital brightness values, or “gray levels,” to corresponding pixels in the rows and columns of monitor image to create a “gray-level image.” Each pixel in the image has a a specific level of brightness which corresponds to the gray level value it is assigned. The A/D conversion process creates a range of brightness levels corresponding to the range of pixel values present in the image - from black, through a wide range of gray values, to white. A gray-level image is characterized by the number of levels of brightness that can be represented; for the VIM2, this is 256. To see how gray-level conversion works, let’s look at how a simpler, 4-level converter might work. Suppose an image is collected by the camera and sent to the A/D converter, which is designed to convert each analog image signal into one of four gray levels (see Figure 3.3). Each of these gray levels represents a specific measure of brightness. All dark gray and black analog signals collected by the camera are converted to a value of 0, for black. All signals in the medium range of gray are converted to a value of 1, for medium gray. Lighter gray signals are assigned a value of 2, and very light and white values, 3, for white. Each pixel in the resulting video image would have an assigned brightness, or gray level, of 0, 1,2, or 3. No other, intermediate grays would appear in the image. Figure 3.3 Four Grav Level Values
1
Value
Page 34
Chapter 3-4
The VIM2 Module Gray Levels
3
Theory of Operation
The VIM2 module converts brightness to 256 gray levels. (Note: This is called Y-bit” gray scale, because 256 different values for each pixel can be encoded by using one byte (8 bits) per pixel). Images displayed using 256 gray levels look very much like analog black and white television images, with a wide range of grays in the image. Figure 3.4 shows a gray-level image. This type of image, although based on digital gray-level values, is called “analog” in this manual, because of its resemblance to an analog image. Figure 3.4 Gray-level (Analog) Image
87-281-6
Threshold hages
The VIM2 module uses “threshold” images for image processing, which simplifies image-processing tasks. In threshold images, all pixels are assigned only one bit of information: 0 or 1 -black or white. In creating threshold image from the gray-level image from the camera, all pixels are converted to one of two colors black or white. To accomplish this, a “threshold level” value is used. This threshold level is the dividing line used to determine which gray levels are converted to black, and which are converted to white. All gray-level values below or equal to the threshold are converted to 0 (black) and values above the threshold are converted to 1 (white). The resultant “threshold” image shows only black and white pixels.
Page 35
Chapter
3
Theory of Operation 3-5
Threshold images (continued) Figure 3.5 Threshold Image With a Low Threshold
Level
87-281-8
The threshold setting can alter the appearance of the image substantially. As the threshold is increased, the image becomes darker; more gray values fall below the threshold and take on the 0 (black) value. As the threshold is decreased, the image becomes lighter; more gray values fall above the threshold and take on the 1 (white) value. Varying the threshold can have the effect of enhancing certain image features, and/or detracting from the appearance of certain image features. The ability to vary the threshold provides flexibility to allow you to enhance features of interest. The VIM2 allows you to set up to four different threshold values for image inspection (see “Setting Threshold Images” in Chapter 8).
Page 36
Chapter 3-6
The Inspection Tools: Line Gages and Windows
3
Theory of Operation
The VIM2 module performs inspections through the use of vision inspection “tools” - line gages and windows - and utilizes other tools as well, such as math tools, and the brightness probe. This section discusses the theory of operation for the line gages and windows. You can use up to 22 line gages for measurement, and two more (the X and Y float gages) can be used for shift compensation. You can use up to four windows.
SettingAccep~anceRanges
Line gages
When setting up an inspection tool, you assign an acceptance (“Hi/Lo”) range for that tool. You set a low limit value and a high limit value for the inspection result. If the measured value for a particular tool falls within the preset acceptance range for the tool, that tool passes inspection. If the value falls beyond the range, the tool fails. A tool failure causes the VIM2’s Decision output to indicate a Reject.
The line gages operate by inspecting a predefined segment of pixels in a row or column in the video image. Line gages are either horizontal or vertical. A horizontal line gage inspects a specified segment of a pixel row. A vertical line gage inspects a specified segment of a pixel column. Some basics of line gage operation are previewed here. Figure 3.6 Pixels and Corremondina
Diaital Values
Horizontal Line Gage
Row of Line Gage Pixels & Corresponding Digital Values
Page 37
Chapter
3
Theory of Operation 3-7
Figure 3.6 shows an example of a horizontal line gage positioned over the perimeter of a square object in the monitor image. The pixels under the line gage are read for their values by the VIM2. The line segment from the binarized image is thus represented by a string of O’s and l’s, corresponding to the value of the pixels in the line segment.
Line gages (continued)
The line gages operate by analyzing line segments as strings of binary bits. These strings can be used to find: “blob” edge locations, “blob” widths, the number of edges, to count white and black pixels, and to count numbers of “blobs.” What is a Blob? Blobs are defined as clusters of consecutive pixels of the same color (black or white). Blobs typically correspond to features in the image that the line gage crosses (see Figure 3.7). Line gages measure blob width by counting the number of pixels in the blob, and can be set to look for either white pixel or black pixel blob groupings. Figure 3.7 Black and White “Blobs” I
Horizontal Line Gage
White Blob
Black Blob
What is an Edge? An edge is the point at which a white blob and a black blob meet. Line gages locate edges according to row or column coordinates, depending on whether the line gage is vertical or horizontal. This is why it is important to understand the screen coordinate system (see pages 3-l to 3-2). Edge location is defined as the row or column location of the first pixel at the beginning of a blob. Edges detected by horizontal line gages are located by column number. Edges detected by uertical line gages are located by row number. Line gages can be set to locate the edge for either end of a blob.
Page 38
Chapter 3-8
Line gages (con tin ued)
3
Theory of Operation
Line Gage Function - The VIM2 module offers 15 different measurement and feature counting functions based on pixel, blob, and edge detection. Each line gage used performs two measurement functions simultaneously. Line Gage Positioning image area.
- You position line gages within the
Line Gage Orientation -Line gages can be set to either vertical or horizontal orientation. Example Inspection - Stripped Wire Dimensions In the manufacture of cable harnesses, wires are cut to length, stripped, attached to connectors, and bundled together. Since the wire stripping process feeds the connector attachment process, improperly stripped wires cause jams and other problems for the connector attacher. Positive verification of proper wire stripping is thus a valuable control. Figure 3.8
In this application, a single, stripped wire end is back-lit in front of a camera so that the entire bare conductor strand and part of the insulation are visible. As shown in Figure 3.8, five horizontal line gages are positioned in order to verify that: 1. The correct wire diameter is being run; 2. The correct amount of insulation has been removed;
3. The conductor has not been severed, damaged, or bent; 4. An appropriate length of bare conductor is exposed. Since the monitor image has high contrast between the wire and its background, a single threshold image can be used for all gages. Image quality is relatively insensitive to light variations. Brightness compensation is riot necessary.
Page 39
Chapter
Windows
3
Theory of Operation 3-9
Windows are area measurement tools. Windows count the number of pixels in the area over which the window is positioned (see Figure 3.9). Each window can be set up to count either white or black pixels. You define the window size, shape, and location (see Chapter 10 for more information on windows). You can use up to four windows for your vision inspection task. In setting up a window, you learn the acceptable range for pixel count using one or more good (nominal) workpieces. The specific feature measured, such as a screw, label, or hole, provides a specific pixel count reading. The pixel count is proportional to the surface area of the feature in the window. You select the pixel color you want to count, then set an acceptance range that checks the measurement and makes an accept/reject decision. Figure 3.9 R63rtannrrlar
Windnw
Workpiece image displayed on monitor
Rectangular window placed over workpiece feature
Setting Window Shape -Each window can be set to one of several different shapes, including: a rectangular window, a right angle triangle with four possible orientations, a circular window, a “donut” window, and a “train-throughthe-lens” mask window. Window Positioning -Each window can be positioned anywhere within the image area, with this exception: the top 48 rows of the screen cannot be used for windows in some cases if brightness compensation is used (see Chapter 10 for more information). The “train-through-the-lens” windows cannot be moved.
Page 40
Chapter 3-70
Windows (continued)
3
Theory of Operation
Setting Window Size -Window sizes are individually adjusted. Note: The “train-through-the-lens” windows cannot be adjusted for size. Counting Pixels -The windows operate by counting the number of pixels (black or white) in the window. “Trainthrough-the-lens” masks count pixels which lie under white areas of the window. Donut windows count the number of pixels under the window, minus the number of pixels covered by the donut “hole.” Example Inspection -Test Punched Holes Punched hole presence/absence is a simple example of a windowing application. The task is to check for the presence/absence of a hole in a workpiece. The hole is backlit and appears as a white circle. A window is set to view the area where the hole should be found (the window is seen as the gray area over the hole in the part). If the hole is not large enough, or fails to clear through the part, there will be too few white pixels in the image. During setup, using a known good (nominal) part, the acceptance range is set to detect when there are too many or too few white pixels, and to output an accept/reject signal. Figure 3.10 shows an acceptable hole which has been set up for verification using a circular window. The “Hi-Lo” limits are set to 1100 and 1500. The actual measurement reading of this hole is 1338, indicating an acceptable hole. Figure 3.11 shows an unacceptable part. Notice that the reading is 133, which is well below the low range limit (llOO), indicating an unacceptable hole.
Page 41
Chapter
3
Theory of Operation 3-71
Windows (continued) Figure 3.10 Hole Presence Verification Using a Circular Window Image of a Properly Punched Hole
87-281-13
Figure 3.11 Hole Presence Verification Using a Circular Window Image of an Improperly Punched Hole
Page 42
Chapter 3-72
3
Theory of Operation
(This page intentionally left blank)