1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
A sequence B(b1, b2, ..., bk) of boundary pixels i.e. the contour line.
We define M(p) to be the Moore neighborhood of pixel p, c denotes the current pixel under consideration i.e. c is in M(p).
Begin
Set B to be empty.
From bottom to top and left to right scan the cells of T until a black pixel, s, of P is found.
Insert s in B.
Set the current boundary point, p, to s i.e. p = s.
Set c to be the next clockwise pixel in M(p).
While c is not in B do
If c is black
Insert c in B.
Set p=c.
End if
Advance c to the next clockwise pixel in M(p).
End while
Set B to be empty.
Insert s in B.
Set p=s.
Set c to the next anticlockwise pixel in M(p).
While c is not in B do
If c is black
Insert c in B.
Set p=c.
End if
Advance c to the next anticlockwise pixel in M(p).
End while
End |
Partager