Suppose, we have a bitmap image represented as a 2D integer array,
int [,] image2D;
whose FFT is Complex[,] fftImage2D;
Suppose, we have an kernel represented as a 2D integer array,
int [,] kernel2D;
whose FFT is Complex[,] fftKernel2D;
We know that, the convolution (in spatial domain) of image2D
and kernel2D
would be,
int Rows = image2D.GetLength(0);
int Cols = image2D.GetLength(1);
for(int i=0 ; i<Rows ; i++)
{
for(int j=0 ; j<Cols ; j++)
{
//sweep the kernel2D across image2D
//...........................
}
}
The following links are all about convolution in spatial domain:
http://www.codeproject.com/Articles/2008/Image-Processing-for-Dummies-with-C-and-GDI-Part http://www.gutgames.com/post/Matrix-Convolution-Filters-in-C.aspx https://softwarebydefault.com/2013/05/01/image-convolution-filters/
Convolution in frequency domain would be, multiplication between fftImage2D
and fftKernel2D
.
How can I do this multiplication?
How can I multiply two Complex [,]
type 2D arrays of different dimensions?