![]() |
VOOZH | about |
A Gaussian Filter is a low-pass filter used for reducing noise (high-frequency components) and for blurring regions of an image. This filter uses an odd-sized, symmetric kernel that is convolved with the image. The kernel weights are highest at the center and decrease as you move towards the periphery, this makes the filter less sensitive to drastic changes (edges), allowing a smooth blur effect. The 2D Gaussian function is defined as:
where:
Using this formula, you can calculate the Gaussian kernel of any size by providing appropriate values. Example: 3*3 gaussian kernal(σ =1)
👁 ImageExample 1: In this example, we will blur the entire image using Python's PIL (Pillow) library. The Gaussian blur is a commonly used effect in image processing to reduce image noise and detail.
Output
Explanation:
Example 2: Instead of blurring the entire image, sometimes we only want to blur a specific region (like faces or private information). This can be achieved by:
Output
Explanation: