相关色彩框架滞后(Unity& Kinect Studio Monitor) [英] Aqcuiring color frames laggy (Unity & Kinect Studio Monitor)

查看:75
本文介绍了相关色彩框架滞后(Unity& Kinect Studio Monitor)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello


我们似乎在接收Unity中Kinect 2的彩色帧时出现延迟。我们正在使用脚本"ColorSourceManager"。来自UnityPlugin。


函数"AcquireLatestFrame"的速率。返回非空结果在9到28 fps之间变化很大。每隔一段时间就会出现一个闪光灯,其中屏幕部分被随机颜色覆盖。当我们删除
"CopyConvertedFrameDataToArray"时,结果是一样的。功能,这使我们相信问题确实存在于"AcquireLatestFrame"中。最初我们认为USB-3.0适配器可能不够快,但奇怪的是样本应用程序"Color Basics WPF"。非常流畅。


但是:当我们只监控未压缩的颜色时,问题会出现在Kinect Studio Monitor 2D视图中。


我们真的很感激任何建议,因为我们有点困惑。


解决方案

你在运行什么类型的系统,GPU / RAM / CPU? Unity会在这些呼叫期间显示大量CPU使用率吗? Kinect配置验证程序(KCV)告诉您什么?


Unity KinectView示例未经过优化,您可以通过访问原始缓冲区并在其中处理来更好地改进性能用于生成纹理的着色器。请记住,数据非常大,因此需要时间来处理。
你可以更快地复制和释放帧。从获取框架中删除任何图纸代码。记住不要写入你可能正在读取的纹理绘制缓冲区。


至于帧传递问题,在光线不足的情况下,你只能得到15fps,这是通过设计。如果你可以在colorbasics样本中达到30fps,那么你应该在Unity中获得30fps,只要你足够快地释放帧(见上文)。
记住Kinect运行时确保您是运行时的好公民。如果你没有足够快地丢弃框架,或者副本很慢,那么当你到达下一帧时,副本将会延迟。最后,你可能会落后太多而且运行时将
停止为你提供框架。


如果运行时间不断落后,那么你应该在KCV中看到它。如果是这样,那么您在系统上遇到性能问题。这可能与运行时看门狗确定帧没有足够快地进入USB3总线有关。
有关可能的修复,请参阅疑难解答线程(上一篇文章)。请记住,如果这些问题无法解决问题,请尝试使用另一台计算机,因为系统可能具有USB3主机控制器的共享PCI Express总线以及无法通过软件解析
的其他内部设备。


https://social.msdn.microsoft.com/Forums/en-US/20dbadae-dcee-406a-b66f-a182d76cea3b/troubleshooting-and-common-issues-guide?forum=kinectv2sdk


Hello

We seem to be experiencing latency in receiving color frames from the Kinect 2 in Unity. We are using the script "ColorSourceManager" from the UnityPlugin.

The rate at which the function "AcquireLatestFrame" returns a non-null result varies greatly between 9 and 28 fps. Every so often there is a flash where the screen is partially covered by random colours. The result is the same when we remove the "CopyConvertedFrameDataToArray" function, which leads us to believe that the problem is really in the "AcquireLatestFrame" part.

Initially we thought it may be the USB-3.0 adaptor that is not fast enough, but what is strange is that the sample application "Color Basics WPF" is perfectly smooth.

BUT : the problem DOES occur in the Kinect Studio Monitor 2D view when we monitor only uncompressed color.

We would really appreciate any advice on this, as we are somewhat confused.

解决方案

What type of system are you running on, GPU/RAM/CPU? Does Unity show large CPU usage during those calls? What does Kinect Configuration Verifier(KCV) tell you?

The Unity KinectView sample isn't very optimized and you may find better ways of improving perf by accessing the raw buffer and processing that in a shader to generate a texture. Keep in mind the data is very large so it will take time to process. The faster you can copy and release the frame the better. Remove any drawing code from the acquiring of the frame. Remember not to write to the same buffer that you might be reading from for your texture draw.

As for frame delivery issues, in low light conditions, you will only get 15fps, this is by design. If you can achieve 30fps in the colorbasics samples, then you should be getting 30fps in Unity provided that you are releasing the frame fast enough(see above). Remember Kinect runtime ensures you are a good citizen of the runtime. If you do not dispose of the frame fast enough or the copy is slow that is going to delay when you get the next frame. Eventually you may lag too far behind and the runtime will stop providing you frames altogether.

If the runtime is continuously lagging behind then you should see that in KCV. If so, then you have a performance issue on the system. This may be related to the runtime watchdog determining that frames are not coming in fast enough off the USB3 bus. See troubleshooting thread (last post) for possible fixes. Keep in mind if these do not resolve the issue, try another machine as the system may have a shared PCI Express bus with the USB3 host controller and other internal devices that cannot be resolved in software.

https://social.msdn.microsoft.com/Forums/en-US/20dbadae-dcee-406a-b66f-a182d76cea3b/troubleshooting-and-common-issues-guide?forum=kinectv2sdk


这篇关于相关色彩框架滞后(Unity& Kinect Studio Monitor)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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