Rockwell Automation 5370-CVIM2 Module User Manual

Page 445

Advertising
background image

Chapter 8

Thresholds, Filters, and Morphology

8–6

Threshold specifies the relative brightness change between neighboring
pixels, while kernel specifies the number of consecutive pixels over which
the brightness change is evaluated. The settings of threshold and kernel
interact to determine whether an edge will be detected in any one instance.

Threshold and Kernel Settings

The threshold setting (value) determines the relative brightness change
between neighboring pixels; thus, high threshold values require a large
brightness change between pixels in order to detect an edge. Conversely, low
threshold values enable edge detection with smaller brightness changes, and
are used to detect edges when low contrast exists between the desired feature
and the background.

The kernel setting (value) determines the number of consecutive pixels (the
size of the neighborhood of pixels) that the gaging tool examines to
determine whether an edge exists. Small kernel values require the brightness
change specified by the threshold value to occur over a small distance (1–3
pixels) in order for the gaging tool to detect an edge. Conversely, larger
kernel values require the brightness change to occur over a larger distance
(8–10 pixels, or more), and are useful for reducing the number of superfluous
edges that result from noise in the image.

NOTE: Increasing the kernel size will generally increase the analysis time
slightly. In some applications, however, it may actually decrease the time by
eliminating some edges. If analysis time is critical to your application, you
should be careful to note any changes to the analysis time when the kernel
size is changed.

The interactive result of the two settings is to match the kernel and threshold
characteristics of the proposed edges as closely as possible and, at the same
time, exclude as many of the superfluous, unwanted “edges” as possible.

Figure 8.5 (page 8–7) illustrate(s) the effects of different threshold values
when the kernel value is held constant. This example shows how increasing
the threshold value reduces the number of detected edges by requiring
greater and greater relative brightness changes (that is, contrast) between
neighboring pixels to detect edges. Thus, (A) shows six edges, (B) shows
two edges, and (C) shows no edges.

Figure 8.6 (page 8–8) illustrates the effects of different kernel values when
the threshold value is held constant. Thus, (A) shows a small kernel value
resulting in edges being detected at locations having a high contrast over a
small distance; (B) shows a larger kernel value adding two edges to (A) by
detecting edges over a larger distance; and, (C) shows a large kernel value
removing two of the previous edges because the contrast was not sustained
over a large enough distance (they are, in effect, filtered out).

Advertising