kadu
kadu

Reputation: 513

Is there a wiener function in open cv in c++?

Is there a function in OpenCV (C++ API) to perform Wiener filtering? In this case, which is the header file?

I am looking for a function like matlab's Wiener filter. If there is none, has anyone tried to implement it with OpenCV? My goal is to reduce the noise in disparity maps.

Upvotes: 2

Views: 10765

Answers (4)

Federico Bolelli
Federico Bolelli

Reputation: 11

I know that this is an old question but I've encountered the same need few days ago. I wrote my personal C++ implementation of the adaptive Wiener filter (similar to the wiener2 Matlab's function) based on OpenCV library and I've pushed it on github. Hope this helps!

Upvotes: 1

Alessandro Jacopson
Alessandro Jacopson

Reputation: 18665

You can try to implement by yourself the Wiener filter, for example the book

PETROU, Maria; PETROU, Costas. Image processing: the fundamentals. John Wiley & Sons, 2010.

has a full derivation of the formula for the Wiener filter and a lot of suggestions and practical explanation for implementing the algorithm (for example it explains how to estimate the power spectrum of the noise and the power spectrum of the original undegraded image/signal starting just from the degraded and noisy image/signal and explaining well some reasonable assumptions).

Upvotes: 0

Martin Kubík
Martin Kubík

Reputation: 56

I found C++ source code of Weiner filter is there:

http://gigadom.wordpress.com/2012/05/11/deblurring-with-opencv-weiner-filter-reloaded/

and there

https://github.com/savsun/Filters

You can simply edit it and then call as function.

Upvotes: 3

sansuiso
sansuiso

Reputation: 9379

Bad news: there is none.

Good news: it's not difficult to implement one with the classical equations, using OpenCV's FFT functions. It does even provide an API to multiply spectrums.

Now, you may also try other algorithms such as median filtering or implement TV denoising that have been shown to work with depth maps.

Upvotes: 1

Related Questions