FIGURE 9.18 (a) Pixelp and its 4-neighbors, N4(p) (b) Pixel p and its diagonal neighbors, ND(p). (c) Pixelp and its 8-neighbors, Ns(p). (d) Pixels p and q are 4-adjacent and 8-adjacent (e) IPixelsp and q are 8-adjacent but not 4-adjacent (f) The shaded pixels are both 4-connected and 8-connected (g) The shaded foreground pixels are 8-connected but not 4-connected