I'm using OpenCV, and I'm trying to fill a Mat of size
cv::Mat Mat = cv::Mat(DEPTH_HEIGHT, DEPTH_WIDTH, CV_16U);
and fill it with the depth value in this while loop:
while (curr < dataEnd) {
// Get depth in millimeters
USHORT depth = NuiDepthPixelToDepth(*curr++);
cv::Mat Mat++ = depth;
}
Is there some way to iterate into the Mat such that each depth value is stored in a HeightxWidth Mat index?