Looking at “NuitrackGLSample.cpp”, I see how to get RGB and Depth pixels by walking through the Nuitrack data structures.
I’d like to work directly with OpenCV, and it looks like you use OpenCV internally?
Is it possible to directly cast or convert the frame buffers to OpenCV?
FYI, I ended up not using OpenCV, as I needed to use OpenCV 3.0 for ROS Kinetic transport. Instead, I created published the Image Message directly using the sample from Nuitrack_gl_sample. I’ll post a new forum message for anyone interested in ROS.
Good Evening, I am trying to convert the frame to an opencv matrix using your suggestion. However, I am running into the following error during compilation:
error: no matching function for call to ‘cv::Mat::Mat(int, int, int, const DataType*)’
depthFrame = cv::Mat(frame->getRows(), frame->getCols(), CV_16UC1, frame->getData()).clone();
I am doing this in the function onNewDepthFrame(DepthFrame::Ptr frame) in one of the nuitrack examples. I have already modified the included cmake to use opencv and fixed a versioning issue where I was trying to use opencv 2.4.13 while nuitrack was expecting 2.4.8. I am successfully declaring cv::Mat depthFrame; on the previous line without any errors when the line in question is commented out.
Any help or suggestions you can provide would be greatly appreciated.