
Chapter 5
Neighborhood Processing
5.1 Introduction
We have seen in Chapter 4 that an image can be modified by applying a particular function
to each pixel value. Neighborhood processing may be considered an extension of this, where
a function is applied to a neighborhood of each pixel.
The idea is to move a “mask”: a rectangle (usually with sides of odd length) or other
shape over the given image. As we do this, we create a new image whose pixels have
gray values calculated from the gray values under the mask, as shown in Figure 5.1. The
Mask
Pixel at position (x, y)
(a) Original image
Pixel at position (x, y)
(b) Image after filtering
FIGURE 5.1: Using a