The neighborhood relation for a given pixel $p(x,y)$ describes a [[Set|set]] of adjacent pixels.
The $N_{4}$ neighbor relates to the vertical and horizontal direct neighbors.
$\huge \begin{align}
N_{4}(p) &= \set{(x-1,y),(x+1,y),(x,y-1),(x,y+1)} \\
\end{align}
$
$ \huge q \in N_{4}(p) \implies p \in N_{4}(q) $
Each member of $N_4(p)$ is a [[Unit Vector|unit]] [[Distance|distance]] from $p$.
$N_D(p)$ refers to the diagonal [[Pixel|Pixels]], with each having a distance of $\sqrt{ 2 }$ from $p$.
$N_8(p)$ refers to all adjacent neighbors with is a [[Union]] of the previous two.
$\huge N_{8}(p) = N_{4}(p) \cup N_{D}(p)
$