I need to filter (multiply) my OpenCV DFT matrix with some custom filter mask (like a band-pass filter). With DFT_COMPLEX_OUTPUT, applying this mask is quite trivial (just multiply real and imaginary channels with the filter mask), and I have that working well.
I am doing milions of these operations, and now I want to speed things up by using the CCS format. How should I change the filter mask, to get the same results? The CCS format is relatively non-trivial, so I guess the trasformation that needs to be done on the filter mask will be non-trivial aswell. I am aware of the function mulSpectrums(), but that is for multiplying two CCS matrices. I have one CCS matrix from DFT, and one real (or complex by duplicating channels) matrix, which is the filter, and which is not in the CCS format, so I cannot use mulSpectrums(). Is there an simple way to convert a matrix to a CCS format?
Seems to me like quite a common problem, but I was unable to find anything. I guess everyone that does filtering in the frequency domain just uses the significantly slower DFT_COMPLEX_OUTPUT?
So, can I have my cake, and eat it too? (without losing my hair over figuring out how to implement a normal Mat → CCS Mat function)