The Moore neighborhood of a pixel, P, is the set of 8 pixels
which share a vertex or edge with that pixel. These pixels are namely pixels
P1,
P2, P3, P4, P5, P6, P7 and P8 shown in Figure 1 below.
The Moore neighborhood (also known as the 8-neighbors or
indirect neighbors) is an important concept that frequently arises
in the literature.