title: (Adaptive) thresholding in opencv error (Bad argument (Unknown array type) in cvarrToMat)
body: <p>I'm trying to use thresholding on my video stream but it is not working.</p>
  
  <p>My video stream:</p>
  
  <pre><code>Mat *depthImage = new Mat(480, 640, CV_8UC1, Scalar::all(0));
  </code></pre>
  
  <p>Then i try to do the adaptive thresholding, (also doesn't work with regular thresholding)</p>
  
  <pre><code>for(;;){
  
      if( wrapper-&gt;update()){
  
  
          wrapper-&gt;getDisplayDepth(depthImage);
  
          cvAdaptiveThreshold(depthImage, depthImage,255,CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY,75,10);
  
  
          imshow("Depth", *depthImage);
  
      }
  
      int k = waitKey(25);
      if(k == 27 ) exit(0);
  }
  </code></pre>
  
  <p>I get this error :</p>
  
  <blockquote>
    <p>OpenCV Error: Bad argument (Unknown array type) in cvarrToMat, file /Users/olivierjanssens/source/OpenCV-2.3.1/modules/core/src/matrix.cpp, line 646
    terminate called throwing an exception</p>
  </blockquote>
  
  <p>What am i doing wrong, i can get display and see the stream perfectly.But when i add this thresholding i get the error previously mentioned. (i'm rather new to opencv btw).</p>
  
  <p>Thx in advance !</p>