You are on page 1of 4

No

Dui

Simple Seedrl ALgorh.m


Asimplesee.d filL Alg.oritm USinq
SBacle
push he Seed pixe onto h e staLk
whilethe stace 1s no empBy pa
he pixelfsom sia Ck
Se the pixel to the xequired Value
o i each
foux toanected pixel adjustantt
e uren pixel check ie it is oundaru
pixel o x if has already been Set 0 he'
equire value
In ethey LaSe iunoe t_olher ise
push it onto h e sta ck

Solve the follo9eLampleusnSImple


Seed - i ll algo
oouundq yiU alao)
Pal11),P>.1), P3 L8 4)P466PslLs
The seed
pixel 1S 4,3)
Dush to se ed pt n
sBa(k.

pop seed pi

pop 4Pus 5 6 2
T AAsd ind u t 1a,s)
4Corrstd bourdary dind
otor
41 12 12

6
|5 5
3 3 3
2 2 2
2
te 20
19 22
14 14
5
o 7 13
lo
o
3 5
2 2
3
2 2 2
S3
3
T 4
38
3
S 3

2 - 9

3 T3
S2

You might also like