I want to do the filter2d()
of openCV in freqency domain.
I have read several posts but still it has not become clear to me, how can I get the filtering effect in frequency domain. I have found few posts which tell to convert an image into the frequency domain (i mean, to calculate it's DFT).
I think that I need to do the following steps:
- Take an image
Make a filter kernel
Mat kernel = (Mat_<double>(3,3) << 1.36, 0.062, -0.921, -0.644198, 1.10, -0.17, -0.072951, -1.81485, 2.806);
- Calculate the DFT of given image
- Calculate the DFT of filter kernel
- Multiply dft(given image) with dft(filter kernel)
- Calculate the inverse-dft of the above multiplication.
I have found the posts which tell about calculating teh DFT of a grayscale image.
Problem: I don't know how do i perform the multipliaction of step-3 and step-4 on GPU because the documentiona says that the two matrices should be of same size.