I want to implement Connected-Component Labeling but I'm not sure if I should do it in a 4-connected manner or 8-connected. I've read about 3 materials on it but none of them explains their choice of graph connectivity. One of them chose 8, the other two 4 and one of those two said that he chose 4 for a shorter program trace (noting that extending his pseudocode to 8 should be trivial). So, what are the merits of one over the other?
a) 4-connectivity: Two or more pixels are said to be 4-connected if they are 4-adjacent with each others. b) 8-connectivity: Two or more pixels are said to be 8-connected if they are 8-adjacent with each others. c) m-connectivity: Two or more pixels are said to be m-connected if they are m-adjacent with each others.
Connected component labeling works by scanning an image, pixel-by-pixel (from top to bottom and left to right) in order to identify connected pixel regions, i.e. regions of adjacent pixels which share the same set of intensity values V.
Connected Component Labeling (CCL) is a basic algorithm in image processing and an essential step in nearly every application dealing with object detection. It groups together pixels belonging to the same connected component (e.g. object).
Connected components, in a 2D image, are clusters of pixels with the same value, which are connected to each other through either 4-pixel, or 8-pixel connectivity.
The only real difference is how the algoritms handle diagonal configurations. With a diamond neighborhood, diagonal "in" elements wirll not be connected. With the square neighborhood they will.
You might want to treat this as an ambiguous case instead of just alwys doing one or the other. Some existing strategies will look at the actual values before binarisation and interpolate a value between the diagonal elements. This value is binarized and when it too is in, the diagonal elements are connected. Otherwise, they are not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With