Filter

Filtering is an image processing technique which is used for example to sharpen an image, to detect line features, to remove noise from an image, etc.

A filter is an odd sized matrix moving over a map and applying a certain function on the pixels it considers (e.g. the avg3x3 filter considers 9 pixels at a time, until the whole map is done). The answer of the function is assigned to that pixel in the output map which was currently the at the center of the matrix. The output value for each pixel thus depends on the value of the pixel itself and on the values of its neighbours.