Implementations of connected component labeling algorithms for binary images. Currently, there are two algorithms implemented - recursive and union-find. Both of these implementations are based on the pseudocode described in Shapiro and Stockton's Computer Vision text. To ensure contiguous labels in the union-find implementation, there is one additional post-processing step.
Some example outputs can be seen below.
python -l union IMAGE1 IMAGE2 IMAGE3
python -l recursive IMAGE1 IMAGE2
python --labeler union IMAGE1
python --labeler recursive IMAGE1
Default labeler is union
, and default images are the images in test_data
directory.
I believe there are a few bugs in these implementations which need to be addressed - will need to revisit.