问题
Heading
Hi, I'm trying to multiply two arrays of fftw_complex types, how should i do it?
Here's the code:
fftw_complex *rInF, *gInF, *bInF;
fftw_complex *rOutF, *gOutF, *bOutF;
for(int i=0;i<m_image->width()*m_image->height();i++)
{
//realis
rInF[i][0] = rIn[i][0]*rInMask[i][0] - rIn[i][1]*rInMask[i][1];
gInF[i][0] = gIn[i][0]*gInMask[i][0] - gIn[i][1]*gInMask[i][1];
bInF[i][0] = bIn[i][0]*bInMask[i][0] - bIn[i][1]*bInMask[i][1];
//imaginalis
rInF[i][1] = rIn[i][1]*rInMask[i][0] + rIn[i][0]*rInMask[i][1];
gInF[i][1] = gIn[i][1]*gInMask[i][0] + gIn[i][0]*gInMask[i][1];
bInF[i][1] = bIn[i][1]*bInMask[i][0] + bIn[i][0]*bInMask[i][1];
}
I have 2 arrays for each RGB channel(from two images which give us- 2R,2G,2B).
rIn,gIn,bIn and rInMask,gInMask,bInMask are OK. I want to multiply two complex numbers and assign the vaule of multiplication to the rInF, gInF and bInF.
Later I'll make a backward fftw and have convolution in frequency domain.(<- that's not important).
The application just shuts down and doesn't give me any errors.
来源:https://stackoverflow.com/questions/14802180/how-to-multiply-2-fftw-complex-arrays