一. 下载“Vuforia SDK”  官网链接:https://developer.vuforia.com/

1.进行注册账号

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别

2.注册完成后,在Pricing界面进行选择免费付费版等,免费版会有水印

3.在Downloads界面进行SDK的下载,如下图所示。

4.其中“Download Unity Extension(legacy)”:是Unity2017.2之前的拓展包,如果当前使用的Unity版本在Unity2017.2之前下载这个,如果使用的版本在Unity2017.2及以上使用“Download Unity”,此处下载会跳转到Unity Store上(在Unity2017.2下载的时候Vuforia勾选上的话就已经打包进Unity中了)

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_02

 

二. 新建项目导入Vuforia包(本人使用的是Unity5.6.2版本,下载的是Vuforia拓展包)

1.当导入成功后菜单栏会如下图所示多一个“Vuforia”菜单栏

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_03

 

2.项目Assets文件夹如下,我们常用的资源在Vuforia/Prefabs文件夹下

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_04

 

 

三. 注册与当前项目匹配的LicenseKey

1.在官网Develop/License Manager一栏中,点击“Get Development Key”按钮进行获取LicenseKey

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_05

 

2.填入当前项目名称,同意协议,执行获取LicenseKey

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_06

 

 

3.点击创建的LicenseKey进入到详细内容界面

 

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_07

 

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_08

4.上图选中部分进行复制

5.Unity项目工程中将Prefabs中的“ARCamera”拖入到场景中,点击“Open Vuforia configuration”按钮,将复制好的LicenseKey粘贴上去进行匹配

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_09

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_10

四. 详细介绍一下“ARCamera”,AR项目的灵魂之处

1.相机的世界中心设置

:制定一个物体作为世界中心坐标

:摄像机所照射到的第一个需要识别的目标为世界中心坐标

:摄像机为世界中心的坐标

:设备追踪(以我们设备正在追踪的物体为世界中心坐标)

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_11

 

2.Open Vuforia Configuration 点击后的界面接受介绍

设备模式:一般选择默认就好

(质量优先)

(速度优先)

(默认)

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_12

 

最大识别数量

:最大识别的图片数量

:最大识别的物体数量

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_13

 

摄像头的调用

:默认摄像头(打开咱们摄像机默认前就是前,默认后就是后)

:指定后置摄像头

:指定前置摄像头

    需要注意的是:在电脑端调试单额时候“DEFAULT  BACK”摄像头就是电脑的前置摄像头(因为电脑没有后置摄像头)

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_14

 

 

五. Vuforia图片识别机制

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_15

 

六. Vuforia图片识别的注意事项

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_16

 

七. 本项目Vuforia数据库的创建

1.Develop/Target Manager界面进行数据库的创建

 

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_17

 

 

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_18

 

 

2.数据库进行识别图片上传

 

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_19

 

3.选择图片类型,选择本地图片,设置比例,名字,进行添加

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_官网_20

 

4.上传成功后如下,其中星数越多识别度越高

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_21

 

5.下载数据库包,此处选择UnityEditor版

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_22

 

 

6.将下载下来的数据库(Unity package包)导入到项目中

 

八.设置ImageTarget相关参数

1.将项目Prefabs中的ImageTarget拖放入场景中

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_游戏_23

 

2.设置数据库

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_24

 

3.设置识别图片

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_25

 

4.激活数据库

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_26

 

5.将我们需要显示的模型等资源放在“ImageTarget”下面作为其子物体存在

 

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_27

  

unity SpeechLib 下面没有SpVoice unity没有vuforia_数据库_28

九.发布手机端扫描对应图片即可(效果图如下)

unity SpeechLib 下面没有SpVoice unity没有vuforia_图片识别_29