TN13-A quick guide to understanding spatial filter

Written By:Sophia.feng Updated: 2024-10-2

What is spatial filter?

Spatial filtering is a method that directly operates on a small region or subset of an image to modify an image, using a specific spatial filter to filter out noise from an image. Frequently, we use a mask to encompass the region of the image where this predefined operation is performed. As shown in the diagram below:

Averaging the pixel intensity values of the image region encompassed by the mask results in a blurring or smoothing of the image. By replacing each pixel’s value in the image with the average value of the surrounding neighborhood using a filter mask, this process reduces sharp intensity changes in the image, resulting in an overall blurring or smoothing effect. This helps to reduce unwanted noise in the image.
The formula for the arithmetic mean filter is:

The general weighted average filtering of a  M×N image using a mask of size m×n is given by the follow expression:

where x=0,1,2,…,M-1 and y=0,1,2,…,N-1; and m=2a+1 and n=2b+1.

Example of spatial filter application on Vzense ScepterGUITool

Users can try the spatial filter function on ScepterGUITool, please see below figure:

Detect the object with ToF(Time-of-Flight) camera, turn off the filter, and its point cloud map are shown below:

Turn on the spatial filter, reducing unnecessary noise in the image, the result of this processing is a sharp transition reduction of the image in intensity and hence the overall blurring or smoothing effect, the point cloud map is shown below:

Pros and cons of spatial filter

Pros: Reducing noise in an image.
Cons: The loss of image details will make the image blurred.

Related Posts

How can we support you?

We will be happy to advise you on product selection and find the right solution for your application.

Contact Now