title: Applying Color Map to Depth Image in OpenCV
body: <p>So I'm playing around with a Kinect and some code that I found online to visualize the depth image. I was looking at this thread (<a href="https://stackoverflow.com/questions/13840013/opencv-how-to-visualize-a-depth-image">OpenCV: How to visualize a depth image</a>) and I'm trying to use the applyColorMap function, however whenever it gets called, it triggers a breakpoint giving me the error: "HEAP[OpenCVKinect.exe]: Invalid address specified to RtlValidateHeap( 004A0000, 009206D8 )"</p>
  
  <p>I'm not really sure what I'm doing wrong; I'm following the suggestions in the mentioned thread pretty much as it is.</p>
  
  <pre><code>    dataStream = myDataCap.getData();
      std::cout &lt;&lt; dataStream.size() &lt;&lt;  std::endl;
      dataStream[0];
      if(dataStream.size()==1 &amp;&amp; !dataStream[0].empty())
      {
          double min;
          double max;
          Mat datamat = dataStream[C_DEPTH_STREAM];
          minMaxIdx(datamat, &amp;min, &amp;max);
          Mat adjMap;
          datamat.convertTo(adjMap,CV_8UC1, 255 / (max-min), -min);
          Mat falseColorsMap;
          applyColorMap(adjMap, falseColorsMap, COLORMAP_AUTUMN);
          imshow("Out", falseColorsMap);
  
  
  
          imshow("Depth", dataStream[C_DEPTH_STREAM]);
  </code></pre>