In image processing, pixel connectivity is the way in which pixels in 2-dimensional (or hypervoxels in n-dimensional) images relate to their neighbors.
In order to specify a set of connectivities, the dimension and the width of the neighborhood, must be specified. The dimension of a neighborhood is valid for any dimension
n\geq1
Let
n | |
M | |
N |
n=2k+1,k\inZ
Let
\vec{q}
n | |
M | |
N |
qi\in\{0,1,...,k\},\foralli\in\{1,2,...,N\}
qi=k
Let
d | |
S | |
N |
d=\left\Vert\vec{q}\right\Vert
Define the amount of elements on the hypersphere
d | |
S | |
N |
n | |
M | |
N |
\vec{q}
\vec{q}
Let
nj
\vec{q}
nj=
N | |
\sum | |
i=1 |
(qi=j)
The total number of permutation of
\vec{q}
N! | ||||||
|
If any
qi=0
\vec{q}
2N
N-n0 | |
2 |
Multiplying the number of amount of permutations by the adjusted amount of orthants yields,
E= | N! | |||||
|
N-n0 | |
2 |
Let represent the number of elements inside of the hypersphere
d | |
S | |
N |
n | |
M | |
N |
\left\Vert\vec{q}\right\Vert=r
\vec{q}
\vec{q}p,p\in\left\{1,2,...,
k | |
\sum | |
x=1 |
(x+1)\right\}
V\vec{qp
or
V\vec{qp
\left\Vert\vec{q}x\right\Vert=\left\Vert\vec{q}y\right\Vert
V\vec{q=(0,2)}=V\vec{q=(1,1)}+E\vec{q=(0,2)}
includes the center hypervoxel, which is not included in the connectivity. Subtracting 1 yields the neighborhood connectivity,
G=V-1
n | |
M | |
N |
\vec{q}
Consider solving for
G|\vec{q}=(0,1,1)
In this scenario,
N=3
n0=1
qi=0
n1=2
k=1,n=3
maxqi=1
d=\sqrt{02+12+12}=\sqrt{2}
3 | |
M | |
3 |
\sqrt{2} | |
S | |
3 |
E= | 3! |
1!*2!*0! |
23-1=
6 | |
2 |
4=12
The basic
\vec{q}
3 | |
N | |
3 |
\vec{q}1=(0,0,0)
\left\Vert\vec{q}-\vec{q}0\right\Vert1=2
\vec{q}=\vec{q}3
G\vec{q3
E\vec{q=(0,0,0)}=
3! | |
3!*0!*0! |
23-3=
6 | |
6 |
1=1
E\vec{q=(0,0,1)}=
3! | |
2!*1! |
23-2=
6 | |
2 |
2=6
G=1+6+12-1=18
Which matches the supplied table
The assumption that all
\left\Vert\vec{q}p\right\Vert=r
N=2,k=5
\vec{q}A=(0,5),\vec{q}B=(3,4)
\vec{q}A
5 | |
M | |
2 |
r=25
\vec{q}B
4 | |
M | |
2 |
r=25
\vec{q}C=(4,4)\in
4 | |
M | |
2 |
r=32
5 | |
M | |
2 |
For this assumption to hold,
\begin{cases}N=2,k\leq4\ N=3,k\leq2\ N=4,k\leq1\end{cases}
At higher values of &, Values of will become ambiguous. This means that specification of a given could refer to multiple
\vec{q}p\in
N | |
M | |
n |
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
style(x\pm1,y)
style(x,y\pm1)
is connected to the pixel at
style(x,y)
See also: Von Neumann neighborhood.
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
style(x+1,y+1)
style(x-1,y-1)
style(x,y)
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
style(x\pm1,y\pm1)
style(x,y)
See also: Moore neighborhood.
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
style(x\pm1,y,z)
style(x,y\pm1,z)
style(x,y,z\pm1)
style(x,y,z)
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
style(x\pm1,y\pm1,z)
style(x\pm1,y\mp1,z)
style(x\pm1,y,z\pm1)
style(x\pm1,y,z\mp1)
style(x,y\pm1,z\pm1)
style(x,y\pm1,z\mp1)
style(x,y,z)
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
style(x\pm1,y\pm1,z\pm1)
style(x\pm1,y\pm1,z\mp1)
style(x\pm1,y\mp1,z\pm1)
style(x\mp1,y\pm1,z\pm1)
style(x,y,z)