Kinect - 骨架跟踪问题 - >只跟踪一个(最近的)骨架 [英] Kinect - Skeleton tracking question -> only track one (the nearest) skeleton

查看:67
本文介绍了Kinect - 骨架跟踪问题 - >只跟踪一个(最近的)骨架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


嘿那里,


我正在学习信息学,我正在为一家软件公司工作。我的新任务是维护我们的Kinect Mouse Controll项目。


我们正在将它用作展会上的鼠标,作为展示我们软件的引人注目的....


<我的任务是减少令人不安的信号。每当人们走到控制kinect的人后面时,信号就会受到干扰。


但是当我看到代码时,在我看来,一次只有一个活动骨架(最近的),所以一切都应该没问题(我猜)  请参阅:


___________________________________________________________________________________________________________________________





if(this.trackedSkeleton!= null) {


//获取被跟踪骨架的当前索引


for (int i = 0; i< this.skeletons.Lenght; i ++){


if(this.skeletons [ i] .TrackingID == this.trackedSkeleton.TrackingID){


playerIndex = i;


updatedSkeleton = this .skeleton [i];


break ;


   }


  }


}



if(updatedSkeleton == null){


//未找到跟踪骨架


float nearestDistance = 1000f;


for(int i = 0; i< this.skeletons [i]; i ++)


var newSkeleton = this.skeletons [i ]。


if(newSkeleton .Trackingstate!= SkeletonTrackingState.NotTracked&& newSkeleton.Position.Z< nearestDistance)


{


nearestDistance = newSkeleton.Position.Z;


playerIndex = i;


updatedSkeleton = this .Skeletons [i]


  &NBSP;&NBSP; }


  }


}



this.trackedSkeleton = updatedSkeleton;


___________________________________________________________________________________________________________________________



我的问题:


- 我在监督什么吗?


- 什么是检查的最佳方法/跟踪了多少个谢尔顿?



thanx用于某些输入!




$
编辑:我已经在这个主题上找到了一些有用的tipps的有趣线索,但我似乎也是如果我正确阅读该代码,就像没有必要做的那样。好事就是证明这个陈述;-)

解决方案

如果走在后面的人非常接近第一个玩家,Kinect可能会将它们视为一个骨架。这将导致寄生虫移动,因为Kinect可能会考虑使用第二人的某些身体部位。

=>解决方案是在玩家周围物理定义周边(围栏,鸭脚板或地板上的贴纸),以防止步行者过于封闭现场。


另外,当第2次人走开,他可能会"偷"。
TrackingID和 
Kinect将为1er玩家提供新的跟踪ID

=>通常,我只选择最近的骷髅。所以你可以用以下代码替换所有代码:

 this.trackedSkeleton = this.skeletons.skeletons 
//仅获取跟踪骨架
.Where(skeleton => skeleton.TrackingState!= SkeletonTrackingState.NotTracked)
//选择最接近的
.OrderBy(skeleton => skeleton.Position.Z).FirstOrDefault ();)

希望这有帮助


Hey there,

i am studying informatics and i am working for a software company. My new task is to maintain our Kinect Mouse Controll project.

We are using it as a mouseemulation on fairs as an eyecatcher to present our software....

My task is to reduce disturbing signals. Whenever people walk behind the person who controlls the kinect, the signal gets disturbed.

But when i look at the code it seems to me like there is only one active skeleton at one time (the nearest), so everything should be fine (i guess) see this:

___________________________________________________________________________________________________________________________

if (this.trackedSkeleton != null){

// get the current index of the tracked skeleton

for (int i = 0; i < this.skeletons.Lenght; i++){

if (this.skeletons[i].TrackingID == this.trackedSkeleton.TrackingID) {

playerIndex = i;

updatedSkeleton = this.skeleton[i];

break;

   }

  }

}

if (updatedSkeleton == null){

// no tracked skeleton was found

float closestDistance = 1000f;

for (int i = 0; i < this.skeletons[i]; i++)

var newSkeleton= this.skeletons[i];

if (newSkeleton.Trackingstate != SkeletonTrackingState.NotTracked && newSkeleton.Position.Z < closestDistance)

{

closestDistance = newSkeleton.Position.Z;

playerIndex = i;

updatedSkeleton = this.Skeletons[i]

    }

  }

}

this.trackedSkeleton = updatedSkeleton;

___________________________________________________________________________________________________________________________

My Question(s):

- Am i overseeing something?

- What is the best way to check wich/how many skeltons are tracked?

thanx for some input!



Edit: I allready found some intresting threads on that topic with usefull tipps, but too me it seems like nothing has to be done, if i read that code correctly. Good thing would be to prove that statement ;-)

解决方案

If the person walking behind is very close to the first player, Kinect may consider them as 1 skeleton. This will cause parasite movement because Kinect may consider using some bodyparts of the second person.
=> solution would be to physically define a perimeter (fence, ducktape or stickers on the floor) around the player in order to prevent walkers to be too closed to the scene.

Additionnally, when the 2nd person walks away, he may "steal" the TrackingID and Kinect will then give the 1er player a new trackingID
=> usually, I just select the closest Skeleton. So you could replace all the code by:

this.trackedSkeleton = this.skeletons.skeletons
                        // get only tracked skeleton
                        .Where(skeleton => skeleton.TrackingState != SkeletonTrackingState.NotTracked)
                        // select the closest
                        .OrderBy(skeleton => skeleton.Position.Z).FirstOrDefault();)

Hope this helps


这篇关于Kinect - 骨架跟踪问题 - &gt;只跟踪一个(最近的)骨架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆