Vuforia的Extended Tracking(翻译)


请尊重原作者的工作,转载时请务必注明转载自:www.xionggf.com

原文地址

Extended Tracking utilizes features of the environment to improve tracking performance and sustain tracking even when the target is no longer in view.

Extended Tracking利用环境的特征点(features of environment),去提高追踪(tracking)的性能。即使是识别目标(target)不在观察视野内的时候,也能保持着对待识别物的追踪。

Extended Tracking allows the tracking a degree of persistence once a target has been detected. As the target goes out of view, Vuforia uses other information from the environment to infer the target position by visually tracking the environment. Vuforia builds a map around the target specifically for this purpose and assumes that both the environment and target are largely static.

一旦识别目标被检测到的时候,Extended Tracking允许对追踪作出一定程度的留存(a degree of persistence)。即使识别目标在视野之外,Vuforia将通过对环境的视觉追踪(visually tracking),使用环境的其他信息,对识别目标的位置,进行一个推测。基于这个目的,Vuforia将会在识别目标的周围,创建一个图。并且会假定环境和识别目标大部分都是静止的。

Extended Tracking can significantly enhance two kinds of user experience:

Extended Tracking技术可以显著地改善两种用户体验:

Game or game-like experiences with a large amount of dynamic content that requires the user to point the device away from the target as the user follows the content

一些有着有大量的动态内容的游戏,这些游戏会让当用户跟随内容时,设备会远离识别目标。

Visualizations of large objects like furniture, appliances, large home furnishings and even architectural models at the right scale and perspective

目测一些大型的物体,例如家具,装置,大的房屋摆设,甚至是有正常比例和透视的建筑学模型时。

Use this feature to facilitate creating more robust applications, because any augmentations attached to these Targets will persist. In practice this means that after you point your device away from the initial Target, any augmentations maintain their positions with respect to the real world and are consistent with the initial reference frame defined by the target. The more detailed and feature--rich the environment, the better Extended Tracking works.

使用extended tracking将有助于创建更强壮的应用程序。因为任何绑定到本识别目标下的视觉增强物(augmentation)将会保持在原来的位置。实际上,这将意味着。当你把你的设备,从望向最开始观察的识别对象所在处,改望向到别的位置时,所有的视觉增强物将会保持原来的位置上。这个原来的位置,即是指该视觉增强物,与它所挂接的视觉目标物的一开始的相对位置。环境的细节越多,特征点越丰富(feature-rich),extended tracking工作得越好。

Let’s see how this works with regard to pictures and scenarios that use the new Vuforia Samples, which contain an Extended Tracking toggle in the options. The following example depicts the effects when running the Image Targets application with this toggle selected.

就下面所提供的,在新的vuforia示例中使用到的图片和场景,我们看看extended tracking是如何工作的。在这个示例中。有一个是否启用extended tracking的开关。下例展示了使用和不使用extended tracking时的效果

图A-左边 图B-右边

Figure A shows a device capturing a Stones Target in its field of view (FOV). The result is Figure B, which shows the Stones Target in view, along with augmentations.

图A展示了设备在它的FOV范围内,观察到了一个图案为石头的识别目标。图B则是一起显示了识别目标和增强物时的效果

As Figure B shows, the augmentations of buildings on top of a wooden table are displayed on the screen of the device. This encourages the user to pan to these items by moving the angle of the camera to point upwards, thereby making the Stones Target disappear from view.

如图B所示,桌子上的建筑物视觉增强物被显示在屏幕上了。这将允许用户把摄像机的观察角度朝向上摇晃,因而让识别目标从视野中消失。

In previous versions of Vuforia, this led to all augmentations disappearing, because the Target reference frame is lost. With the Extended Tracking feature, the buildings remain visible even when the Stones Target is not in the camera view. Figures C and D illustrate this:

在上一版本的Vuforia SDK中,让识别目标从视野中消失将会导致所有的视觉增强物随之消失。因为目标参考框架(target reference frame)丢失了。通过使用extendd tracking特性,即使识别目标不在摄像机视野之外,视觉增强物依然保持可视。如图C和D所示。

Note that after the Stones Target goes out of view it is not required for further display of the augmentations if this feature is enabled. That means that the augmentations persist without the target, and this capability supports more robust and continuous AR experiences.

注意当识别目标离开视野之后,不需要为了进一步显示视觉增强物去做别的操作。 如果这个特性被启用了。这意味着视觉增强物在不依赖于识别目标去进行维持显示。这个功能将会提供更健壮和连续的AR体验效果。

Extended Tracking

What if the environment or target is not static?

如果运行环境或者识别目标不是静态的话会怎样?

By default, Extended Tracking assumes that the environment the camera sees is mostly static. The Extended Tracking map will continually expand, so new objects added to the scene will become part of the map. This does imply some extra background processing to managing and optimizing the map which could be perceived as slow-down in the app if there's a lot of other processing going on. If a large part of the scene moves, it risks pulling the map with it and negatively impacting the offset accuracy between the target and the map. This offset may be recomputed when the target is tracked again. If only a small part of the scene moves, then it's possible that a negative impact to the offset may be minor and go unnoticed thus introducing small error in accuracy of extended tracked pose estimates. In this way, larger scene changes can sometimes be less problematic than more subtle ones.

默认地,extended tracking技术假定摄像机所观察到的环境是几乎静止的。extended tracking map(ETM)是不断扩大的。所以当新的物体加入到场景的时候将会作为ETM的一部分。这也就意味着做了一些额外的后台处理以管理和优化ETM
如果这些额外的处理很多的话,将会让人感觉到程序运行起来变慢了。如果场景中的很大的一部分移动的话。这将导致EMT反方向移动,从而使得识别目标和EMT之间看起来发生了晃动。如果只是场景中的很小一部分发生移动的话,EMT的负向偏移量可能是轻微的,并因此被忽视。在这种情况下,更大场景变换可能比一个微小的变换更加少不确定的因素。

If scene changes or changes of the target location are expected, then the application should NOT use Persistent Extended Tracking (PET). Not using PET is the safer approach here, as the map will be reset whenever tracking stops for a few seconds. PET should only be used if:

如果场景改变或者识别目标的位置发生改变是在预期之中的。那么应用程序则不应该使用这个持久化extended tracking技术。这会更加安全的。不使用PET的话,无论当什么时候,追踪停止若干秒时,ETM都将会重置。

the application does NOT need to afford scene or target location changes (and the 5s auto reset is therefore only harmful to the experience)

the application lets the advanced user reset the map manually when a scene change has happened.

Persistent Extended Tracking

With persistent mode turned on, Vuforia never resets or rebuilds the map during extended tracking. Instead, there is a dedicated resetExtendedTracking API (see below) that puts this in the hands of the developer. The application can keep the map for much longer, providing a seamless experience if the device is put down or the camera is stopped temporarily. Furthermore, if an additional target is detected and tracked, this target is appended to all existing targets that are being tracked.

当开启持久化模式的时候,只要处于extended tracking阶段。Vuforia将不会重置或者重建ETM。代替地,有一个resetExtendedTracking API可以去重置或者重建ETM。这也就是说把重建ETM的决定权交给开发者。应用程序可以保持EMT的原状足够长的时间,这样子当摄像机临时关闭或者放下的时候,不至于马上消失图像,这将提升用户体验。此外,如果附加的识别目标被检测和跟踪到的话,这个附加的识别目标将会被添加到所有的被追踪的识别目标集合中。

Trackables that support Extended Tracking

These targets support Extended Tracking:
下面所列的识别目标支持extended tracking

  1. Object Targets
  2. Image Targets
  3. Multi-Targets
  4. Cylinders
  5. User-Defined Targets
  6. Cloud Recognition
  7. VuMarks

Text and Frame Markers do not support Extended Tracking.

Text和Frame Markers目前不支持extended tracking

Under certain conditions, Extended Tracking can work with multiple targets, but be aware that all targets need to be in the right scale with respect to each other.

在某些条件下。Extended Tracking能工作在多个识别目标上。但必须注意的是所有的识别目标必须在是互相在正确的缩放值下

When Vuforia is configured to track one target at a time:

A target may still be extended tracked when it is out of view. Only when that target has lost tracking can a new target be tracked.
一个识别目标当它在视野之外时,依然保持extended tracked状态,仅当该识别目标已经丢失tracking之后,新的target才能被最终。

When Vuforia is configured to track more than one target simultaneously:

Extended Tracking should work fine with multiple simultaneous targets. If the targets are in physically disjoint locations, only one of the targets will be extended tracked. When tracking multiple simultaneous targets, it is recommended to NOT use Persistent Extended Tracking so that the Extended Tracking map will be able to reset 5 seconds after tracking is lost and be ready to use extended tracking on the next tracked target.

Extended Tracking在多个联合的(multiple simultaneous)识别目标上工作得很好。如果识别目标在一个不相连的位置上的话,只有一个识别目标时extended tracked的。当对多联合进行最终的时候。强烈建议不使用持久化extended tracking。这样子可以让追踪丢失5秒后能重置ETM,并且准备对下一个待追踪的目标进行extended tracking。

How To Use The Extended Tracking API

The following is a description of the API with examples of how to implement Extended Tracking in native code and Unity.

接下来通过示例讲述如何通过Unity或者原生API去实现extended tracking

Native API

The following code shows the updated Trackable base class definition, along with the updated API for startExtendedTracking() and stopExtendedTracking(), which control this feature.

接下来的代码显示了更新过的Trackable基类的定义。通过使用更新过的API。startExtendedTracking()和stopExtendedTracking(), 将能控制extended tracking的使用

class Vuforia_API Trackable : private NonCopyable
{
    //...

    /// Starts extended tracking for this Trackable
    /**
    * This function will return true if extended tracking was 
    * successfully started for this Trackable (or already started) 
    * and false otherwise.
    * 如果启用extended tracking成功,返回true,否则返回false
    */
    virtual bool startExtendedTracking() = 0;

     /// Stops extended tracking for the Trackable
    /**
    * This function will return true if extended tracking was
    * successfully stopped for this Trackable (or already stopped) 
    * and false otherwise.
    * 如果启用extended tracking成功,返回true,否则返回false
    */
    virtual bool stopExtendedTracking() = 0;

    virtual ~Trackable() {}
};

The TrackableResult class was updated in Vuforia SDK 2.8 so that getStatus() returns an EXTENDED_TRACKED status if the Natural Feature Tracker is no longer generating poses for the Trackable. When the Natural Feature Tracker is generating poses for the Trackable, getStatus() will return a TRACKED status.

类TrackableResult在2.8版本的SDK中更新了。所以当Natural Feature Tracker不在生成位置信息的时候,将会返回EXTENDED_TRACKED枚举值。当生成位置信息的时候,返回TRACKED枚举值

In addition, the Tracker class was updated to enable and disable Persistent Extended Tracking and to reset the Extended Tracking, as described earlier.

另外,类Tracker也更新了,可以启用或者停用持久化extended tracking,以及重置extended tracking

class Vuforia_API Tracker : private NonCopyable
{
    //...

    /// Enables/disables persistent extended tracking
    /**
    * In persistent extended tracking mode, the environment map will only
    * ever be reset when the developer calls resetExtendedTracking().
    * This function will return true if persistent extended tracking
    * was set successfully (or was already set to the specified value)
    * and false otherwise.
    * 在持续化模式下,environment map只会在用户调用resetExtendedTracking函数时
    * 被重置。当调用本函数启用持续化extended tracking成功时,将会返回true,否则
    * 返回false
    */
    virtual bool persistExtendedTracking(bool on) = 0;

    /// Resets environment map for extended tracking
    /**
    * Environment map can only be reset by the developer if persistent
    * extended tracking is enabled.
    * This function will return true if environment map was reset
    * successfully and false otherwise.
    * 只有持续化extented tracking成功启用时,才能调用本函数重置enviroment map
    * 成功返回true,失败返回false
    */
    virtual bool resetExtendedTracking() = 0;
};

Unity API

In Unity, implement this feature by ticking the Extended Tracking option in the Inspector, so that using an API is not mandatory. It can, however, be useful to understand how to control it using scripting for use in advanced scenarios.

在Unity中,要实现这个特征只需要在Inspector面板中点击Extended Tracking选项即可。所以并不需要强制地使用API。当然,也可以使用。了解这个底层机制在一些高级的应用场合下是必要的。

First, all supported targets implement a new interface, ExtendedTrackable, which contains two methods that mirror the native counterparts.

首先所有的支持extended tracking的识别目标都要实现一个新的接口ExtendedTrackable。该接口有两个对应于原生C++代码的方法

public interface ExtendedTrackable : Trackable
{
    // Start extended tracking. The Target can be tracked although it is not visible.
    bool StartExtendedTracking();

    // Stop extended tracking. Target will only be tracked when it is visible.
    bool StopExtendedTracking();
}

The TrackableBehaviour.status () contains the values TRACKED and EXTENDED_TRACKED. When the Natural Feature Tracker is tracking the object, this value will be TRACKED, even if the Extended Tracking option is enabled for the Trackable. When the Natural Feature Tracker loses the Trackable and Extended Tracking takes over (if Extended Tracking is enabled for the Trackable), the status will change to EXTENDED_TRACKED. The OnTrackableStateChanged() method in the DefaultTrackableEventHandler.cs file illustrates this.

TrackableBehaviour.status ()将返回TRACKED或者EXTENDED_TRACKED。当Natural Feature Tracker正在追踪着物体的时候。即使启用了extended tracking。返回的值也是TRACKED.当丢失被追踪物体时,如果extended tracking启用的话。返回的status将会变成EXTENDED_TRACKED。OnTrackableStateChanged()方法在DefaultTrackableEventHandler.cs文件中举例说明了。

public void OnTrackableStateChanged(
            TrackableBehaviour.Status previousStatus,
            TrackableBehaviour.Status newStatus)
{
       if (newStatus == TrackableBehaviour.Status.DETECTED ||
            newStatus == TrackableBehaviour.Status.TRACKED ||
            newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
       {
           OnTrackingFound();
       }
       else
       {
           OnTrackingLost();
       }
}