title: Convert Mat to IplImage* in OpenCV and C/C++
body: <p>in my application I have a Mat file which i'd like to show in a window with cvShowImage which is defined as:</p>
  
  <pre><code>void cvShowImage( const char* name, const CvArr* image )
  </code></pre>
  
  <p>Now, the problem is that if i pass directly the Mat image, it gives me an error conversion:</p>
  
  <pre><code>cannot convert 'cv::Mat' to 'const CvArr*' for argument '2' to 'void cvShowImage(const char*, const CvArr*)'
  </code></pre>
  
  <p>I tryed to search in this forum for someone with the same problem and i found this opencv documentation:
  <a href="http://opencv.willowgarage.com/documentation/cpp/c++_cheatsheet.html" rel="noreferrer">http://opencv.willowgarage.com/documentation/cpp/c++_cheatsheet.html</a></p>
  
  <p>But i didn't understand how to use it.</p>
  
  <p>Can someone give me an example of how to convert Mat image to IplImage, please?</p>
  
  <p>This is my code:</p>
  
  <pre><code>Mat file;
  Mat hogResultFrame = hogStep(temp2);
  file = hogResultFrame;
  
    cvShowImage(window_title, (const CvArr*)(file));
  </code></pre>
  
  <p>but it gives me an error coversion.</p>
  
  <p>I hope you can help me,</p>
  
  <p>thanks a lot!</p>