原文:http://blogs.mathworks.com/steve/2007/03/13/connected-component-labeling-part-2/
In this series I'm discussing different ways to compute the connected components of a binary image. Before I get into specific algorithms, though, I need to touch briefly on the notion of connectivity.
conn4 = [0 1 0; 1 1 1; 0 1 0]
conn4 =
0 1 0
1 1 1
0 1 0
conn8 = [1 1 1; 1 1 1; 1 1 1]
conn8 =
1 1 1
1 1 1
1 1 1