- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I received below source code from Dima. I adjusted it to image.
--------------------------------------------------------------------------------------------------------------------------
You probably did the small size on a static array, defined as x[100][40]. The way the dynamic array is arranged in your example is incorrect and it demonstrates typical mistake. For static array '_complex x
I'd suggest you to refrain from the practice of using double-subscript notation for dynamic arrays, and adopt the following usage instead:
const int ROWS=3072, COLS=2560;
const int ROWSIZE=COLS, COLSIZE=ROWS;
_complex *x = new _complex[ROWS*COLS];
#define x(r,c) x[*ROWSIZE+(c)] /* explicit row-major indexing */
memset(x,0,sizeof(x[0])*ROWS*COLS); /* zero fill initialization */
for (r=0;r
The rest of this reply is duplicating your example in the above terms.
DftiCreateDescriptor(rowfft,DFTI_SINGLE,DFTI_COMPLEX,1,ROWSIZE); /* stride 1 by default */
DftiSetValue(rowfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)ROWS);
DftiSetValue(rowfft,DFTI_INPUT_DISTANCE,(MKL_LONG)ROWSIZE);
DftiSetValue(rowfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)ROWSIZE);
DftiCreateDescriptor(colfft,DFTI_SINGLE,DFTI_COMPLEX,1,COLSIZE); /* will set strides */
MKL_LONG colfft_strides[] = { 0, ROWSIZE };
DftiSetValue(colfft,DFTI_INPUT_STRIDES,colfft_strides);
DftiSetValue(colfft,DFTI_OUTPUT_STRIDES,colfft_strides);
DftiSetValue(colfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)COLS);
DftiSetValue(colfft,DFTI_INPUT_DISTANCE,(MKL_LONG)1);
DftiSetValue(colfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)1);
...
DftiComputeForward(rowfft,x);
DftiComputeForward(colfft,x);
Thanks
Dima
--------------------------------------------------------------------------------------------------------------------------
///FFT
DftiComputeForward(rowfft,x);
DftiComputeForward(colfft,x);
//Inverse FFT
DftiComputeBackward(rowfft,x);
DftiComputeBackward(colfft,x);
like this...
but The FFT adjusted only 2560*1536(original image size is 2560*3072)
Which code should I change?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The excerpt looks good, and it should process whole array.
Could you provide a self-contained example that shows your problem?
Thanks
Dima

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page