I\'m new about opencv(c++) and kinect. I try to take a video image with c++ from kinect. I search everywhere but I didn\'t find anything. Because people are made using openN
In case if someone is redirected here looking for a simpler method for visualizing the Kinect depth stream, I was able to do this in the following way for the KinectV2.
Mat CDepthMap::getFrame()
{
IDepthFrame* frame;
Mat depthImage;
hr = _depth_reader->AcquireLatestFrame(&frame);
if (SUCCEEDED(hr)) {
const UINT imgSize = sDepthWidth*sDepthHeight; //512*424
UINT16 pixelData[imgSize];
hr = frame->CopyFrameDataToArray(imgSize, pixelData);
if (SUCCEEDED(hr)) {
depthImage = Mat(sDepthHeight,sDepthWidth, CV_8U);
for (UINT i = 0; i < imgSize; i++) {
UINT16 depth = pixelData[i];
depthImage.at(i) = LOWORD(depth);
}
}
SafeRelease(frame);
}
return depthImage;
}