Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Seed Fill Algorithm

• Assumes that at least one pixel inside the polygon or region is known,
called as Seed Pixel
• Regions may be interior defined or boundary defined
• Interior defined- all the pixels interior to the polygon are of one value
and all outside the region are of another value (Flood fill algorithms)
• Boundary defined region- all the pixel on the region boundary are of
unique color. None of the pixels interior to the region can have this
unique color. All the exterior to the region can have boundary
value.(Boundary fill algorithms)
Seed Fill Algorithm
• 4-connected region and 8-connected region
• 4-connected region: every pixel in the region can be reached by a
combination of moves in only four directions left, right, up and
down.
• 8-connected region: every pixel in the region can be reached by a
combination of moves in two horizontal, two vertical and four
diagonal directions.
Seed Fill Algorithm
8
7
6
5
4
3
2
1
0
0 1 2 3 4 5 6 7 8 9 10 11
Seed Fill Algorithm
• Disadvantage:
– Stack can become quite large
– Stack frequently contains duplicate or unnecessary information

You might also like