/AdaptiveWienerFilter

C++ Implementation of the Adaptive Wiener Filter (Based on Opencv Library)

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Adaptive Wiener Filter

This project contains a quite fast C++ implementation of the adaptive Wiener filter. The source code requires OpenCV library to properly work.

Contributors

Requirements

  • OpenCV 3.1.0 or higher (http://opencv.org/downloads.html);
  • One of your favourite IDE/compiler: Visual Studio 2013 or higher, Xcode 5.0.1, gcc 4.7 or higher, .. (with C++11 support).

If you think it is convenience, you can use Cmake to create a project running this code. If OpenCV are installed in your environment, the "CMakeLists.txt" file (included in this repository) will automatically find OpenCV path and create the project.

Algorithms

The adaptive Wiener's filter estimates the local mean and variance around each pixel using the following formulas:

and

where is the N-by-M local neighborhood of each pixel in the source image (). The implementation then creates a pixelwise Wiener filter using these estimations:

where is the noise variance and is the output filtered image. If the noise variance is not given, the function uses the average of all the local estimated variances. Note that the above formula is the one actually used by the Matlab's function (differently from what declared in the documentation 2).

References

[1] Lim, Jae S., Two-Dimensional Signal and Image Processing, Englewood Cliffs, NJ, Prentice Hall, 1990, p. 538, equations 9.26, 9.27, and 9.29.
[2] https://it.mathworks.com/help/images/ref/wiener2.html (Accessed on 15 March 2017)