25
Figure 10.6.
Lightness value changes along two lines of adjacent pixels from 50 to 240 and from 70 to 220.
Figure 10.5.
Visualisation of the Canny edge detection algorithm. Points in green are accepted as edges, and points in red are rejected.
Sometimes a line of pixels does contain an edge, but it can’t be detected as the lightness gradients within it
all fall below threshold 1. Threshold 2 is set lower than threshold 1 to catch lines of pixels where this occurs. If
the line has a lightness gradient that passes threshold 2 and is adjacent to a line which passes threshold 1, it
will also be counted as an edge.
This is demonstrated in
Figure 10.6
, where the gradient change in the bottom row of pixels does not pass
threshold 1 but does pass threshold 2. As it is adjacent to the top row which does pass threshold 1, it is still
counted as an edge. Rows adjacent to this row that pass threshold 2 will also be counted as edges (point b in
Figure 10.5
).
Figure 10.7.
Canny edge detection threshold controls. Defaults thresholds are set to 200 and 100.
If a row falls below threshold 2, it is never counted as an edge (point c). Point d) also fails, as it is not connected
to a row that has passed threshold 1.
Threshold 1 and 2 can be adjusted using sliders within the software. To access the threshold sliders, click the
settings button next to the ‘Show Edges’ button. This will open a new window, as shown in
Figure 10.7.
Содержание L2004A1
Страница 29: ......