Reference:
1, https://docs.opencv.org/3.2.0/
2. https://github.com/opencv/opencv/Image Processing (imgproc module) images Smoothing
In this tutorial, you will learn how to use the OPENCV function to apply various linear filters to smooth the image, for example: Cv::blur cv::gaussianblur cv::medianblur cv::bilateralfilter theoretical Smoothing, Also known as Blur, is a simple, commonly used image processing operation. There are many reasons for smoothing. In this tutorial, we will focus on smoothing to reduce noise (other uses will be seen in the tutorials below). To perform a smooth operation, we will apply a filter to the image. The most common type of filter is linear, where the output pixel value (i.e. g (i,j) g (I,J)) is determined as the weighted sum of the input pixel value (i.e. F (i+k,j+l) f (i +k,j + L)):
G (I,j) g (i,j) =∑k,lf (i+k,j+l) H (k,l) \sum_{k,l} f (I+k, J+l) H (k,l)
H (k,l) H (k,l) is called the kernel, it is just the coefficient of the filter.
The filter can be visualized as a sliding coefficient window on the image. There are many types of filters, here we will mention the most commonly used: normalized Box Filter is the simplest filter. Each output pixel is the average of its kernel neighbors (all of which contribute with equal weight) the kernel is as follows:
K k = 1kwidth⋅kheight \dfrac{1}{k_{width} \cdot k_{height}}⎡⎣⎢⎢⎢⎢⎢⎢11. 111..111..1...............111