How to realize Gaussian filtering by python OpenCV
Xiaobian to share with you how python OpenCV to achieve Gaussian filtering, I believe most people still do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
1. Gaussian filtering
Gaussian filter is a linear smoothing filter, which is suitable for eliminating Gaussian noise and widely used in image processing. [1]Generally speaking, Gaussian filtering is the process of weighted averaging of the whole image. The value of each pixel is obtained by weighted averaging of itself and other pixel values in its neighborhood. The specific operation of Gaussian filtering is: scan each pixel in the image with a template (or convolution, mask), and replace the value of the center pixel of the template with the weighted average gray value of the pixels in the neighborhood determined by the template.
C++#include #include using namespace cv;using namespace std;int main(){ Mat img = imread("gauss_noise.png"); if (img.empty()) { cout