Kinect SDK2.0 + OpenCV 3.0 keying, background change

Source: Internet
Author: User

Using Kinect2.0 's Multisourceframereader, get Depthframesource, Colorframesource, Bodyindexframesource, and get the corresponding frame.

hr = Pmykinect->openmultisourceframereader (framesourcetypes::framesourcetypes_depth |            | Framesourcetypes::framesourcetypes_bodyindex,             &pmultisourceframereader);

Through the spatial mapping, the color space is mapped to the depth space because the Bodyindex space and depth space are the same, so the color pixels mapped to the depth space can be processed directly. The details look directly at the code.

hr = Pcoordinatemapper->mapcolorframetodepthspace (Depthheight * depthwidth, (uint16*) PDepthBuffer, ColorHeight * Colorwidth, pdepthcoordinates);

Code Address:

Https://github.com/stone-ch/kinect2-opencv3/tree/master/KinectChangeBackground

Without uploading the project files, the environment I am using is:

Kinect SDK v2.0_1409 64-bit

Opencv3.1.0

VS2013

Win10

PS: The background image is 1920 * 1080, because the image captured by the Kinect's color camera is this size.

What needs to be improved: smoothing the character edges and blending the foreground background.

Reference:

Http://blog.csdn.net/column/details/bbdxf-kinectv2.html

http://blog.csdn.net/qq_22033759/article/category/5617829

C:\Program Files\Microsoft Sdks\kinect\v2.0_1409\samples\native\coordinatemappingbasics-d2d Kinect SDK comes with an example, This is the path on your computer.

Kinect SDK2.0 + OpenCV 3.0 keying, background change

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.