pixel connectivity

{{Graph connectivity sidebar}}

In image processing, pixel connectivity is the way in which pixels in 2-dimensional (or hypervoxels in n-dimensional) images relate to their neighbors.

Formulation

File:5x5x5 connectivity.png

In order to specify a set of connectivities, the dimension {{mvar|N}} and the width of the neighborhood {{mvar|n}}, must be specified. The dimension of a neighborhood is valid for any dimension n\geq1. A common width is 3, which means along each dimension, the central cell will be adjacent to 1 cell on either side for all dimensions.

Let M_N^n represent a N-dimensional hypercubic neighborhood with size on each dimension of n=2k+1, k\in\mathbb{Z}

Let \vec{q} represent a discrete vector in the first orthant from the center structuring element to a point on the boundary of M_N^n. This implies that each element q_i \in \{0,1,...,k\} ,\forall i \in \{1,2,...,N\} and that at least one component q_i = k

Let S_N^d represent a N-dimensional hypersphere with radius of d=\left \Vert \vec{q} \right \Vert.

Define the amount of elements on the hypersphere S_N^d within the neighborhood M_N^n as {{mvar|E}}. For a given \vec{q}, {{mvar|E}} will be equal to the amount of permutations of \vec{q} multiplied by the number of orthants.

Let n_j represent the amount of elements in vector \vec{q} which take the value {{mvar|j}}. n_j = \sum_{i=1}^N (q_i=j)

The total number of permutation of \vec{q} can be represented by a multinomial as \frac{N!} {\prod_{j=0}^kn_j!}

If any q_i = 0

, then the vector \vec{q} is shared in common between orthants. Because of this, the multiplying factor on the permutation must be adjusted from 2^{N}

to be 2^{N-n_0}

Multiplying the number of amount of permutations by the adjusted amount of orthants yields,

:E=\frac{N!}{\prod_{j=0}^kn_j!}2^{N-n_0}

Let {{mvar|V}} represent the number of elements inside of the hypersphere S_N^d within the neighborhood M_N^n. {{mvar|V}} will be equal to the number of elements on the hypersphere plus all of the elements on the inner shells. The shells must be ordered by increasing order of \left \Vert \vec{q} \right \Vert = r. Assume the ordered vectors \vec{q} are assigned a coefficient {{mvar|p}} representing its place in order. Then an ordered vector \vec{q}_{p}, p \in \left\{1, 2, ..., \sum_{x=1}^k (x+1)\right\} if all {{mvar|r}} are unique. Therefore {{mvar|V}} can be defined iteratively as

:V_{\vec{q}_{p}} = V_{\vec{q}_{p-1}} + E_{\vec{q}_{p}}, V_{\vec{q}_{0}}=0,

or

:V_{\vec{q}_{p}} = \sum_{x=1}^p E_{\vec{q}_{x}}

If some \left \Vert \vec{q}_{x} \right \Vert = \left \Vert \vec{q}_{y} \right \Vert, then both vectors should be considered as the same {{mvar|p}} such that

V_{\vec{q}_{p}} = V_{\vec{q}_{p-1}} + E_{\vec{q}_{p,1}} + E_{\vec{q}_{p,2}}, V_{\vec{q}_{0}}=0

Note that each neighborhood will need to have the values from the next smallest neighborhood added. Ex. V_{\vec{q}=(0,2)} = V_{\vec{q}=(1,1)} + E_{\vec{q}=(0,2)}

{{mvar|V}} includes the center hypervoxel, which is not included in the connectivity. Subtracting 1 yields the neighborhood connectivity, {{mvar|G}}

:G=V-1{{Cite book|last=Jonker|first=Pieter|title=Morphological Image Processing: Architecture and VLSI design|publisher=Kluwer Technische Boeken B.V.|year=1992|isbn=978-1-4615-2804-3|pages=92–96}}

= Table of Selected Connectivities =

class="wikitable" style="text-align:center"

|+

!Neighborhood
Size:

M^n_N

!Connectivity
Type

!Typical
Vector:

\vec{q}

!Sphere
Radius:

{{nobold|{{mvar|d}}}}

!Elements
on Sphere:

{{nobold|{{mvar|E}}}}

!Elements
in Sphere:

{{nobold|{{mvar|V}}}}

!Neighborhood
Connectivity:

{{nobold|{{mvar|G}}}}

1

|edge

|(0)

|{{Square root|0}}

|1{{times}}1 = 1

|1

|0

3

|point

|(1)

|{{Square root|1}}

|1{{times}}2 = 2

|3

|2

5

|point-point

|(2)

|{{Square root|4}}

|1{{times}}2 = 2

|5

|4

colspan="7" |...
1{{times}}1

|face

|(0,0)

|{{Square root|0}}

|1{{times}}1 = 1

|1

|0

rowspan="2" |3{{times}}3

|edge

|(0,1)

|{{Square root|1}}

|2{{times}}2 = 4

|5

|4

point

|(1,1)

|{{Square root|2}}

|1{{times}}4 = 4

|9

|8

rowspan="3" |5{{times}}5

|edge-edge

|(0,2)

|{{Square root|4}}

|2{{times}}2 = 4

|13

|12

point-edge

|(1,2)

|{{Square root|5}}

|2{{times}}4 = 8

|21

|20

point-point

|(2,2)

|{{Square root|8}}

|1{{times}}4 = 4

|25

|24

colspan="7" |...
1{{times}}1{{times}}1

|volume

|(0,0,0)

|{{Square root|0}}

|1{{times}}1 = 1

|1

|0

rowspan="3" |3{{times}}3{{times}}3

|face

|(0,0,1)

|{{Square root|1}}

|3{{times}}2 = 6

|7

|6

edge

|(0,1,1)

|{{Square root|2}}

|3{{times}}4 = 12

|19

|18

point

|(1,1,1)

|{{Square root|3}}

|1{{times}}8 = 8

|27

|26

rowspan="6" |5{{times}}5{{times}}5

|face-face

|(0,0,2)

|{{Square root|4}}

|3{{times}}2 = 6

|33

|32

edge-face

|(0,1,2)

|{{Square root|5}}

|6{{times}}4 = 24

|57

|56

point-face

|(1,1,2)

|{{Square root|6}}

|3{{times}}8 = 24

|81

|80

edge-edge

|(0,2,2)

|{{Square root|8}}

|3{{times}}4 = 12

|93

|92

point-edge

|(1,2,2)

|{{Square root|9}}

|3{{times}}8 = 24

|117

|116

point-point

|(2,2,2)

|{{Square root|12}}

|1{{times}}8 = 8

|125

|124

colspan="7" |...
1{{times}}1{{times}}1{{times}}1

|hypervolume

|(0,0,0,0)

|{{Square root|0}}

|1{{times}}1 = 1

|1

|0

rowspan="4" |3{{times}}3{{times}}3{{times}}3

|volume

|(0,0,0,1)

|{{Square root|1}}

|4{{times}}2 = 8

|9

|8

face

|(0,0,1,1)

|{{Square root|2}}

|6{{times}}4 = 24

|33

|32

edge

|(0,1,1,1)

|{{Square root|3}}

|4{{times}}8 = 32

|65

|64

point

|(1,1,1,1)

|{{Square root|4}}

|1{{times}}16 = 16

|81

|80

colspan="7" |...

= Example =

Consider solving for G|\vec{q}=(0,1,1)

In this scenario, N=3 since the vector is 3-dimensional. n_0=1 since there is one q_i=0. Likewise, n_1=2. k=1, n=3 since \max q_i = 1. d=\sqrt{0^2 + 1^2 + 1^2}=\sqrt{2}. The neighborhood is M^3_3 and the hypersphere is S_3^\sqrt{2}

:E=\frac{3!}{1!*2!*0!}2^{3-1}=\frac{6}{2}4=12

The basic \vec{q} in the neighborhood N^3_3, \vec{q}_{1} = (0,0,0). The Manhattan Distance between our vector and the basic vector is \left \Vert \vec{q} - \vec{q}_{0} \right \Vert_1 = 2, so \vec{q} = \vec{q}_{3}. Therefore,

:G_{\vec{q}_{3}} = V_{\vec{q}_{3}} - 1 = E_{\vec{q}_{1}} + E_{\vec{q}_{2}} + E_{\vec{q}_{3}} - 1 = E_{\vec{q}=(0,0,0)} + E_{\vec{q}=(0,0,1)} + E_{\vec{q}=(0,1,1)}

:E_{\vec{q}=(0,0,0)} = \frac{3!}{3!*0!*0!}2^{3-3} = \frac{6}{6}1 = 1

:E_{\vec{q}=(0,0,1)} = \frac{3!}{2!*1!} 2^{3-2}=\frac{6}{2} 2 = 6

:G = 1 + 6 + 12 - 1 = 18

Which matches the supplied table

= Higher values of k & N =

The assumption that all \left \Vert \vec{q}_{p} \right \Vert = r are unique does not hold for higher values of k & N. Consider N=2, k=5, and the vectors \vec{q}_{A}=(0,5), \vec{q}_{B}=(3,4). Although \vec{q}_{A} is located in M_2^5, the value for r=25, whereas \vec{q}_{B} is in the smaller space M_2^4 but has an equivalent value r=25. \vec{q}_{C}=(4,4) \in M_{2}^{4} but has a higher value of r=32 than the minimum vector in M_2^5.

For this assumption to hold, \begin{cases} N=2, k \leq 4 \\ N=3, k \leq 2 \\ N=4, k \leq 1 \end{cases}

At higher values of {{mvar|k}} & {{mvar|N}}, Values of {{mvar|d}} will become ambiguous. This means that specification of a given {{mvar|d}} could refer to multiple \vec{q}_{p} \in M_n^N.

Types of connectivity

=2-dimensional=

==4-connected==

4-connected pixels are neighbors to every pixel that touches one of their edges. These pixels are connected horizontally and vertically. In terms of pixel coordinates, every pixel that has the coordinates

: \textstyle(x\pm1, y) or \textstyle(x, y\pm1)

is connected to the pixel at \textstyle(x, y).

{{See also|Von Neumann neighborhood}}

== 6-connected ==

6-connected pixels are neighbors to every pixel that touches one of their corners (which includes pixels that touch one of their edges) in a hexagonal grid or stretcher bond rectangular grid.

There are several ways to map hexagonal tiles to integer pixel coordinates. With one method, in addition to the 4-connected pixels, the two pixels at coordinates \textstyle(x+1,y+1) and \textstyle(x-1,y-1) are connected to the pixel at \textstyle(x,y).

==8-connected==

8-connected pixels are neighbors to every pixel that touches one of their edges or corners. These pixels are connected horizontally, vertically, and diagonally. In addition to 4-connected pixels, each pixel with coordinates \textstyle(x\pm1,y\pm1) is connected to the pixel at \textstyle(x,y).

{{See also|Moore neighborhood}}

=3-dimensional=

==6-connected==

6-connected pixels are neighbors to every pixel that touches one of their faces. These pixels are connected along one of the primary axes. Each pixel with coordinates \textstyle(x\pm1, y, z), \textstyle(x, y\pm1, z), or \textstyle(x, y, z\pm1) is connected to the pixel at \textstyle(x, y, z).

==18-connected==

18-connected pixels are neighbors to every pixel that touches one of their faces or edges. These pixels are connected along either one or two of the primary axes. In addition to 6-connected pixels, each pixel with coordinates \textstyle(x\pm1, y\pm1, z), \textstyle(x\pm1, y\mp1, z), \textstyle(x\pm1, y, z\pm1), \textstyle(x\pm1, y, z\mp1), \textstyle(x, y\pm1, z\pm1), or \textstyle(x, y\pm1, z\mp1) is connected to the pixel at \textstyle(x, y, z).

==26-connected==

26-connected pixels are neighbors to every pixel that touches one of their faces, edges, or corners. These pixels are connected along either one, two, or all three of the primary axes. In addition to 18-connected pixels, each pixel with coordinates \textstyle(x\pm1, y\pm1, z\pm1), \textstyle(x\pm1, y\pm1, z\mp1), \textstyle(x\pm1, y\mp1, z\pm1), or \textstyle(x\mp1, y\pm1, z\pm1) is connected to the pixel at \textstyle(x, y, z).

See also

References

{{Reflist}}

  • {{Citation | author=A. Rosenfeld, A. C. Kak | title=Digital Picture Processing | publisher=Academic Press, Inc.| year=1982 | isbn=0-12-597302-0 }}
  • {{Citation

| url = http://www.mathworks.com/access/helpdesk_r13/help/toolbox/images/morph12.html

| title = Subband Weighting With Pixel Connectivity for 3-D Wavelet Coding

| year = 2009

| journal = IEEE Transactions on Image Processing

| pages = 52–62

| volume = 18

| issue = 1

| doi = 10.1109/TIP.2008.2007067

| accessdate = 2009-02-16

| pmid = 19095518

| last1 = Cheng

| first1 = CC

| last2 = Peng

| first2 = GJ

| last3 = Hwang

| first3 = WL

| bibcode = 2009ITIP...18...52C

}}

  • {{Citation

| url = http://homepages.inf.ed.ac.uk/rbf/HIPR2/connect.htm

| title = Subband Weighting With Pixel Connectivity for 3-D Wavelet Coding

| year = 2009

| journal = IEEE Transactions on Image Processing

| pages = 52–62

| volume = 18

| issue = 1

| doi = 10.1109/TIP.2008.2007067

| accessdate = 2009-02-16

| pmid = 19095518

| last1 = Cheng

| first1 = CC

| last2 = Peng

| first2 = GJ

| last3 = Hwang

| first3 = WL

| bibcode = 2009ITIP...18...52C

}}

Category:Digital topology

Category:Graph connectivity