Image Processing Reference
In-Depth Information
Fig. 7.3 The grass-fire algorithm. The “big” numbers indicate the order in which the neighbors
are visited. The small numbers indicate the label of a pixel
Firstly, in the output image it gives this pixel an object label (basically a number)
and secondly it “burns” the pixel in the input image by setting it to zero (black).
Setting it to zero indicates that it has been burned and will therefore not be part
of yet another fire. In the real grass field the fire will spread simultaneously in all
directions. In the computer, however, we can only perform one action at the time
and the grass-fire is therefore performed as follows.
Let us apply the principle on Fig. 7.3 . The pixel at the coordinate ( 2 , 0 ) is labeled
1, since it is the first BLOB and then burned (marked by a 1 in the lower right
corner). Next the algorithm tries to start a fire at the first neighbor ( 3 , 0 ) , by checking
if it is an object pixel or not. It is indeed an object pixel and is therefore labeled 1
(same object) and “burned”. Since ( 3 , 0 ) is an object pixel, it now becomes the
center of attention and its first neighbor is investigated ( 4 , 0 ) . Again, this is an object
pixel and is therefore labeled 1, “burned” and made center of attention. The first
neighbor of ( 4 , 0 ) is outside the image and therefore per definition not an object
pixel. The algorithm therefore investigates its second neighbor ( 4 , 1 ) . This is not an
object pixel and the third neighbor of ( 4 , 0 ) is therefore investigated ( 3 , 0 ) . This has
been burned and is therefore no longer an object pixel. Then the last neighbor of
Search WWH ::




Custom Search