|
Algorithm 1 Cascading flood-fill |
| 1: procedure
GET_SEED() |
▹ Seeds initial values. |
| 2:
|
▹ Get center for . |
| 3: ∅ |
|
| 4:
|
▹ Find closest max pixel within bounds. |
| 5: if
then
|
|
| 6:
|
▹ Set seed to box
|
| 7: return
|
▹ Return seed if value greater than
|
| 8: end if
|
|
| 9: return ∅ |
▹ No valid seed was found. |
| 10: end procedure
|
|
| 11: procedure
FILL_NEIGHBOURS() |
▹ Recursively fill free neightbours with same or lower values. |
| 12: for each
do
|
▹ For every neighboring mask pixel. |
| 13: if
then
|
|
| 14:
|
▹ Set neighbor to same as . |
| 15:
|
▹ Call recursively. |
| 16: end if
|
|
| 17: end for
|
|
| 18: end procedure
|
|
| 19:
|
▹ Sort bounding boxes by confidence. |
| 20: for each
do
|
▹ For each bounding box b
|
| 21:
|
|
| 22: if
∅ then
|
|
| 23:
|
|
| 24: end if
|
|
| 25: end for
|
|