从骨骼追踪损失中恢复 [英] Recovering from Loss of Skeletal Tracking

查看:100
本文介绍了从骨骼追踪损失中恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,当kinect传感器检测到任何骨架时,应用程序应该可以使用了。

如果骨架远离传感器视图,应该停止应用程序特定时间。如果它检测到任何骨架,应用程序将从第一个以编程方式启动。

如果传感器检测到任何骨架,如果用户不在其视图中,则必须更改背景颜色,即颜色应该在那里在病房后的特定时间它应该回到原来的背景颜色



提前谢谢

I am writing an application such that when the kinect sensor sense any skeleton the application should be ready to use.
If skeleton moves away from the view of sensor the application should be stopped for particular time.if it detects any skeleton the application will start from the first programmatically.
Like If sensor detects any skeleton the background color has to be changed if user is not in its view it should i.e color should be there for particular time after wards it should be back to the original background color

Thanks in advance

推荐答案

大声笑,你的问题到处都是

你的意思是应用程序将从第一个以编程方式开始?

你是什么意思应用程序应该是停?



但听起来你想跟踪你的应用状态。

你可以从枚举(状态)开始,有2个状态,活动和非活动,并且有

一个保持状态的变量(CurrentState)

一个int来保存自非活动状态以来的帧数(CurrentInactiveFrameCount)

一个int到最大非活动帧数(CurrentInactiveFrameCountMax)

,在你的FrameReady事件代码中,如果有任何骷髅拾取,则将CurrentState更改为States.Active else CurrentState to States.Inactive。



以下是基本伪码代码



LOL, your question is all over the place
What do you mean by "application will start from the first programmatically"?
What do you mean by "the application should be stopped"?

But it sounds like you want to track state of your app.
You can start with an enum (States) with 2 states, Active and Inactive and have
A variable that holds the state (CurrentState)
A int to hold the count of frames since its been inactive (CurrentInactiveFrameCount)
A int to the maximum Inactive Frame Count (CurrentInactiveFrameCountMax)
, in your FrameReady event code, if there are any skeletons picked up change the CurrentState to States.Active else CurrentState to States.Inactive.

Below is basic pseudocode code

if(CurrentState is States.Active)
{
  Process skeleton data as per normal 
}
else
{
if(CurrentInactiveFrameCount < CurrentInactiveFrameCountMax)
{
  if(CurrentInactiveFrameCount=0) //only change colour the first time
    background colour = Brushes.SomeColour
  CurrentInactiveFrameCount++

}
else
  background colour = Brushes.OriginalColour
}





请记住,640x480的默认值是30fps,所以如果你想要背景颜色,你的 CurrentInactiveFrameCountMax 将是粗糙的150改变大约5秒

所以你的程序和Kinect都没有停止,只是改变状态,所以改变行为。





如果你还没有和我在一起,那么当我几天回到家时,我可以编写一个适当的程序来完成所有这些工作



Just remember that the default is 30fps at 640x480, so your CurrentInactiveFrameCountMax would be ROUGHLY 150 if you want the background colour to change for about 5 seconds
So neither your program nor the Kinect stop, it just changes state, and so changes behaviour.


If yous still not with me, then I can write a proper program that does all this when I get back home in a few days


这篇关于从骨骼追踪损失中恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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