Connected-component labeling in binary images: simple example of blob finding

Define 8x8 binary test image

tst = {{1, 1, 0, 1, 1, 1, 0, 1}, {1, 1, 0, 1, 0, 1, 0, 1}, {1, 1, 1, 1, 0, 0, 0, 1}, {0, 0, 0, ... 1, 1, 0, 1, 0, 1}, {0, 0, 0, 1, 0, 1, 0, 1}, {1, 1, 0, 1, 0, 0, 0, 1}, {1, 1, 0, 1, 0, 1, 1, 1}} ;

ShowImage[BlobImage[Reverse[tst]] , 20] ;

[Graphics:../HTMLFiles/index_4.gif]

After first pass of blob-finding algorithm

Same color denotes partially connected region.

tstb1 = BlobPass1[tst] ; ShowImage[BlobImage[tstb1]//Reverse, 20] ; BlobCount[tstb1]

[Graphics:../HTMLFiles/index_6.gif]

7

After second pass of blob-finding algorithm

Same color denotes fully connected region.

tstb = BlobFind[tst] ; ShowImage[BlobImage[tstb] // Reverse, 20] ; BlobCount[tstb]

[Graphics:../HTMLFiles/index_9.gif]

5


Created by Mathematica  (February 5, 2004)