When analyzing images, filters are essential for pre-processing images to make them easier to interpret and analyze. At Visikol, filtering methods are often used to pre-process images for Image Analysis Services. Programs such as ImageJ, CellProfiler, and image analysis packages in python, such as Scikit Image and SciPy, all have filtering functionality, but how does filtering work? Filters work through a convolution of a kernel to each pixel of an image, as seen in Figure 1.

Filtering Numbers

Figure 1. An example of a filter being applied to an image.

The kernel is a matrix of numbers that is used to perform math on the image, and the numbers added together equal one, so that the information in the image is not changed. When a kernel is applied to a pixel, each value is multiplied by the respective pixel and added together to obtain the new value of the pixel of interest, as seen in Figure 2.

Filter Picture 2

Figure 2. An example of the math done on a single pixel for the example shown in Figure 1, the pixel with a value of 31 becomes 45

The math shown above goes pixel by pixel, until every pixel of the image has been analyzed to produce a new filtered image. Now, you may be wondering how pixels on the edge are dealt with, since they are missing neighbors to analyze. There are several ways to deal with edge cases, but two of the most common ways is reflection and zero padding, where reflection is just reflecting values over the edge and zero padding is adding pixels with a value of zero to the edge of images.

Some common filters include gaussian, median, average, and sharpen filters whose kernels can be seen in Figure 3. The gaussian filter is self-explanatory in that it applies a gaussian blur to the image utilizing a bell curve, which is useful for smoothing an image. A median filter is good for removing salt and pepper type noise from an image, and it works by taking all the pixels around the pixel of interest in a predefined area and using the median value as the new pixel value. An average filter is like the gaussian filter in that it smooths an image, however, it applies the same weight to the neighboring pixels as opposed to applying a bell curve weighting. The sharpen filter is useful for bringing out the detail in an image.

Figure 3. Kernels for the average, gaussian, and sharpen filters.

Filters are a useful tool for processing images to enhance certain features for analysis. Besides the filters mentioned above, there are many other filters that can perform different types of operations on an image, and they can even combine multiple filters or mathematical operations to accomplish the task. Visikol commonly utilizes filtering techniques to enhance images for its Image Analysis Services, which extracts tons of data daily from biomedical images. If interested, feel free to contact us about our Image Analysis Services.


Share This Page, Choose Your Platform!

This website uses cookies to enhance the user experience. Ok