Python OpenCV Gaussian Image Blurring

In this Python OpenCV lesson we are going to learn about Python OpenCV Gaussian Image Blurring, this is the second technique for smoothing the image, in this technique we need to specify width and height of the kernel which should be positive and odd. also we need to add standard deviation in the x and y directions. sigmax and sigmay. you can use cv2.GaussianBlur() for this in opencv

 

This is the complete code for this lesson.

 

 

So in here we are going to create our Gaussian Blur using cv2.GaussianBlur() function. we need to give some parameters, our image, kernel size, sigmax and sigmay.

 

 

 

Because we are going to show our image in Matplotlib, so Matplotlib uses RGB (Red, Green, Blue) color system, and OpenCV uses BGR (Blue, Green, Red) color system, we need to convert the BGR color to RGB. if we don’t do this there will be messed up in the color.

 

 

 

 

Run the complete code and this is the result.

Python OpenCV Gaussian Image Blurring
Python OpenCV Gaussian Image Blurring

 

Thank you for visiting my website! If you enjoyed the free courses, please consider supporting my works on Patreon.