Exemplo n.º 1
0
 /// <summary>
 /// Performs an inverse Discrete Fourier transform of 1D or 2D floating-point array.
 /// </summary>
 /// <param name="src">The source array, real or complex</param>
 /// <param name="dst">The destination array, which size and type depends on the flags</param>
 /// <param name="flags">Transformation flags, a combination of the DftFlag2 values</param>
 /// <param name="nonzeroRows">When the parameter != 0, the function assumes that 
 /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) 
 /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, 
 /// thus the function can handle the rest of the rows more efficiently and 
 /// thus save some time. This technique is very useful for computing array cross-correlation 
 /// or convolution using DFT</param>
 public static void Idft(InputArray src, OutputArray dst, DftFlags flags = DftFlags.None, int nonzeroRows = 0)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.core_idft(src.CvPtr, dst.CvPtr, (int)flags, nonzeroRows);
     GC.KeepAlive(src); 
     dst.Fix();
 }
Exemplo n.º 2
0
 /// <summary>
 /// computes element-wise product of the two Fourier spectrums. The second spectrum can optionally be conjugated before the multiplication
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <param name="c"></param>
 /// <param name="flags"></param>
 /// <param name="conjB"></param>
 public static void MulSpectrums(
     InputArray a, InputArray b, OutputArray c,
     DftFlags flags, bool conjB = false)
 {
     if (a == null)
         throw new ArgumentNullException("a");
     if (b == null)
         throw new ArgumentNullException("b");
     if (c == null)
         throw new ArgumentNullException("c");
     a.ThrowIfDisposed();
     b.ThrowIfDisposed();
     c.ThrowIfNotReady();
     NativeMethods.core_mulSpectrums(a.CvPtr, b.CvPtr, c.CvPtr, (int)flags, conjB ? 1 : 0);
     GC.KeepAlive(a);
     GC.KeepAlive(b); 
     c.Fix();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Performs an inverse Discrete Fourier transform of 1D or 2D floating-point array.
 /// </summary>
 /// <param name="flags">Transformation flags, a combination of the DftFlag2 values</param>
 /// <param name="nonzeroRows">When the parameter != 0, the function assumes that 
 /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) 
 /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, 
 /// thus the function can handle the rest of the rows more efficiently and 
 /// thus save some time. This technique is very useful for computing array cross-correlation 
 /// or convolution using DFT</param>
 /// <returns>The destination array, which size and type depends on the flags</returns>
 public Mat Idft(DftFlags flags = 0, int nonzeroRows = 0)
 {
     var dst = new Mat();
     Cv2.Idft(this, dst, flags, nonzeroRows);
     return dst;
 }