Hi,
I tried the following;
//created int array same size of depth frame
int Atable[(640 * 480)];
// Create mat container gray scale image
Mat imgr(480, 640, CV_8UC1, Scalar(0, 0, 0));
const auto bodymask = bodyFrame.body_mask();
auto bb = bodymask.data();
int h = bodymask.height();
int w = bodymask.width();
for (int i = 0; i <(h*w); i++)
{
if (bb[i] > 0)
{
Atable[i] = 255;
}
else {
Atable[i] = 0;
}
}
imgr = Mat(480, 640, CV_8UC1, Atable);
cv::imshow("video", imgr);
But I can only see the head of person .
Can you please advice what is wrong the above method.
Thanks
J