:::: MENU ::::

OpenCV Filters: Smoothing (Blurring)

Posted in October 27, 2014

Smoothing, usually, plays a key role on preprocessing of images, but at the same time it can enhance your result, it can also mess it. Sometimes seen as a fail in the process, a bunch of algorithms runs better on blurred images and that’s why we’re going to see how it works on practice. Watch the video to see normalized box filter, gaussian blur, median blur and bilateral filter in action. Source code available.

Pre-requirements:
-- OpenCV installed: How to install OpenCV 3.0.0 on Ubuntu

Our main goal is to see all these smoothing techniques working! I’m not here to give you formal explanations, we want to see them in action, right? For those who are looking for these explanations, read pages 111-127 from Szeliski Book (draft available for download). On the video, as an extra, you’ll see the effect of these blurs on the frequency domain, which I think is very cool.

Try this yourself. Download the source code used on the video: Smoothing source code.

You can also download from GitHub: http://bit.ly/1zIVR7T

Smoothing - Sample Program (4835 downloads)

Blur (Normalized Box Filter): OpenCV -- blur() Documentation
Image by: Uberzers

Original Image (Rubick - Dota 2)

Original Image

Blur Applied

Blur Applied

Gaussian Blur: OpenCV -- GaussianBlur() Documentation
Image by: Silver-Fate

Original Image (Drow - Dota 2)

Original Image

Gaussian Blur Applied

Gaussian Blur Applied

Median Blur: OpenCV -- medianBlur() Documentation
Image by: longai

Original Image (Luna - Dota 2)

Original Image

Median Blur Applied

Median Blur Applied

Bilateral Filter: OpenCV – bilateralFilter() Documentation
Image by: AyyaSap

Original Image (Lina - Dota 2)

Original Image

Bilateral Filter Applied

Bilateral Filter Applied


  • Wei qi

    Great. But I cannot download your code from your website. Do you upload them?