Ask Your Question
0

Applying gaussian mask in frequency domain c++ opencv

asked 2017-09-16 02:56:07 -0600

MKS gravatar image

Hi, I want to know how to do LPF using a gaussian mask in frequency domain. I have done the dft of the input image. But dont know what to do after this.please hele

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-16 06:20:14 -0600

matman gravatar image

updated 2017-09-16 07:25:24 -0600

Embed your mask into a zero padded mask-image with the size of your input image, dft it, multiply both images pixelwise and idft the result. See here.

EDIT: first embed, than dft not vice versa. Shift should be regardless.

edit flag offensive delete link more

Comments

ok thanx for replying...But if i want to multiply two spectrums without mulspectrum function of opencv then what should be my approach

MKS gravatar imageMKS ( 2017-09-16 22:13:26 -0600 )edit

And also how can i control the radius of filter in frequency domain

MKS gravatar imageMKS ( 2017-09-17 00:43:39 -0600 )edit

I don't understand your question. Why don't you want to use cv::mulSpectrums()?

Controlling radius of filter can be done when creating Gaussian kernel using cv::getGaussianKernel() in spatial domain.

What are you expecting to achieve when reinventing GaussianBlur?

matman gravatar imagematman ( 2017-09-17 12:36:52 -0600 )edit

Hi matman...thank you for your valuable time and sharing your knowledge..Now i am able to control the radius of filter using getGaussiankernel..

But i want to understand the underlying behaviour of cv::mulSpectrums() ..If you have any idea regarding this please share with me.

MKS gravatar imageMKS ( 2017-09-17 13:09:16 -0600 )edit

The source code for mulSpectrums is here

matman gravatar imagematman ( 2017-09-21 13:18:38 -0600 )edit

@matman , Thank you for replying and helping to solve my problem.

@matman, I want to implement bilinear interpolation using opencv but without using opencv resize function. I want to implement the algorithm with c++ and opencv. So will u please help me regrding this?

MKS gravatar imageMKS ( 2018-04-29 01:56:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-16 02:56:07 -0600

Seen: 1,105 times

Last updated: Sep 16 '17