for DFT，a real array’s Fourier Transformation is the same length’s complex array, but opencv’s dft R2C reduce the width, why?

actually no.

there’s half as much information going in.

all DFT implementations have a function for complex-valued inputs and for real-valued inputs. the real-valued case is special because it requires a bit less work and the output doesn’t need to be full-sized.

besides that, OpenCV does something funky. it packs the values in some strange scheme. it’s documented. you can pass a flag so that it doesn’t do this weird packing.

please do not apply random tags to a thread (especially “cudaarithm” is utterly unrelated to this)

the R of R2C don’t mean the imaginary part all are zeros, right? otherwise, the fft of opencv is included in the cudaarithm, so i add the flag

Again it’s a math fourier property. Nothing special in opencv

the ‘k’ has the same length with ‘n’ and it is nothing about x[n] is real or complex, right? any mistake i did?

i get it i think, thanks