Neighbors of Pixel

There are two different ways to define the neighbors of a pixel $p$ located at $(x,y)$:

neighbors.gif