I’m doing a gauss filtering on image.
The steps of my goal are:
read data from an image
create a kernel
applying FFT to image and kernel data
applying IFFT to 4. results.
If I do the same operation in MATLAB I have best accuracy.
I have read in other topics, that I must normalize the IFFT results with 1/size_fft,
or use only Z2Z/C2C cufft type because matlab use double precision data type.
I have done it, but I haven’t improvements.
The only doubt come from the C2C use, my data are float and I convert them in Complex before call cufftExecC2C:
//for image_complex[i].x = image[i].x; image_complex[i].y = 0; //end for cufftExecC2C(plan, (cufftComplex *)image_complex, (cufftComplex *)image_complex, CUFFT_FORWARD);
and on IFFT I need unsigned char data from complex:
cufftExecC2C(plan, (cufftComplex *)image_complex, (cufftComplex *)image_complex, CUFFT_INVERSE); //for filtered[i]=(char)image_complex[i].x; //end for
In the end I use filtered data for bitmap visualization.
thank you for support.