全息镜头 2 |微软 - 有没有人让场景理解实时工作? [英] Hololens 2 | Microsoft - Has anyone gotten Scene Understanding to work in realtime?

查看:28
本文介绍了全息镜头 2 |微软 - 有没有人让场景理解实时工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找有关如何使用场景理解 SDK(在 Unity 中)的适当文档或教程.我对编程并不陌生,但也不是很精通.我一直在尝试让场景理解 SDK 通过他们自己的 文档页面.但它并没有很好地解释如何使用来自空间感知观察器/网格的实时数据而不是预制场景来运行它.

I've been trying to find proper documentation or tutorials on how to work with the Scene Understanding SDK (in Unity). I'm not new at programming, but not quite proficient either. I've been trying to get Scene Understanding SDK to work through their own documentation page. But it simply doesn't explain well how to get it running with realtime data from the Spatial Awareness Observer/mesh, instead of pre-made scenes.

SDK Github 页面中的示例场景在某种程度上可以在编辑器中使用,但将其部署到我的 Hololens 会导致在按下场景理解"面板按钮时场景不会创建实际结果..

The example scene from the SDK Github page works to some extent in the Editor, but deploying it onto my Hololens results in the scene not creating actual results when pressing the Scene Understanding panel buttons..

我可以发布我尝试过的代码片段,但我认为这不会很有帮助,我很高兴看到一个代码片段或具有基本场景的项目,我可以将其分解并部署到我的镜头上,看看它是如何工作的.如果有人为我提供易于理解的文档页面或教程,那也太棒了!

I could post code snippets of what I've tried, but I don't think it will be very helpful, I would be very happy to see a code snipper or project with a basic scene which I can take apart and deploy onto my Lens to see how it works. If anybody has a comprehensible documentation page or tutorial for me, that would be fantastic too!

推荐答案

要从 HoloLens 的空间感知网格计算实时场景,请使用 SceneObserver.ComputeAsync(从实时数据计算)而不是 ComputeSerializedAsync(加载来自保存的场景).

To compute a live scene from the HoloLens' spatial awareness mesh initialize the scene with SceneObserver.ComputeAsync (to compute from live data) instead of with ComputeSerializedAsync (to load from a saved scene).

场景理解文档的初始化部分:

// Create Query settings for the scene update
SceneQuerySettings querySettings;

querySettings.EnableSceneObjectQuads = true;                                       // Requests that the scene updates quads.
querySettings.EnableSceneObjectMeshes = true;                                      // Requests that the scene updates watertight mesh data.
querySettings.EnableOnlyObservedSceneObjects = false;                              // Do not explicitly turn off quad inference.
querySettings.EnableWorldMesh = true;                                              // Requests a static version of the spatial mapping mesh.
querySettings.RequestedMeshLevelOfDetail = SceneMeshLevelOfDetail.Fine;            // Requests the finest LOD of the static spatial mapping mesh.

// Initialize a new Scene
Scene myScene = SceneObserver.ComputeAsync(querySettings, 10.0f).GetAwaiter().GetResult();

您应该能够从 https://github 更新 SceneUnderstandingManager.cs 文件.com/microsoft/MixedReality-SceneUnderstanding-Samples 调用 ComputeAsync 而不是 ComputeSerializedAsync 如果您希望示例在世界上而不是在保存的场景上运行.

You should be able to update the SceneUnderstandingManager.cs file from the https://github.com/microsoft/MixedReality-SceneUnderstanding-Samples to call ComputeAsync instead of ComputeSerializedAsync if you want the samples to run on the world rather than on the saved scenes.

如果您需要更具体的帮助,您需要提供更具体的详细信息,说明您正在做什么、您尝试过什么以及您获得的行为与您试图获得的行为有何不同.

If you need more specific help you'll need to provide more specific details about what exactly you're doing, what you've tried, and how the behaviour you get differs from the behaviour you are trying to get.

这篇关于全息镜头 2 |微软 - 有没有人让场景理解实时工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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