title: Mat and setMouseCallback function
body: <p>I have a <code>my_mouse_callback</code> example function that works with IplImage*:</p>
  
  <pre><code>void my_mouse_callback(int event, int x, int y, int flags, void* param) 
  {
  IplImage* image = (IplImage*) param;
  switch( event ) 
  {
      case CV_EVENT_LBUTTONDOWN: 
          drawing_box = true;
          box = cvRect(x, y, 0, 0);
          break;
          ...
  
          draw_box(image, box);
          break;
  }
  </code></pre>
  
  <p>which is implemented in <code>main</code> like this:</p>
  
  <pre><code>cvSetMouseCallback(Box Example,my_mouse_callback,(void*) image);
  </code></pre>
  
  <p>The problem is, in my code I'm using Mat object and it can't be transfered this way to the <code>setMouseCallback</code> function. </p>
  
  <p>I'm looking for a solution that doesn't involve transfering Mat to IplImage*.</p>
  
  <p>Or if there is no solution, how can I correctly convert Mat to IplImage*?</p>
  
  <p>I tried that already with this code from the opencv documentation:</p>
  
  <pre><code>Mat I;
  IplImage* pI = &amp;I.operator IplImage();
  </code></pre>
  
  <p>and it didn't work.</p>