[VTK Study Notes-10] Image smoothing (mean filtering, Gaussian smoothing, median filtering, anisotropic filtering)

Learning Tutorial: "Advanced VTK Graphics and Image Development" Zhang Xiaodong, Luo Huoling
Special thanks: Dongling Studio

5.5 Image smoothing

Image smoothing is often used in image preprocessing. For example, when calculating gradients, smoothing the image first can reduce the impact of noise on the gradient. Image smoothing is generally achieved through template convolution operations.

5.5.1 Mean filtering

The values ​​of each pixel of the corresponding template are the same and the sum is 1. In VTK, mean filtering can be implemented through image convolution operation.

5.5.2 Gaussian smoothing

The principle is similar to the mean filter, except that the template coefficients are not all the same, but the weight needs to be defined based on the distance between the pixel and the center of the template. The weight is calculated using Gaussian distribution, that is, the further away from the center, the smaller the weight.

5.5.3 Median filtering

A 5×5 template is used, and the center of the template is mapped to each pixel of the image one by one, and the median value of the pixels covered by the template image is used as the output value of the current pixel.

This method can effectively maintain the edge of the image and has a good suppression effect on salt and pepper noise.

5.5.4 Anisotropic filtering

Gaussian smoothing blurs the important edge information of the image while smoothing the noise. Anisotropic filtering is a filtering technology based on partial differential equations and is based on the anisotropic diffusion theory of heat.

Anisotropic filtering selects large-scale smoothing in the flat areas of the image, and selects small-scale smoothing in the edge areas, which suppresses noise while maintaining the edge information of the image.

おすすめ

転載: blog.csdn.net/m0_51141265/article/details/132916548