The text of a manual · part 29 of 42
Bulletin 5370 CVIM Configurable Vision Input Module User Manual: 8 - Inspection Tools: Windows, pages 275 to 284
Pages 275 to 284 of 390, from Bulletin 5370 CVIM Configurable 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 5370-CVIM
Page 275
Chapter
8
Inspection Tools: Windows 8-3 1
Selecting
Define Window Popup Menu and Parameters (continued)
Configuring
#Obj’s Operations (continued)
Comments
Your Action
Earlier, when you picked the #White Obj’s or #Black Obj’s menu box, the Window popup menu acquired a “new”menu box-the Define Target menu box. This selects the Define Target popup menu, which you will use to define the “target” object and set the parameters for the objects to be counted. Pi& the ‘Pick’ Target menu box.
When you pick the ‘Pick’ Target menu box, a green outline will appear around one of the objects within the window, as follows: Outline
+ White to Area
4
-
08.0 a.80
Env.
Camera A
Ref. Line
Ref. Win
Gage i@itidfB&
Mist
Exit
Look at the outlined object.
If the outlined object is not the one that you want to use as the “target” object, perform the next two steps.
Aim the light pen at the appropriate “target” object.
Aim the light pen at the whichever object you have selected as the “target” object. When the light pen “sees” the new object, a red outline will appear around that object.
Pick the new “target”
When you pick the new target object, a green outline will replace the red outline around it, and the green outline around the previous target object will disappear.
object.
Note that the top box indicates the “area” of the target object: Selected Target Area = 483. This is the number of black pixels in the target object.
Page 276
Chapter
8
Inspection Tools: Windows
8-32
Selecting Define Window Popup Menu and Parameters (continued)
Configuring
#Obj’s Operations (continued)
Your Action Look at the menu box just above the ‘Pick’ Target box.
Comments This menu box will display either + White to Area or -White from Area, according to how it was last configured. (If you had selected the #White Obj’s.operation, the menu box would display either + Black to Area or - Black from Area.) If you select + White to Area, the window will add any white pixels within an objects’s boundary and will consider an object to be solid black. Thus, an object’s size will consist of all of the pixels within its boundary. If you select-White from Area, the window will subtract the white pixels from the total number of pixels within an object’s boundary. Thus, an object’s area will consist of all of the pixels within its boundary minus the white pixels. The same process applies when you select the #White operation.
Obj’s
If this function is not currently set the way you want it, perform the next step. Otherwise, skip the next step.
If rr appropriate, pick the . . . Area” menu box.
When you pick the “. . . Area”menu box, the current status toggles to the opposite status. Thus, + White to Area will change to-white from Area, or vice versa.
Pick the + Tolerance: menu box.
When you pick the + Tolerance: menu box, the “calculator pad” will appear on the monitor screen, as follows:
Calculator Pad
Learn:
Nominal = 0 B.Objects
Env.
Camera A
Ref. Line
Ref. Win
Gage
..: $&&&~i.
Mist
Exit
Page 277
Chapter
8
Inspection
Tools: Windows 8-33
Selecting
Define Window Popup Menu and Parameters (continued)
Configuring
#Obj’s Operations (continued)
Comments
Your Action The + Tolerance in pixels.
value is the upper limit of the object’s area,
As the calculator “display” indicates, the current value of + Tolerance is 10000. This is the default value for + Tolerance. The + Tolerance menu box enables you to select the upper limit of the tolerance range within which the area of the objects can deviate from area of the “target” object and still be counted. If the target object has an area of 483 black pixels, as shown in the preceding figure, you could set the + Tolerance to, say, 525. The window will then count objects having an area no more than 525 black pixels. Pick each digit of the new ” + ” tolerance limits. Pick the Enter key. Pick the-Tolerance: menu box.
As you pick each digit, it will appear in the calculator “display.“Thus, for a value of 525, pick “5,” pick “2,” then pick “5” again. The new value will appear in the + Tolerance menu box.
The “calculator pad” will remain in its present position.
The -Tolerance in pixels.
value is the lower limit of the object’s area,
As the calculator “display” indicates, the current value of - Tolerance is 0. This is the default value for -Tolerance. The -Tolerance menu box enables you to select the lower limit of the tolerance range within which the area of the objects can deviate from area of the “target” object and still be counted. Again, if the target object has an area of 483 black pixels, as shown in the preceding figure, you could set the - Tolerance to, say, 450. The window will then count objects having an area no less than 450 black pixels. Pick each digit of the new “-” tolerance limits. Pick the Enter key.
As you pick each digit, it will appear in the calculator “display.” Thus, for a value of 450, pick “4,” pick “5,” then pick “0 .” The new value will appear in the - Tolerance menu box.
You have now set the upper and lower range limits for the size of objects to be counted. Skip the next steps and proceed to the section called Selecting Range/Reference Popup Menu and Parameters to configure the range limits, output lines, and reference tools, as appropriate for your application.
Page 278
Chapter
8
Inspection
Took:
Windows
8-34
Using Threshold/Filter
Selecting
Define Window Popup Menu and Parameter5 (continued)
Function (Pixel and Object Counts)
Select the PixeVObj Filter popup menu and thresholdadjusting slide bar, then use a combination of filter selections and threshold settings to obtain the best binary image of the desired feature(s) within the window. NOTE: The Threshold/Filter function applies only to these four window operations: #White Pixels, #Black Pixels, #White Obj’s, and #Black Obj’s. Comments
Your Action
When you pick the Threshold/Filter menu box, the PixeVObj Filter menu and slide bar appear on the monitor screen, -as follows:
Pick the Threshold/Filter menu box in the Define Window popup menu.
4 Define Op: #White
Pixels
I P&P Process Win.
l @* I
Window Popup Menu l O@ I
Pixel/Obj Filter Popup, Menu
P&P Mask Win.
0.0 Range/Reference Learn:
Nominal = 0 W. Pixels
Window
1:
Slide Bar-
+-
Window Popup Menu
3. Identity
5. Identity
Previous
Next
6. Identity
Env.
Camera A
Ref. Line
Ref. Win
Gage
L
4. Identity
Enabled
Look at the threshold cursors on each side of the slide bar.
T H R E 5 H 0 L D
2. Identity
0.0
H I
~,~i.&&$
5
Right/ Cursor ; Mist
Exit
::j.;: ,: al b -
The cursors on each side of the slide bar are the means by which you will set the initial contrast between the workpiece feature(s) to be inspected and the adjacent image area. Think of the slide bar as being a scale with 1 at the bottom and 63 at the top, where 1 represents black, 63 represents white, and all numbers in between represent shades of gray betureen black and white.
-
Page 279
Chapter
8
Inspection Tools: Windows 8-35
Selecting
Define Window Popup
Menu and
Using Threshold/Filter
Function
(PixeI and Object
Counts)
(continued)
Parameters (continued) Comments
Your Action
Think of the left cursor this way: Any part of the image within the window that is lighter than the current cursor setting will appear black in the window. Thus, if the cursor is set to 45 and some part of the image area is 46 or higher, that part will appear black in the window. Think of the right cursor this way: Any part of the image within the window that is darker than the current cursor setting will appear black in the window. Thus, if the cursor is set to 25 and some part of the image area is 24 or lower, that part will appear black in the window. Any part of the image within the window that is neither lighter than the left cursor setting, nor darker than the right cursor setting, will appear white in the window. Thus, if the left cursor is set to 45 and the right cursor is set to 25, any part of the image area within the window between those two gray values will appear white in the window. NOTE: The left cursor cannot be moved lower than the right cursor, and the right cursor cannot be moved higher than the left cursor. Pick the L&cursor.
To pick the cursor, aim the light pen at it. When you see a red box around the cursor, press the light pen tip against the monitor screen for a moment. This causes the cursor to turn yellow, indicating that you can now “drag” the cursor up and down.
Drag the left cursor to its topmost position.
This initializes the left cursor’s position to 63.
Pick and drag the right cursor to its bottommost position.
This initializes the right cursor’s position to 1.
Check wheth.er the feature to be inspected should appear black or -white Pick and drag the right cursor upward.
With the two cursors positioned this way, the image area within the window should now appear all white. If the feature to be inspected should appear black against a white background, adjust the right cursor first. On the other hand, if the feature to be inspected should appear white, adjust the left cursor first. Drag the right cursor upward until the feature to be inspected turns black and has the proper dimensions and overall appearance.
or, Pick the left cursor again and drag it downward.
Drag the left cursor downward until the feature to be inspected turns white and has the proper dimensions and overall appearance
Page 280
Chapter
8
Inspection Tools: Windows
8-36
Selecting
Define Window Popup Menu and Parameters (continued)
Using PixeI/Obj Filter Menu If the feature that you’ve defined with the cursor(s) has the proper shape, but has “noise” in it (that is, white specks in a black feature, or black specks in a white feature), you should select the Pixel/Obj Filter table and use the filter function to try to remove these specks. The filter function provides two filtering tools: l The
+ White/- Black tool, which replaces a layer of black pixels with white pixels.
l The -White/
+ Black tool, which replaces a layer of white pixels with black pixels. Identity signifies no filtering.
Here’s how you can use the filter function: Example: Assume that the feature to be inspected is white and has black “noise” in it. Assume further that you have set three successive filter table boxes (#l, 2, and 3) to + White/Black. In doing so, the white pixels in the feature expanded and the black pixels contracted - the smallest ones (that is, the “noise”) disappearing altogether. This procedure eliminated the black noise, but, at the same time, it expanded the size of the white feature. To restore the white feature to its original size, you must set the next three filter table boxes (#4,5, and 6) to -White/ + Black. This will restore the white feature, minus the black noise, to its original size. For your own application, you can experiment with various combinations of filter tools to “clean up” the feature image. Your Action
Comments
Look at the PixeVObj Filter table.
Do all six boxes read Identity? (Note that if you configured the window to count objects, box #6 will be “locked” in the White/ + Black state.)
Reset each filter table box to read Identity, ifnecessary.
If any box does not presently read Identity, pick that box successively until it does. (When you pick a box successively, it will read + White/- Black, -White/ + Black, and Identity.)
Recheck the feature shape.
When all boxes read Identity, you may have to adjust the cursors slightly to re-optimize the feature shape. If the feature shape is again acceptable, but still has “noise” in it, continue with the following steps.
Check for white noise in a a black feature.
If the noise consists of white specks in a black feature, use -White/ + Black first, then + White/- Black.
Check for black noise in a a white feature.
If the noise consists of black specks in a white feature, use + White/- Black first,, then -White/ + Black. Your objective is to either eliminate “noise” in the binary image or reduce it to an acceptable level.
Page 281
Chapter
Selecting Define Window Popup Menu and Parameters (continued)
8
Inspection
Tools: Windows
8-37
Configuring Gradient Operations If you selected the Gradient menu box in the Window Operation popup menu, continue with the following steps. Otherwise, skip this section. When a window (rectangle, ellipse, or polygon) is configured for the Gradient operation, it can locate an edge or gradient between dark and light areas inside the window. It displays the edge or gradient image as a thin band of white pixels and counts the number of white pixels in that image. The following illustration monitor screen.
shows how this looks on the
Black object on white background:
cl A
I-
Window
-
Black Object
___
White Background
White object on black background:
-
Window
6 q
Window, object, and background after setting gradient:
-
Gradient Image “band” of white pixels
Page 282
Chapter
8
Inspection Tools: Windows
8-38
Selecting
Define Window Popup Menu and. Parameters (continued)
Configuring
Gradient
Operations (continued)
A shows a black object against a white background, shows a white object against a black background.
and B
(Note that the objects and backgrounds will appear as shown in A and B only when one of the other window operations, such as #Black Pixels, is selected. When the Gradient window operation is selected, a window cannot display objects and backgrounds as shown.) C shows the gradient image - the band of white pixels surrounding the object - after the gradient threshold is properly adjusted. The objects in A and B will both appear this way following the gradient threshold adjustment. Thegradient threshold is a value, from 1 to 63, representing the difference in the gray scale values of adjacent pairs of pixels within the window. The higher the number, thegreater thegray scale difference that is required for the CVIM system to consider a pixeE pair to be a gradient. Each point in the window where the difference in the gray scale value of adjacent pairs of pixels is greater than the threshold setting is identified as a gradient. The window sets the pixels white at all of these points. Conversely, each point where the difference in the gray scale value of adjacent pairs of pixels is less than the threshold setting is not identified as a gradient. The window sets the pixels b2ack at all of these points. You can selectively turn on or turn off specific components of the gradient image, and you can also select one of two widths for the gradient image. The following illustration shows how A in the preceding illustration would appear with some components of the gradient image turned off. Black object on white background:
The overall inspection function of the Gradient window operation is to look for specified edgegradients on or around an object and, if found, count the white pixels in the resulting gradient image.
Page 283
Chapter
.-
Selecting Define Window Popup Menu and Parameters (continued)
8
Inspection Tools: Windows
8-39
Using Threshold/Filter Function (Gradient) Select the Gradient popup menu and gradient thresholdadjusting slide bar. Use the slide bar to set the gradient threshold for the best gradient image. Use the menu to select the width of the gradient image and the sides of the object on which the image is to appear. Comments
Your Action Pick the Threshold/Filter menu box in the Define Window popup menu.
When you pick the Threshold/Filter menu box, the Gradient popup menu and gradient threshold slide bar will appear, as ~oi=loWs: -
G Shape:
Rectangle
0.0
Slide Bar-
Define Window -Popup Menu
D I E N T
Gradient Popup Menu I
P&P Mask Win.
Width: Range/Reference
R A
I
0.0
T Ii R E S Ii
1
I
0 L
Cursor
D
I
Down:
Env.
Camera A
Ref. Line
Ref. Win
Gage
On
I Exit
Note that the Width value is ” 1.” This selects the narrower of the two gradient image widths. Width value “2” can be used where appropriate to enhance gradient sharpness or increase the white pixel count. Note also that the Right, Left, Up, and Down boxes are all set to “On.” This turns on all four parts of the gradient image.
Page 284
Chapter
8 inspection Tools: Windows
8-40
-. Selecting Define Window Popup Menu and Parameters (continued)
Your Action Look at the Gradient popup menu. Pick each menu box that reads “Off .” Look at the threshold cursor next to the slide bar. Pick the cursor.
Drag the cursor to its bottommost position.
Using Threshold/Filter
Function (Gradient)
(continued)
Comments The Gradient menu enables you to selectively turn on or off each of the four components of the gradient image. The menu also enables setting the image to one of two widths. Picking the “Off” menu boxes toggles them to “On.” The cursor is the means by which you will set the gradient threshold. The slide bar represents a scale with 1 at the bottom and 63 at the top. To pick the cursor, aim the light pen at it. When you see a red box around the cursor, press the light pen tip against the monitor screen briefly. This causes the cursor to turn yellow, indicating that you can now “drag” the cursor up and down. This initializes the cursor’s threshold value to 1.
Slowly, drag the cursor upward.
As you drag the cursor, watch for the gradient image in the window.
Stop the cursor when the gradient image is correct for your application.
If you drag the cursor too far upward, the entire image within the window will turn black. If this occurs, drag the cursor down again. This completes the configuration of the Gradient window operation, unless your application requires turning off some components of the gradient image. If so, continue with the following steps; if not, skip to the section called Selecting Range/Reference Popup Menu and Parameters. Using Gradient Menu The lower four menu boxes of the Gradient menu select the on or off state of the four components of the gradient image.
IDown: On
I
The terms Right, Left, Up, and Down in the menu boxes refer to the direction that each component of the gradient image faces. The four terms also refer to the search direction that the window uses to locate each component.