Rockwell Automation 5370-CVIM2 Module User Manual

Page 331

Advertising
background image

5

Chapter

Chapter 7

Inspection Tools

7–93

Figure 7.76 Example: Neighborhood Operation in Image Tool

0

0

0

32

28

27

31

27

28

33

29

28

33

27

29

31

28

29

32

27

29

58

57

55

31

27

28

91

89

88

77

78

76

91

89

90

90

90

91

89

91

90

90

90

91

89

90

90

89

90

89

90

91

91

–4

–4

1

1

3 –108 –193–131 –55 –4

0

0

5

1

–6

3x3 matrix of

Raw values:

Portion of image field within image tool

–114

359

–1

–1

0

0

1

–27 –48 –33 –14 –1

0

0

1

0

–2

Raw values

–29

100

divided by 4:

127 127 128 128 129 101

80

95 114 127 128 128 129 128 126

*128 added

99

228

to all values:

Sobel X kernel

*Values processed

through “Sign” LUT

–1

–1

–2

1

1

2

Note that the original gray scale values of the pixels in the second row are in
the 20’s and 30’s on the left side of the image. In the middle of the image,
these values increase abruptly to the 80’s and 90’s on the right side. This
discontinuity is the location of a vertically aligned gradient in the image. (In
this example, it is meant to represent a vertical edge on an inspected object.)

In the example, the Sobel X kernel moves left–to–right along the second row
of pixels and calculates new raw values for each pixel along the way. Since
these raw values could potentially range from –1020 to +1020, the CVIM2
system automatically scales them to the –128 to 127 range.

The CVIM2 system provides optional look–up table (LUT) mapping
functions that can convert all of the values to positive values. Figure 7.76
shows the result of using the “sign” LUT (which adds 128 to each value). In
the example, the result would be a displayed image in which the gradient
(edge) would appear as a dark vertical stripe with areas of medium gray on
both sides. Thus, the gradient values are 101, 80, 95, and 114, while the areas
on both sides are nominally 128. (For more information about LUT mapping
functions, see the Image Tool Look–Up Table (LUT) section on page 7–95 of
this chapter.)

NOTE: In Figure 7.76, the values calculated for all of the border pixels
differ from the non–border pixels because they are calculated with some of
the kernel’s coefficients “out of bounds.” Those coefficients are set to zero,
and the result is raw values of –114 and 359 for the leftmost and rightmost
pixels in the second row (compared to the near–zero values elsewhere, away
from the gradient). Therefore, when the image tool is used as an image
source for a window tool, the window tool should be sized and positioned
away from the image borders in order to avoid distorting effects that may
arise from the inclusion of the image’s border pixels.

Advertising