title: Displaying a cvMatrix containing complex numbers (CV_64FC2)
body: <p>I'm new to OpenCV, and I would like to compare the results of a python program with my calculations in OpenCV. My matrix contains complex numbers since its the result of a cvDFT. Python handles complex numbers well and displays it with scientific notation. My C++ program is not effective when trying to use std::cout.</p>
  
  <p>I tried to store my numbers array in a std::complex[] instead of a double[] but it is not compiling.</p>
  
  <p>Here is my code, and its result :</p>
  
  <pre><code>    CvMat *dft_A;
  
      dft_A = cvCreateMat(5, 5, CV_64FC2); // complex matrix
      double a[] = {
          0, 0, 0, 0, 0,
              1, 1, 1, 1, 1,
              2, 2, 2, 2, 2,
              3, 3, 3, 3, 3,
              4, 4, 4, 4, 4
             };
      dft_A-&gt;data.db = a;
      std::cout &lt;&lt; "before : " &lt;&lt; a[0] &lt;&lt; std::endl;
      cvDFT( dft_A, dft_A, CV_DXT_FORWARD);  // DFT !
      std::cout &lt;&lt; "after : " &lt;&lt; a[0] &lt;&lt; std::endl;
  
  
          &gt;&gt; before : 0
  </code></pre>
  
  <p>Here is the same in python, with the output :</p>
  
  <pre><code>&gt;&gt;&gt; a = np.mgrid[:5, :5][0]
  &gt;&gt;&gt; a
  array([[0, 0, 0, 0, 0],
         [1, 1, 1, 1, 1],
         [2, 2, 2, 2, 2],
         [3, 3, 3, 3, 3],
         [4, 4, 4, 4, 4]])
  &gt;&gt;&gt; np.fft.fft2(a)
  array([[ 50.0 +0.j        ,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ],
         [-12.5+17.20477401j,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ],
         [-12.5 +4.0614962j ,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ],
         [-12.5 -4.0614962j ,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ],
         [-12.5-17.20477401j,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ]])
  &gt;&gt;&gt;
  </code></pre>
  
  <p>The problem is obviously coming from the second cout which is inefficient with the type of date (CV_64FC2 for complex number).</p>
  
  <p>My question is : how can I dump the result so I can check that my python code is doing the same as my cpp/opencv code ?</p>
  
  <p>Thanks !</p>