unity升级新版本后ImagetTarget显示的是白色图片以及拓展识别Extended Tracking

来源:互联网 发布:java表达式 编辑:程序博客网 时间:2024/04/29 11:32

一、 升级unity版本为201702后遇到的问题

问题
1. 原来工程中正常显示的imageTarget显示变成了白色
2. VuforiaConfiguration配置中Webcam下面出现警告找不到摄像头设备

解决办法:
1. 点击assets-Editer-Vuforia-ImagetTargrt下的识别图文件,在Inspector面板中将Texture Type 设置为default,Texture Shape设置为2D然后Apply就可以解决
2. 修改assets-Vuforia-Editer-WebcamProfiles下的profile.xml文件添加
就可以了

<webcam deviceName="Gsou Audio Webcam">        <windows>            <!-- size of the web cam texture requested from Unity -->            <requestedTextureWidth>640</requestedTextureWidth>            <requestedTextureHeight>480</requestedTextureHeight>            <!-- size of the texture Unity's web cam texture will be rescaled to -->            <resampledTextureWidth>640</resampledTextureWidth>        </windows>        <osx>            <!-- size of the web cam texture requested from Unity -->            <requestedTextureWidth>640</requestedTextureWidth>            <requestedTextureHeight>480</requestedTextureHeight>            <!-- size of the texture Unity's web cam texture will be rescaled to -->            <resampledTextureWidth>640</resampledTextureWidth>        </osx>    </webcam>

note:deviceName 替换成自己的摄像投设备名称

二、拓展识别 Extended Tracking

在官网看到的关于这一功能的概述:

扩展跟踪利用环境的功能来提高跟踪性能,并在目标不再可见的情况下持续跟踪,即使识别图脱离相机视野,Vuforia使用环境中的其他信息通过视觉追踪环境来推断目标位置

我觉得这样就很大程度优化了识别出物体后由于模型比较大在改变相机位置进行观察时一旦识别图脱离视野,模型就立刻消失的情况
适用于下面的场景:
- ar场景有需要将相机移动的交互需求
- 模型比例比较大,需要移动视角进行观察
- 静态场景
- 单目标识别

官方的图片很直观的说明了这种情况

1
2

第一张图片表示了识别图在视野中的增强现实场景,但是当视野上移时,识别图脱离相机,开启了拓展追踪后仍然可以继续增强现实场景
开启方式1
3
开启方式2(代码实现动态切换)

// Starts/stops extended tracking for a given trackablepublic void UseExtendedTracking(string trackableName, bool enabled) {    IEnumerable<TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();    foreach (TrackableBehaviour tb in tbs) {        // check trackable name        if (tb.TrackableName.Equals( trackableName )) {            if (enabled)                 tb.StartExtendedTracking();            else                tb.StopExtendedTracking();            return;        }    }}

https://library.vuforia.com/articles/Training/Extended-Tracking.html

阅读全文
0 0
原创粉丝点击