{% extends "base.html" %} {% block title %} GaussianBlur {% endblock %} {% block description %}

Blurs an image using a Gaussian filter. The function convolves the source image with the specified Gaussian kernel.

{% endblock %} {% block signature %}
cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) → dst
{% endblock %} {% block parameters %} {% endblock %} {% block notes %} {% endblock %} {% block explanation %}

This filter works by producing a window of size ksize that is examined surrounding each pixel in the image. A two-dimensional convolution matrix over this window is created using a Gaussian distribution from the center point (the pixel under consideration). This distribution gives the center pixel the heaviest weight, with smaller weights given as we move further outwards. Essentially, this is acting as a weighted average for the center pixel to be influenced by its neighbors, with closer neighbors having a larger influence. As sigmaX and sigmaY get smaller, the Gaussian distribution's peak becomes narrower, meaning that the image will be less blurred as further pixels receive smaller weights in the weighted average. Similarly, reducing the window size (ksize) produces an image with less blur since we are considering only neighbors that are closer to the center pixel.

{% endblock %} {% block references %} {% endblock %}