Skip to content

The code is a OpenCV's sample of filtering with DFT by using cv::dct function.

Notifications You must be signed in to change notification settings

norishigefukushima/OpenCVFFTBasedGaussianFilter

Repository files navigation

OpenCVFFTBasedGaussianFilter

The code is a OpenCV's sample of filtering with DFT by using cv::dct function.

Note

The code contains two demos; one is FFT based convolution (fftConvolutionTest) and anothor is FFT based deconvolution (fftDeconvolutionTest).

The first demo can convolute an image by the Gaussian kernel and the circle kernel.
The seconde demo can deconvolute (i.e. deblur) Gaussian blur with normal or Weiner filter.

The code is tested on OpenCV2.4.9.

Results (convolution)

input image
###Input image
input spec
###Input image spectrum

Gaussian convolution image
###Gaussian convoluted image
Gaussian convolution spec
###Gaussian convoluted spectrum

Results (deconvolution)

Deconvolution image
###Gaussian deconvoluted image

N-Deconvolution image
###Noisy Gaussian deconvoluted image (Gaussian noise sigma = 5) N-Deconvolution spec
###Noisy Gaussian deconvoluted Spectrum (Gaussian noise sigma = 5)

N-Deconvolution image
###Noisy Weiner deconvoluted image (Gaussian noise sigma = 5) N-Deconvolution spec
###Noisy Weiner deconvoluted spectrum (Gaussian noise sigma = 5)

Todo

  • Add more better baundary treatment for deconvolution. Now, We cannot ignore ringing.
  • Modify generating funcation of Gaussian kernel by directly generation without FFT.

About

The code is a OpenCV's sample of filtering with DFT by using cv::dct function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages