Introduction to Image Smoothing

Introduction to Image Smoothing

From the perspective of signal processing, image smoothing is to remove high-frequency information. So we can perform low-pass filtering on the image. Low-pass filtering can remove the noise in the image and smooth the image.

According to different filters, it can be divided into mean filter, Gaussian filter, median filter and bilateral filter.

2.1 Mean filtering

Image noise is filtered out by means of a mean filter template. Let Sxy denote the set of coordinates of a rectangular sub-image window with size mxn centered at point (x, y). The mean filter can be expressed as:

It is done by a normalized convolution box. It simply replaces the central element with the average of all pixels in the area covered by the convolution. For example, a 3X3 normalized average filter looks like this: 

The advantage of mean filtering is that the algorithm is simple and the calculation speed is fast. The disadvantage is that it removes a lot of details while denoising and blurs the image.

API:

Cv.blur(src,ksize,anchor,borderType)

parameter:

src: input image

Ksize: convolution kernel size

Anchor: Default value (-1, -1), indicating the center of the core

borderType: border type

Example:

 

 

Guess you like

Origin blog.csdn.net/m0_62064241/article/details/126695269