加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 如何在PC应用程序上使用vuforia

发布时间:2020-12-15 21:47:26 所属栏目:百科 来源:网络整理
导读:我是vuforia的新手,我需要一些关于这个主题的帮助. 有人能告诉我它是否可以在PC应用程序中使用vuforia和网络摄像头? 我在平面纹理上得到了网络摄像头帧,我试图将这些纹理传递给vuforia,但我还没有完成它. 我使用WebCamTexture来获取网络摄像头的帧. 解决方
我是vuforia的新手,我需要一些关于这个主题的帮助.
有人能告诉我它是否可以在PC应用程序中使用vuforia和网络摄像头?
我在平面纹理上得到了网络摄像头帧,我试图将这些纹理传递给vuforia,但我还没有完成它.

我使用WebCamTexture来获取网络摄像头的帧.

解决方法

我对Vuforia并不熟悉(尽管它看起来很有趣,我本周末会自己尝试一下!),我可能会有一个建议.

有可能Vuforia不知道该怎么做因为图像是WebCamTexture而不是像Texture2d这样的东西吗?

WebCamTexture是一个纹理(Texture2D,WebCamTexture,RenderTexture都是从Texture扩展但它们不可交换).

那么,尝试转换你的纹理并将其传递给Vuforia?

var tx2d = new Texture2D();
tx2d.SetPixels((go.renderer.material.mainTexture as WebCamTexture).GetPixels());

编辑:我在编辑器中运行的部分下找到了here:

有一个特定的Web Cam Behavior脚本.

To use Play Mode for Vuforia in Unity Pro,simply select the attached,
or built-in,webcam that you want to use from the Camera Device menu,
and then activate Play Mode using the Play button at the top of the
Editor UI.

You can also use the standard Unity Play Mode with non-Pro Unity
versions and by setting ‘Don’t use for Play Mode’ in the Web Cam
Behaviour component.

To use standard Play Mode,adjust the transform of the ARCamera object to get your entire scene in view,and then run the application in the Unity editor. There is no live camera image or tracking in standard Play Mode,instead all Targets are assumed to be visible. This allows you to test the non-AR components of your application,such as scripts and animations,without having to deploy to the device each time.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读