Gaussian blur
Replace each pixel with a weighted average that gives nearby pixels more influence.
The same scene stays here while the working view changes.
The orange 3 × 3 window surrounds one output location. Closer neighbours carry more weight; all nine weights sum to 16.
Closer neighbours carry more weight; all nine weights sum to 16. One output value is 136.8; the window then moves across the image.
The whole image has now been processed. The highlighted input value 156 becomes 136.8.
Sum the weighted values, then move the kernel to the next pixel.
Computed teaching example on a 24 × 16 image. Small kernels and simplified settings keep each change visible; use the image laboratory for native OpenCV.
Try it on an image
Experiment at pixel level
Smooth the colour image. Sigma controls the spread; kernel width limits its support.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Reduce sensor noise before finding edges, build image pyramids, or soften detail at a controlled scale.
How it works
- 01Place a bell-shaped kernel around the current pixel.
- 02Multiply neighbours by their distance-dependent weights.
- 03Sum the weighted values, then move the kernel to the next pixel.
G(x,y) ∝ exp(−(x²+y²) / (2σ²))
What to tune
sigmaX controls the spatial scale; ksize limits the support. Use an odd kernel size, or let supported zero dimensions derive it from sigma.
Where it breaks down
Strong smoothing removes small features and blends across object boundaries. Border modes change the values near the image edge.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.
Related methods
Box filtering
Average a rectangular neighbourhood with equal weight at every position.
Median filtering
Choose the middle value of a pixel neighbourhood instead of averaging its intensities.
Bilateral filtering
Smooth nearby pixels only when their colours are also similar.
Custom correlation kernels
Apply your own linear filter to every pixel neighbourhood.