6: Spatial Filters
Spatial filters assign the value of a pixel based on their neighbors. Filters are defined as matrices, known as kernels, and are applied to an image through an operation known as a convolution.
The image being used for this post is a rgb2gray converted lena image. Each kernel is a 3x3 pixel image with numbers that determines how the image will be affected. In the example of horizontal and vertical sobel filters, the horizontal and vertical points are being focused on. In the example of the Gaussian blur, pixels in the center are focused on and corner pixels are blurred. This creates a bokeh effect.
Increasing the size of these kernels causes the kernel to look at the larger size of pixels to operate on. Depending on the situation, this may improve or worsen the image.