Algorithm 1.
//for every cell p |
for all p in the image |
//copy the previous state |
label_new = label; |
strength_new = strength; |
// all neighbors q of p attack |
for all q neighbors |
if [attack_force*strength (q)>strength_new (p)] |
label_new (p) = label (q) |
strength_new (p) = strength_new (q) |
end if |
end for |
end for |