How do I actually apply the convolution theorem? I have my fourier transformed image matrix, and a Fourier transformed kernel, but how do I actually multiply these together to achieve the intended effect of the kernel? Is it through matrix multiplication or some other method? The dimensions are different though.
1 Answer
$\begingroup$
$\endgroup$
3
You have many great code examples at our community:
- 2D Frequency Domain Convolution Using FFT (Convolution Theorem).
- Kernel Convolution in Frequency Domain - Cyclic Padding.
- 2D Image Convolution: Spatial Domain vs. Frequency Domain Convolution in the Computational Complexity Sense.
- Applying Image Filtering (Circular Convolution) in Frequency Domain.
- Applying 2D Image Convolution in Frequency Domain with Replicate Border Conditions in MATLAB.
- How to Zero Pad in Order to Perform Filtering in the Fourier (Frequency) Domain?
- Replicate MATLAB's
conv2()
in Frequency Domain.
The last 2 have a specific code to do image filtering in frequency domain.
-
$\begingroup$ Thank you. From reading those posts, I understand that you have to pad the two matrices with 0s, and then element multiplying them. I am doing this manually instead of with code, as I do not have any coding knowledge, so am I understanding it right? $\endgroup$– botmanCommented Sep 10, 2021 at 13:24
-
$\begingroup$ Indeed. You need to pad them both to the same size according to your needs. $\endgroup$– RoyiCommented Sep 10, 2021 at 17:05
-
$\begingroup$ @botman, Anything missing in my answer? Could you tell me what's missing in order to accept it? $\endgroup$– RoyiCommented Mar 25, 2023 at 12:04