Area tools: threshold and morphology functions – Rockwell Automation 5370-CVIM2 Module User Manual

Page 448

Advertising
background image

5

Chapter

Chapter 8

Thresholds, Filters, and Morphology

8–9

There are two methods by which you can alter the processed image within a
window: setting binary thresholds, and setting morphology parameters.

Binary Threshold Function

Your main objective in setting the binary thresholds is to optimize the
binarized workpiece image within the window in order to produce the most
accurate and repeatable pixel count or object count. If optimizing these
binary thresholds does not yield an acceptable workpiece image for your
application, you can use the powerful morphology function to further “fine
tune” the workpiece image.

NOTE: The binary thresholding function for the black pixel–counting
window operation
works in the opposite sense from the way it works for the
other binary window operations. Its operation is described separately.

High threshold –– Any part of that image whose gray–scale brightness value
is higher than the high threshold value will appear black in the window. For
example, if the high threshold is 190, any part of the image whose brightness
value is higher than 190 will appear black in the window.

Low threshold –– Any part of that image whose gray–scale brightness value
is lower than the low threshold value will appear black in the window. For
example, if the low threshold is 140, any part of the image whose brightness
value is lower than 140 will appear black in the window.

The interactive result of the two threshold settings is this: Any part of the
window image whose brightness value is between the high and low threshold
values will appear white in the window. (In the examples above, this would
apply to brightness values from 140 to 190.)

For most applications, set the high threshold at 255. Figure 8.7 (page 8–10)
illustrates the effects of changing the low threshold. Thus, (A) shows the
unprocessed gray scale image; (B) shows a low threshold value of 3; (C)
shows a low threshold value of 30; and, (D) shows a low threshold value of
124.

Area Tools: Threshold and
Morphology Functions

Advertising