Gaussian blur

Gaussian blur

Gaussian blur, named for Carl Friedrich Gauss, describes blurring an image by a Gaussian function. It is a widely used effect in graphics software, typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a smooth blur resembling that of viewing the image through a translucent screen, distinctly different from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. Gaussian smoothing is also used as a pre-processing stage in computer vision algorithms in order to enhance image structures at different scales—see scale-space representation and scale-space implementation.

Mathematically, applying a Gaussian blur to an image is the same as convolving the image with a Gaussian function; this is also known as a two-dimensional Weierstrass transform. By contrast, convolving by a circle (i.e., a circular box blur) would more accurately reproduce the bokeh effect. 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

The Gaussian blur is a type of image-blurring filter that uses a Gaussian function (which is also used for 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

:G(x) = frac{1}{sqrt{2pi} sigma} e^{-frac{x^2}{2 sigma^2

in two dimensions, it is the product of two such Gaussians, one per direction:

:G(x,y) = frac{1}{2pi sigma^2} e^{-frac{x^2 + y^2}{2 sigma^2 [Shapiro, L. G. & Stockman, G. C: "Computer Vision", page 137, 150. Prentence Hall, 2001]

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 ⌈6"σ"⌉ × ⌈6"σ"⌉ (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 "linearly separable". 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 Oleft(w_ ext{kernel} w_ ext{image} h_ ext{image} ight) + Oleft(h_ ext{kernel} w_ ext{image} h_ ext{image} ight) time (where "h" is height and "w" is width; see Big O notation), as opposed to Oleft(w_ ext{kernel} h_ ext{kernel} w_ ext{image} h_ ext{image} ight) 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 sqrt{6^2 + 8^2} = 10. 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.

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.

ample Gaussian matrix

This is a sample matrix, produced by calculating the Gaussian distribution for σ = 0.84089642. Note that the center element (at [4, 4] ) has the largest value, decreasing symmetrically as distance from the center increases.

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

Implementation

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 linearly 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.

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.

ee also

*Infinite impulse response (IIR)
*Scale-space implementation
*Gaussian function
*Gaussian filter

References

* http://www.cee.hw.ac.uk/hipr/html/gsmooth.html


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Gaussian blur — /gaʊsiən ˈblɜ/ (say gowseeuhn bler) noun a type of blur filter applied to a digital image that uses a mathematical formula to create the effect of looking through a lens that is out of focus …  

  • Blur — can refer to:Unfocused imagery Blur generally refers to the appearance of an unfocused image. See Defocus aberration, eyeglass prescription, lens and eye. Specific terms using this meaning of Blur include:* Bokeh, the appearance of out of focus… …   Wikipedia

  • Gaussian broadening — refers to broadening effects in spectral lines, these can be produced by Doppler broadening and natural broadening.This effect is similar to Gaussian blur effect in image processing produced by convolution with the Gaussian function.The term is… …   Wikipedia

  • Gaussian function — In mathematics, a Gaussian function (named after Carl Friedrich Gauss) is a function of the form::f(x) = a e^{ { (x b)^2 over 2 c^2 } }for some real constants a > 0, b , c > 0, and e ≈ 2.718281828 (Euler s number).The graph of a Gaussian is a… …   Wikipedia

  • Gaussian filter — In electronics and signal processing, a Gaussian filter is a filter whose filter window is the Gaussian function:x mapsto sqrt{frac{a}{picdot e^{ a cdot x^2}or with the standard deviation as parameter:x mapsto frac{1}{sqrt{2cdotpi}cdotsigma}cdot… …   Wikipedia

  • Gaussian Pyramid — A Gaussian Pyramid is a technique used in image processing, especially in texture synthesis. The technique involves creating a series of images which are weighted down using a Gaussian average (Gaussian Blur) and scaled down. When this technique… …   Wikipedia

  • Box blur — A box blur is an image filter in which each pixel in the resulting image has a value equal to the average value of its neighboring pixels in the input image. It is a form of low pass ( blurring ) filter and is a convolution.Due to its property of …   Wikipedia

  • pixel blur — /ˈpɪksəl blɜ/ (say piksuhl bler) noun 1. → Gaussian blur. 2. the diffuse digital image created by a pixel blur …  

  • Scale-invariant feature transform — Feature detection Output of a typical corner detection algorithm …   Wikipedia

  • Median filter — Example of 3 median filters of varying radii applied to the same noisy photograph. Implemented in Adobe Photoshop. In signal processing, it is often desirable to be able to perform some kind of noise reduction on an image or signal. The median… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”