Ask Your Question

Revision history [back]

Using the IR image as a mask for RGB image

I'm passing the RGB, Depth and IR image through from libfreenect2 to opencv, and I am having trouble working out how to use the the IR image as a mask over the RGB image to remove everything except humans from a video stream.

I've gotten the images from libfreenect2 and converted them to the following image types (based off this post) :

    cv::Mat(rgb->height, rgb->width, CV_8UC4, rgb->data).copyTo(rgbmat);
    cv::Mat(ir->height, ir->width, CV_32FC1, ir->data).copyTo(irmat);
    cv::Mat(depth->height, depth->width, CV_32FC1, depth->data).copyTo(depthmat);

Thanks in advance!