什么时候INuiBackgroundRemovedColorStream :: GetNextFrame会一直返回E_NUI_FRAME_NO_DATA? [英] When will INuiBackgroundRemovedColorStream::GetNextFrame return E_NUI_FRAME_NO_DATA all the time?
问题描述
我正在尝试使用后台删除功能。我在C中有一个包装器,我的主要应用程序是在C#中。我可以很好地获得彩色帧,深度帧和骨架,并在我的应用程序中显示它们。但是,后台删除
流始终返回E_NUI_FRAME_NO_DATA(我正在使用轮询,如果没有数据则跳过它)。我知道它可以_sometimes_返回E_NUI_FRAME_NO_DATA,但在这种情况下我没有获得单帧数据。
I am trying to use the background removal functionality. I have a wrapper in C, and my main application is in C#. I am able to get color frames, depth frames, and skeleton frames fine, and display those in my application. However, the background removal stream always return E_NUI_FRAME_NO_DATA (I am using polling, and just skip over it if there is no data). I know it can _sometimes_ return E_NUI_FRAME_NO_DATA, but in this case I don't get a single frame of data.
什么可能导致这个问题?
What could cause this problem?
- 我正在后台删除流上调用ProcessDepth,ProcessColor和ProcessSkeleton。
- 我正在初始化流,并使用正确的分辨率启用它。
(我会发布代码,但因为它是在C ++和C#之间分发的,所以流程有点棘手)。我希望有人可能会建议一个调试策略,以便我可以跟踪问题,或者提供一些我可以检查的东西。
(I would post the code, but because it's distributed between C++ and C# the flow is a bit tricky). I am hoping somebody may suggest a debugging strategy so that I can track the problem, or perhaps offer a few things I can check.
推荐答案
既然您可以使用托管代码中的后台删除API,那么为什么?使用 interop? 查看SDK中的背景删除示例,了解托管和c ++的示例代码。如果您没有获取数据,那么
传递的数据无效。深度框架是否具有玩家面具?
Since you can use the background removal api's from managed code, why are you using interop? Have a look at the background removal samples in the SDK for sample code for both managed and c++. If you are not getting data, then the data you are passing is invalid. Does the depth frame have the player mask?
http:// msdn.microsoft.com/en-us/library/dn435686.aspx
所有样本和代码均可从工具包获得。页面左下角Essential部分中的链接:
All samples and code are available from the toolkit. Links in the Essential section at the bottom left of the page:
http://www.microsoft.com/en-us/kinectforwindowsdev/Resources.aspx
这篇关于什么时候INuiBackgroundRemovedColorStream :: GetNextFrame会一直返回E_NUI_FRAME_NO_DATA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!