Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

4-connected vs 8-connected in Connected Component Labeling. What is/are the merit/s of one over the other?

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?

like image 296
skytreader Avatar asked Aug 17 '11 06:08

skytreader


People also ask

What are 4 connectivity and 8 connectivity?

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.

How does connected components work?

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.

What is image component labeling?

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).

What are connected components in image processing?

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.


1 Answers

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.

like image 158
ltjax Avatar answered Sep 27 '22 19:09

ltjax