Introduction - If you have any usage issues, please Google them yourself
This project for OpenCV C++.
It takes simply the average of the neighbourhood of a pixel and assign that value to itself.
You have to choose right size of the kernel. If it is too large, small features of the image may be disappeared and image will look blurred.
If it is too small, you cannot eliminate noises of the image.