OpenCV Filters: Smoothing (Blurring)

27 Oct 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.


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:

Blur (Normalized Box Filter): OpenCV – blur() Documentation

Image by: Uberzers

Original images Blur applied

Gaussian Blur: OpenCV – GaussianBlur() Documentation

Image by: Silver-Fate

Original images Blur applied

Median Blur: OpenCV – medianBlur() Documentation

Image by: longai

Original images Blur applied

Bilateral Filter: OpenCV – bilateralFilter() Documentation

Image by: AyyaSap

Original images Blur applied