Hololens - 访问相机框架

Hololens - Access Camera Frames

在 3D 模式下,如何访问全息相机视频流中的所有帧?我正在使用 C#。

统一 VideoCapture class 似乎没有提供这个: http://docs.unity3d.com/550/Documentation/ScriptReference/VR.WSA.WebCam.VideoCapture.html

和 Microsoft MediaCapture class 方法 MediaCapture.StartPreviewToCustomSinkAsync 没有很好的文档记录。 https://msdn.microsoft.com/en-us/library/windows/desktop/ms701626(v=vs.85).aspx

您可以尝试使用 MediaCapture FrameReader API

文档: https://msdn.microsoft.com/en-gb/windows/uwp/audio-video-camera/process-media-frames-with-mediaframereader#create-a-frame-reader-for-the-frame-source

示例代码: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraFrames

我们创建了一个名为 CameraStream 的开源项目来满足这一需求。作为一个 Unity 插件,它使用 MediaCapture 将字节数组馈送到 Unity(连同可定位矩阵)。从那里您可以将字节分配给 Texture2D,如提供的 Unity 示例所示。

我们的 VideoCapture class 模仿 Unity's class of the same name 以便开发人员熟悉如何使用它。我们还假设此功能最终将由 Unity 开箱即用地提供。