written 6.3 years ago by |
Consider a pixel p(x, y). This pixel p has two horizontal and two vertical neighbors which share a surface with p(x, y). This set of four pixels is known as the 4-neighbourhood of pixel p(x, y), where each pixel is said to be at a unit distance from p(x, y). This set of pixels is denoted as N4(p).
In a similar manner, apart from these 4-neighbours, there are another four diagonal pixels which touch p(x, y) at the corners No(p). This set of eight pixels (The 4-neighbours as well as the diagonal pixels) is called the a-neighborhood of pixel p(x, y) and is denoted as N8(p).
To establish if two pixels are connected, it must be determined whether they are neighbors (4-neighbours or a-neighbors) and if their grey levels satisfy a specified criterion.
Two regions that touch only .at a corner can be considered to be a single region or two distinct regions: How they are considered depends on the definition of connectivity used.
Two pixels p and q with some common criteria are said to be 4-connected if they share a side i.e. two pixels p and q with some common criteria are 4-connected if q is in the set N4(p).
Two pixels P and q with some common criteria are said to be. 8-connected if they share either a side or a comer, i.e., two-pixel q and q with some common criteria are 8-connected if q is in the set N8(p).
Let us take an example. Given the criteria that. p = q = 1 for the region to be connected, check whether the two region S1 and S2 are connected. Even though p and q are both equal to one, these two regions will not be shown connected, if we use a 4-connectivity algorithm. This is because, in the 4-connectivity algorithm, we only check the 4-neighbours and see if any of these four neighbors has a pixel with the same value 1, in this case.
If we use an 8-connectivity algorithm, S1 and S2 would be shown as -a single connected region. Apart from 4-connectivity and a-connectivity, we also have m-adjacent or in connectivity (mixed connectivity). It is used to eliminate the couple paths that arise when we use 8-connectivity.