|
Algorithm 4
UpdateDataStructures
|
-
1:
ifthen ▹Object pixel
-
2:
if
then
-
3:
if
then ▹ Merger operation
-
4:
if
then ▹ Propagating merger
-
5:
▹ Assign representative label
-
6:
-
7:
▹ Update neighbourhood label
-
8:
else
-
9:
▹ Assign representative label
-
10:
-
11:
end if
-
12:
▹ Record merger in table
-
13:
▹ Merge data (and active tags)
-
14:
▹ Recycle the old label
-
15:
else if
then ▹ New label operation
-
16:
() ▹ From a recycle queue
-
17:
▹ Augment label with row number
-
18:
▹ Initialise merger table
-
19:
▹ Start feature vector
-
20:
else
-
21:
if
then ▹ Copy
-
22:
-
23:
else ▹ Copy
-
24:
-
25:
end if
-
26:
▹ Add current pixel to data table
-
27:
end if
-
28:
else ▹ Copy
-
29:
-
30:
▹ Add current pixel to data table
-
31:
end if
-
32:
else
-
33:
▹ Background pixel
-
34:
if
then ▹ Check completed object
-
35:
Output:
-
36:
▹ Recycle the label
-
37:
end if
-
38:
end if
-
39:
▹ Save label in row buffer for next row
|