## Neighborhood of a pixel

We have seen image processing operations where the value of a pixel at the output is dependent only on the value of the corresponding pixel at the input. By corresponding, we mean pixels at the same locations (row and column) in the input and output image. Such transformations were represented in mathematical form as follows:

*s = T(r)*

Here, *s* and *r* are the intensity values of a pixel in the output and input respectively. Since we are always dealing with pixels at the same locations, there is no mention of pixel coordinates in the preceding formula. That is to say, the grayscale value of the pixel at the 40^{th} row and 30th column in the output depends on the grayscale value of the pixel at the same coordinates (the 40^{th} row and 30^{th} column) at the input.

This section will introduce you to a slightly more advanced form of image transformation. In the operations that we'll discuss now, the output value at a particular pixel *(x, y)* is not only dependent on the intensity...