[英]Get camera frame from Vuforia in Unity
I want to create a simple AR application using unity3d, vuforia package and opencv. 我想使用unity3d,vuforia软件包和opencv创建一个简单的AR应用程序。 Normally in unity AR app, selected 2d target is found and virtual 3d object is projected.
通常,在统一AR应用程序中,找到选定的2d目标并投影虚拟3d对象。
I want to change these scenario. 我想改变这些情况。
To do this task, I did below steps : 为此,我做了以下步骤:
unity
unity
创建一个新项目 vuforia package
vuforia package
main camera
main camera
The AR camera has 3 c#
files, I open and look them. AR相机有3个
c#
文件,我打开并查看它们。 But I don't see any code open camera and get frame. 但是我看不到任何代码可以打开相机并获得框架。 The screenshot is below :
屏幕截图如下:
EDIT 编辑
Accepted answer helps load user defined marker. 接受的答案有助于加载用户定义的标记。
This is the basic workflow of Vuforia using Unity. 这是使用Unity的Vuforia的基本工作流程。
Start from License Manager 从许可证管理器开始
On the License Manager
page go to Add License Key
在“
License Manager
页面上,转到“ Add License Key
bPut in your details and if you don't plan to use a paid version in the Select Plan
option click None
b输入您的详细信息,如果您不打算在“
Select Plan
选项中使用付费版本,请单击“ None
Now go to Target Manager 现在转到目标管理器
First Add a Database
(if you don't have one already) and give it a Name
, add License Key
and click Create
首先
Add a Database
(如果还没有Add a Database
话),并给它Name
,添加License Key
,然后单击Create
Now inside your Database click Add Target
and again put in all the details and upload your image. 现在,在数据库中单击“
Add Target
然后再次放入所有详细信息并上传图像。
Now Download Database
and make sure you've set it's usage to Unity Editor
现在
Download Database
,并确保已将其用法设置为Unity Editor
Now within Unity 现在在Unity中
Add your ARCamera
添加您的
ARCamera
Import the Database you downlaoded into Unity through Assets
- Import Package
- Custom Package
通过
Assets
- Import Package
- Custom Package
将您下层的数据库导入Unity
Now in your Inspector Panel of ARCamera, you'll see Data Set Load Behaviour
has your unity package name. 现在,在ARCamera的Inspector面板中,您将看到
Data Set Load Behaviour
具有您的统一软件包名称。 Check it, and check Active
as well 选中它,然后选中“
Active
”
Now in Assets
, Go to Qualcomm
- Prefabs
- ImageTarget
and drag Image Target onto the scene. 现在在
Assets
,转到Qualcomm
- Prefabs
- ImageTarget
并将Image Target拖到场景上。
In the ImageTarget
Inspector
you'll find ImageTarget
behaviour and you can set the values to your Image. 在
ImageTarget
Inspector
您将找到ImageTarget
行为,并且可以将值设置为Image。
From here on, what you do is completely up to you. 从这里开始,您的工作完全取决于您自己。 You can add a Model or animate over is as you would on normal Unity applicatoins.
您可以像在普通Unity应用程序中那样添加模型或设置动画。
User Defined Targets can be found at: https://developer.vuforia.com/library/articles/Solution/Unity-Load-DataSet-from-SD-Card 用户定义的目标可在以下位置找到: https : //developer.vuforia.com/library/articles/Solution/Unity-Load-DataSet-from-SD-Card
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.