Utilisateur:MilWolf/Brouillon

The effects of a small and a large Gaussian blur

A flou Gaussien (aussi connu sous le nom de lissage Gaussien) est la conséquence d'avoir rendu flou une image par une fonction de gaussienne. C'est un effet largement utilisé dans les logiciels graphiques, typiquement pour réduire le bruit d'une image et réduire le niveau de détail. L'effet visuel de cette technique de brouillage est un flou harmonieux qui fait paraître l'image comme si elle était vue à travers un écran translucide, par différence de l'effet bokeh produit par une sortie de focus ou l'ombre d'un objet illuminé. Le flou Gaussien est aussi utilisé comme une étape de pré-traitement d'algorithmes de vision par ordinateur arrangés pour améliorer la structure des images à différentes échelles de vue représentation de l'espace d'échelle et implémentation de l'espace d'échelle.

Mathématiquement, appliquer un flou Gaussien à une image est pareil que convoluer l'image avec une fonction gaussienne. Aussi connu comme une transformation de Weierstrass en deux dimensions . Par contraste, convoluer par un cercle (i.e., flou de boîte circulaire) doit reproduire exactement l'effet bokeh. Since the Fourier transform of a Gaussian is another Gaussian, applying a Gaussian blur has the effect of reducing the image's high-frequency components; a Gaussian blur is thus a low pass filter.

Mechanics modifier

 
Gaussian blur can be used in order to obtain a smooth grayscale digital image of a halftone print

The Gaussian blur is a type of image-blurring filter that uses a Gaussian function (which also expresses the normal distribution in statistics) for calculating the transformation to apply to each pixel in the image. The equation of a Gaussian function in one dimension is

 

in two dimensions, it is the product of two such Gaussians, one in each dimension:

 [1][2]

where x is the distance from the origin in the horizontal axis, y is the distance from the origin in the vertical axis, and σ is the standard deviation of the Gaussian distribution. When applied in two dimensions, this formula produces a surface whose contours are concentric circles with a Gaussian distribution from the center point. Values from this distribution are used to build a convolution matrix which is applied to the original image. Each pixel's new value is set to a weighted average of that pixel's neighborhood. The original pixel's value receives the heaviest weight (having the highest Gaussian value) and neighboring pixels receive smaller weights as their distance to the original pixel increases. This results in a blur that preserves boundaries and edges better than other, more uniform blurring filters; see also scale space implementation.

In theory, the Gaussian function at every point on the image will be non-zero, meaning that the entire image would need to be included in the calculations for each pixel. In practice, when computing a discrete approximation of the Gaussian function, pixels at a distance of more than 3σ are small enough to be considered effectively zero. Thus contributions from pixels outside that range can be ignored. Typically, an image processing program need only calculate a matrix with dimensions   ×   (where   is the ceiling function) to ensure a result sufficiently close to that obtained by the entire gaussian distribution.

In addition to being circularly symmetric, the Gaussian blur can be applied to a two-dimensional image as two independent one-dimensional calculations, and so is termed separable filter. That is, the effect of applying the two-dimensional matrix can also be achieved by applying a series of single-dimensional Gaussian matrices in the horizontal direction, then repeating the process in the vertical direction. In computational terms, this is a useful property, since the calculation can be performed in   time (where h is height and w is width; see Big O notation), as opposed to   for a non-separable kernel.

Applying multiple, successive gaussian blurs to an image has the same effect as applying a single, larger gaussian blur, whose radius is the square root of the sum of the squares of the blur radii that were actually applied. For example, applying successive gaussian blurs with radii of 6 and 8 gives the same results as applying a single gaussian blur of radius 10, since  . Because of this relationship, processing time cannot be saved by simulating a gaussian blur with successive, smaller blurs — the time required will be at least as great as performing the single large blur.

 
Two downscaled images of the Flag of the Commonwealth of Nations. Before downscaling, a Gaussian blur was applied to the bottom image but not to the top image. The blur makes the image less sharp, but prevents the formation of Moiré pattern aliasing artifacts.

Gaussian blurring is commonly used when reducing the size of an image. When downsampling an image, it is common to apply a low-pass filter to the image prior to resampling. This is to ensure that spurious high-frequency information does not appear in the downsampled image (aliasing). Gaussian blurs have nice properties, such as having no sharp edges, and thus do not introduce ringing into the filtered image.

Low-pass filter modifier

Modèle:Expand section Gaussian blur is a low-pass filter, attenuating high frequency signals.

Its amplitude Bode plot (the log scale in the frequency domain) is a parabola.

Variance reduction modifier

How much does a Gaussian filter with standard deviation   smooth the picture, with other words, how much does it reduce the standard deviation of pixel values in the picture? Assume the grayscale pixel values have a standard deviation  , then after applying the filter the reduced standard deviation   can be approximated as

 .

Sample Gaussian matrix modifier

This is a sample matrix, produced by sampling the Gaussian filter kernel (with σ = 0.84089642) at the midpoints of each pixel and then normalizing. Note that the center element (at [0, 0]) has the largest value, decreasing symmetrically as distance from the center increases.

0.00000067 0.00002292 0.00019117 0.00038771 0.00019117 0.00002292 0.00000067
0.00002292 0.00078634 0.00655965 0.01330373 0.00655965 0.00078633 0.00002292
0.00019117 0.00655965 0.05472157 0.11098164 0.05472157 0.00655965 0.00019117
0.00038771 0.01330373 0.11098164 0.22508352 0.11098164 0.01330373 0.00038771
0.00019117 0.00655965 0.05472157 0.11098164 0.05472157 0.00655965 0.00019117
0.00002292 0.00078633 0.00655965 0.01330373 0.00655965 0.00078633 0.00002292
0.00000067 0.00002292 0.00019117 0.00038771 0.00019117 0.00002292 0.00000067

Note that 0.22508352 (the central one) is 1177 times larger than 0.00019117 which is just outside 3σ.

Implementation modifier

A Gaussian blur effect is typically generated by convolving an image with a kernel of Gaussian values. In practice, it is best to take advantage of the Gaussian blur’s separable property by dividing the process into two passes. In the first pass, a one-dimensional kernel is used to blur the image in only the horizontal or vertical direction. In the second pass, another one-dimensional kernel is used to blur in the remaining direction. The resulting effect is the same as convolving with a two-dimensional kernel in a single pass, but requires fewer calculations.

Discretisation is typically achieved by sampling the Gaussian filter kernel at discrete points, normally at positions corresponding to the midpoints of each pixel. This reduces the computational cost but, for very small filter kernels, point sampling the Gaussian function with very few samples leads to a large error. In these cases, accuracy is maintained (at a slight computational cost) by integration of the Gaussian function over each pixel's area.[3]

When converting the Gaussian’s continuous values into the discrete values needed for a kernel, the sum of the values will be different from 1. This will cause a darkening or brightening of the image. To remedy this, the values can be normalized by dividing each term in the kernel by the sum of all terms in the kernel.

Common uses modifier

 
This shows how smoothing affects edge detection. With more smoothing, fewer edges are detected

Gaussian smoothing is commonly used with edge detection. Most edge-detection algorithms are sensitive to noise; the 2-D Laplacian filter, built from a discretization of the Laplace operator, is highly sensitive to noisy environments. Using a Gaussian Blur filter before edge detection aims to reduce the level of noise in the image, which improves the result of the following edge-detection algorithm. This approach is commonly referred to as Laplacian of Gaussian, or LoG filtering.[4]

See also modifier

Notes and references modifier

  1. Shapiro, L. G. & Stockman, G. C: "Computer Vision", page 137, 150. Prentice Hall, 2001
  2. Mark S. Nixon and Alberto S. Aguado. Feature Extraction and Image Processing. Academic Press, 2008, p. 88.
  3. Erik Reinhard. High dynamic range imaging: Acquisition, Display, and Image-Based Lighting. Morgan Kaufmann, 2006, pp. 233–234.
  4. Fisher, Perkins, Walker & Wolfart, « Spatial Filters - Laplacian of Gaussian », (consulté le )

External links modifier

{{DEFAULTSORT:Gaussian Blur}} [[Category:Image processing]] [[Category:Gaussian function]] [[Category:Image noise reduction techniques]]