简体   繁体   English

Kinect V2背景移除追踪仅一个人

[英]Kinect V2 background removal track only one person

I am using kinectv2 for background removal. 我正在使用kinectv2进行背景去除。 I am using the following link for my removal of background. 我正在使用以下链接删除背景。

http://www.codeproject.com/Articles/758344/Background-removal-using-Kinect-green-screen-effec http://www.codeproject.com/Articles/758344/Background-removal-using-Kinect-green-screen-effec

Now, this code tracks all the people in the background, I only need to track only one person in the background. 现在,此代码可跟踪后台的所有人员,我只需要跟踪后台的一个人。 Could you please help me to track only one person in the background removal. 您能否帮助我在后台移除中仅跟踪一个人。

Also, I need to remove the distortion while tracking the person. 另外,我需要在跟踪人的同时消除失真。

It should be as simple as altering the logic in your example to check for a specific body index value instead of any person: 它应该像更改示例中的逻辑一样简单,以检查特定的身体索引值而不是任何人:

byte player = _bodyData[depthIndex];

// Check whether this pixel belong to a human!!!
if (player != 0xff)

From the documentation : 文档中

The pixel values in this frame are 8-bit unsigned integers, where 0-5 map directly to the BodyData index in the BodyFrame. 此帧中的像素值为8位无符号整数,其中0-5直接映射到BodyFrame中的BodyData索引。 Values greater than the value obtained from BodyCount indicate the pixel is part of the background, not associated with a tracked body. 大于从BodyCount获得的值的值表示像素是背景的一部分,与被跟踪的主体无关。

If you want to look at the various BodyIndexes, the BodyBasics sample project assigns a different color to each body. 如果要查看各种BodyIndexes,BodyBasics示例项目将为每个主体分配不同的颜色。 But your change could be as simple as: 但是您的更改可能很简单:

if (player == 0)

But it may require a user selecting which body (0-5) to display. 但这可能需要用户选择要显示的正文(0-5)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM