Ask Your Question

Revision history [back]

Question 1 and 2 it is written in doc :

Re Y_{0,0} & Re Y_{0,1} & Im Y_{0,1} & Re Y_{0,2} & Im Y_{0,2} & \cdots & Re Y_{0,N/2-1} & Im Y_{0,N/2-1} & Re Y_{0,N/2} If you don't want this flag use DFT_COMPLEX_OUTPUT

Mat sigX=(Mat_<double>(1,8)<<1,1,0,0,0,0,0,0),fftsigx;
dft(sigX, fftsigx);
cout << "flag=0 : " << fftsigx << "\n";
dft(sigX, fftsigx, DFT_COMPLEX_OUTPUT);
cout << "flag=DFT_COMPLEX_OUTPUT : " << fftsigx << "\n";

flag=0 : [2, 1.707106781186547, -0.7071067811865475, 1, -1, 0.2928932188134524, -0.7071067811865475, 0] flag=DFT_COMPLEX_OUTPUT : [2, 0, 1.707106781186547, -0.7071067811865475, 1, -1, 0.2928932188134524, -0.7071067811865475, 0, 0, 0.2928932188134524, 0.7071067811865475, 1, 1, 1.707106781186547, 0.7071067811865475]

Question 3 it is well known issue but not in opencv : window effect.

Question 4 : I want to see your code but with this code no problem

dft(fftsigx, sigX, DFT_COMPLEX_OUTPUT+DFT_INVERSE+DFT_SCALE);
cout << "flag=DFT_COMPLEX_OUTPUT+INVERSE : " << sigX << "\n";

Question 1 and 2 it is written in doc :

Re Y_{0,0} & Re Y_{0,1} & Im Y_{0,1} & Re Y_{0,2} & Im Y_{0,2} & \cdots & Re Y_{0,N/2-1} & Im Y_{0,N/2-1} & Re Y_{0,N/2} Y_{0,N/2}

If you don't want this flag use DFT_COMPLEX_OUTPUT

Mat sigX=(Mat_<double>(1,8)<<1,1,0,0,0,0,0,0),fftsigx;
dft(sigX, fftsigx);
cout << "flag=0 : " << fftsigx << "\n";
dft(sigX, fftsigx, DFT_COMPLEX_OUTPUT);
cout << "flag=DFT_COMPLEX_OUTPUT : " << fftsigx << "\n";

flag=0 : [2, 1.707106781186547, -0.7071067811865475, 1, -1, 0.2928932188134524, -0.7071067811865475, 0]

flag=DFT_COMPLEX_OUTPUT : [2, 0, 1.707106781186547, -0.7071067811865475, 1, -1, 0.2928932188134524, -0.7071067811865475, 0, 0, 0.2928932188134524, 0.7071067811865475, 1, 1, 1.707106781186547, 0.7071067811865475]

Question 3 it is well known issue but not in opencv : window effect.

Question 4 : I want to see your code but with this code no problem

dft(fftsigx, sigX, DFT_COMPLEX_OUTPUT+DFT_INVERSE+DFT_SCALE);
cout << "flag=DFT_COMPLEX_OUTPUT+INVERSE : " << sigX << "\n";