Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

please see docs , your cv::DFT_COMPLEX_OUTPUT flag went into the wrong slot. it should be:

cv::dft(Pt.t(), Fp, cv::DFT_ROWS | cv::DFT_COMPLEX_OUTPUT);

cout << Fp.size() << " " << Fp.channels() << " " << Fp.depth() << endl;
// [256 x 128] 2 5

also, please do NOT preallocate output Mat's like Fp and Zp. they will most likeley be overwritten anyway, and you only fool yourself making assumptions about size/type here.

please see docs , your cv::DFT_COMPLEX_OUTPUT flag went into the wrong slot. it should be:

Mat Fp, Pt(256,128,CV_32F); // example input
cv::dft(Pt.t(), Fp, cv::DFT_ROWS | cv::DFT_COMPLEX_OUTPUT);
cv::DFT_COMPLEX_OUTPUT); //you need to "or" the flags

cout << Fp.size() << " " << Fp.channels() << " " << Fp.depth() << endl;
// [256 x 128] 2 5

also, please do NOT preallocate output Mat's like Fp and Zp. they will most likeley be overwritten anyway, and you only fool yourself making assumptions about size/type here.

please see docs , your cv::DFT_COMPLEX_OUTPUT flag went into the wrong slot. it should be:

Mat Fp, Pt(256,128,CV_32F); // example input
cv::dft(Pt.t(), Fp, cv::DFT_ROWS | cv::DFT_COMPLEX_OUTPUT); //you need to "or" the flags

cout << Fp.size() << " " << Fp.channels() << " " << Fp.depth() << endl;
// [256 x 128] 2 5

also, please do NOT preallocate output Mat's like Fp and Zp. they will most likeley likely be overwritten anyway, and you only fool yourself making assumptions about size/type here.