Gaussian Blur is an image fuzzy filter that uses normal distribution to calculate the transformation of each pixel in an image.

The normal distribution equation of n-dimensional space is

In two-dimensional space, it is defined

Where*R*Is the Blur radius (*R*2 =*U*2 +*V*2) σ is the standard deviation of normal distribution.

In two-dimensional space, the contour lines of the surface generated by this formula are concentric circles with normal distribution starting from the center. The convolution matrix composed of pixels with a non-zero distribution is transformed with the original image. The value of each pixel is the weighted average of neighboring pixel values. The value of the original pixel has the largest Gaussian distribution value, so there is the largest weight. As neighboring pixels become farther and farther away from the original pixel, their weights become smaller and smaller. In this way, the edge effect is more retained than that of other balanced fuzzy filters. For more information, see the implementation of scale space.

Theoretically, the distribution of each point in an image is not zero, which means that the computation of each pixel must contain the entire image. In practical applications, when calculating the discrete approximation of Gaussian Functions, pixels beyond the approximate 3 σ distance can be regarded as ineffective, and the calculation of these pixels can be ignored. Generally, the image processing program only needs to calculate (6σ

+ 1) * (6 σ + 1) matrix ensures the influence of related pixels.

Apart from circular symmetry, Gaussian Blur can also calculate two independent one-dimensional spaces on two-dimensional images. This is called*Linear Differentiation*. That is to say, the effect of using a two-dimensional matrix transformation can also be achieved through a one-dimensional Gaussian matrix transformation in the horizontal direction plus a one-dimensional Gaussian matrix transformation in the vertical direction. From the computing point of view, this is a useful feature, because it only requires O (N * m

* N) + O (M * m * n) is calculated, while an unpartitioned matrix requires O (M * n * m * n ).*M*,*N*Is the dimension of the image to be filtered,*M*,*N*Is the dimension of the filter.

The effects of consecutive Gaussian blur on an image are the same as those of a larger Gaussian blur, the radius of a large Gaussian Blur is the square root of the sum of squares of the radius of multiple Gaussian blur. For example, the two Gaussian fuzzy transformations with the radius of 6 and 8 are equivalent to the Gaussian fuzzy blur with the radius of 10, SQRT (6

* 6 + 8*8) = 10. Based on this relationship, it takes less time to process Gaussian blur with multiple consecutive smaller values than that of a single Gaussian.

Gaussian Blur is often used to reduce the image size. During undersampling, the image is usually filtered at a low-pass before sampling. This ensures that no false high-frequency information is displayed in the sample image. Gaussian Blur has good characteristics. If there is no obvious boundary, it will not form a shock in the filtered image.

/*

For example, exp (1) = 1 power of e = E = 2. 718281828... exp (0) = 0 power of e = 1exp (2) = square of E = 7. 3890561... E is a constant, equal to 2. 718281828...

*/

Change the original template:

/1 2 1 \

H = | 2 4 2 | * 1/16

\ 1 2 1/

The new template can remove the point noise and retain the contrast of the original image. Therefore, this template is widely used. This template is called a Gaussian template because it is obtained through the two-dimensional Gaussian (Gauss) function.

Gaussian Functions have two features:

1: The convolution between a Gaussian function and another Gaussian function is still a Gaussian function. The square of the standard deviation of a * B = C is the sum of the squares of the standard deviations of A and B, that is to say, the Gaussian function after convolution is wider, and the blur effect is more obvious (intuitively, the image will become more and more blurred after continuous Gaussian Fuzzy Operations .)

2: The Fourier transformation of the Gaussian function is still a Gaussian function. If the original Gaussian function is wider (the larger the standard deviation), the Gaussian function after the transformation will be narrower (the smaller the standard deviation ), that is to say, the wider the Gaussian function, the more obvious the effect of low-pass (high-impedance) filtering, the more unclear (more fuzzy) The details of the processed image ).

To perform Gaussian blur on a digital image, you must use a convolution that conforms to the Gaussian function distribution to check the digital image for convolution.

The size of the convolution kernel, the size of the final proportional coefficient to be determined.

A 5x5 Gaussian convolution kernel with a standard deviation of 1.4:

2 4 5 4 2

4 9 12 9 4

5 12 15 12 5

4 9 12 9 4

2 4 5 4 2

Last multiplied by the ratio of 1/115