rows in the result you do not care about). In either case, you can use nonzero_rows to indicate how
many rows contain meaningful data. This will provide some savings in computation time.
cv::idft(), the Inverse Discrete Fourier Transform
As we saw earlier, the function cv::dft() can be made to implement not only the discrete Fourier
transform, but also the inverse operation (with the provision of the correct flags argument). It is often
preferable, if only for code readability, to have a separate function that does this inverse operation by
default.
void cv::idft(
cv::InputArray src, // Input array (real or complex)
cv::OutputArray dst, // Output array
int flags = 0, // for variations
int nonzeroRows = 0 // number of rows to not ignore
);
Calling cv::idft() is exactly equivalent to calling cv::dft() with the cv::DFT_INVERSE flag
(in addition to whatever flags you supply to cv::idft(), of course.)
cv::mulSpectrums(), Spectrum Multiplication
In many applications that involve computing DFTs, one must also compute the per-element multiplication
of the two resulting spectra. Because such results are complex numbers, typically packed in their special
high-density CCS format, it would be tedious to unpack them and handle the multiplication via the “usual”
matrix operations. Fortunately, OpenCV provides the ...