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 (OpenCV: How to visualize a depth image) 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 )"
I'm not really sure what I'm doing wrong; I'm following the suggestions in the mentioned thread pretty much as it is.
dataStream = myDataCap.getData();
std::cout << dataStream.size() << std::endl;
dataStream[0];
if(dataStream.size()==1 && !dataStream[0].empty())
{
double min;
double max;
Mat datamat = dataStream[C_DEPTH_STREAM];
minMaxIdx(datamat, &min, &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]);