Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Gaussian Blur

Gaussian blur is an image-smoothing filter that reduces noise and fine detail with weighted pixel averages for computer vision and preprocessing.

Gaussian blur is an image-smoothing technique that replaces each pixel with a weighted average of nearby pixels, giving greater influence to closer neighbors. The weights follow a bell-shaped Gaussian distribution, producing a soft blur that reduces noise and fine detail. Also called Gaussian smoothing, it is widely used in computer vision and data preprocessing to prepare images for analysis.

How Gaussian Blur Works#

The filter moves a small grid of weights, called a kernel, across an image. At each position, it multiplies neighboring pixel values by their weights and adds the results. This operation is convolution. The weights sum to one, so a pixel remains unchanged when all values sampled by its kernel have the same brightness. Gaussian blur acts as a low-pass filter: it suppresses rapid pixel-to-pixel changes, including noise, texture, and sharp boundaries.

Two settings determine the result. Sigma, the Gaussian distribution's standard deviation, controls how widely the weights spread; increasing sigma produces stronger smoothing. Kernel size determines how much of the surrounding image is included. A larger kernel accommodates a wider Gaussian, while an undersized kernel cuts off its tails. Kernel radius describes the distance from the center to the kernel's edge: a radius of three pixels gives a seven-pixel-wide kernel.

At image borders, part of the kernel falls outside the available pixels. Reflecting the image extends nearby content; filling the missing area with zeros introduces dark values that can darken the border. Boundary handling therefore changes the filtered output near image edges.

Applications in Computer Vision and Machine Learning#

Gaussian smoothing supports feature extraction by controlling the spatial scale at which image structure is analyzed. Its multiscale use has roots in Taizo Iijima's 1959–1962 Gaussian scale-space work, which established foundations for representing images at different levels of blur.

In scikit-image's implementation of Canny edge detection, Gaussian smoothing reduces noise before gradient estimation with the Sobel operator. Without smoothing, noise produces additional intensity changes that compete with object boundaries. Increasing the smoothing scale also removes fine edges, changing which contours survive detection.

For document image segmentation, Gaussian-weighted local averages support adaptive thresholding. Each pixel receives a threshold calculated from its neighborhood's weighted average minus an offset. This separates text from backgrounds with uneven illumination, as in local thresholding of a scanned page.

As data augmentation, Gaussian blur creates softened versions of training images while preserving coordinates for bounding boxes and keypoints. Ultralytics YOLO supports A.GaussianBlur through its custom Albumentations transforms, allowing YOLO26 training to include controlled blur variation.

Gaussian Blur Compared With Other Filters#

The choice of smoothing method changes which image information survives:

  • Mean blur, also called box blur, gives every pixel in its window equal weight. Gaussian blur emphasizes nearby pixels, creating a more gradually weighted average.
  • Median blur replaces a pixel with the neighborhood's median value. It is especially effective for salt-and-pepper noise: isolated bright and dark pixels.
  • Bilateral filtering uses both spatial distance and intensity similarity to reduce noise while preserving sharp boundaries. Gaussian blur weights pixels by position alone, so it also softens edges.

Applying Gaussian Blur in Python#

OpenCV provides cv2.GaussianBlur for Gaussian smoothing. Install its Python package with pip install opencv-python, then save a side-by-side comparison:

from urllib.request import urlopen

import cv2
import numpy as np

with urlopen("https://ultralytics.com/images/bus.jpg") as response:
    image_bytes = np.frombuffer(response.read(), dtype=np.uint8)
image = cv2.imdecode(image_bytes, cv2.IMREAD_COLOR)

blurred = cv2.GaussianBlur(image, (15, 15), sigmaX=3)
comparison = cv2.hconcat([image, blurred])
cv2.imwrite("gaussian_blur_comparison.jpg", comparison)

The saved image places the original on the left and the smoothed result on the right. The 15 x 15 kernel uses sigma three pixels in both directions because the omitted sigmaY takes the value of sigmaX.

Gaussian kernels are separable: horizontal and vertical one-dimensional filters produce the corresponding two-dimensional blur. For a 7 x 7 kernel, this reduces the kernel-weight contributions per pixel from 49 to 14.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning