[][src]Function opencv::cudaarithm::dft

pub fn dft(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    dft_size: Size,
    flags: i32,
    stream: &mut Stream
) -> Result<()>

Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.

Parameters

  • src: Source matrix (real or complex).
  • dst: Destination matrix (real or complex).
  • dft_size: Size of a discrete Fourier transform.
  • flags: Optional flags:
  • DFT_ROWS transforms each individual row of the source matrix.
  • DFT_SCALE scales the result: divide it by the number of elements in the transform (obtained from dft_size ).
  • DFT_INVERSE inverts DFT. Use for complex-complex cases (real-complex and complex-real cases are always forward and inverse, respectively).
  • DFT_COMPLEX_INPUT Specifies that input is complex input with 2 channels.
  • DFT_REAL_OUTPUT specifies the output as real. The source matrix is the result of real-complex transform, so the destination matrix must be real.
  • stream: Stream for the asynchronous version.

Use to handle real matrices ( CV32FC1 ) and complex matrices in the interleaved format ( CV32FC2 ).

The source matrix should be continuous, otherwise reallocation and data copying is performed. The function chooses an operation mode depending on the flags, size, and channel count of the source matrix:

  • If the source matrix is complex and the output is not specified as real, the destination matrix is complex and has the dft_size size and CV_32FC2 type. The destination matrix contains a full result of the DFT (forward or inverse).
  • If the source matrix is complex and the output is specified as real, the function assumes that its input is the result of the forward transform (see the next item). The destination matrix has the dft_size size and CV_32FC1 type. It contains the result of the inverse DFT.
  • If the source matrix is real (its type is CV_32FC1 ), forward DFT is performed. The result of the DFT is packed into complex ( CV_32FC2 ) matrix. So, the width of the destination matrix is dft_size.width / 2 + 1 . But if the source is a single column, the height is reduced instead of the width.

See also

dft

C++ default parameters

  • flags: 0
  • stream: Stream::Null()