Observer and Observations

Vuforia Engine observes the real world through configured and activated Observers. An Observer creates Observations, that represent information about a target. Observations are collected in the State.

An Observer is a component that is configured and associated to an element of the real world. This can be a target or other things like e.g. lighting conditions. An Observer could for example be configured to observe an image, a 3D object, an area in the user’s physical environment or features of a scene. The target is in many cases associated through a database that contains a digital representation of the target. At runtime, the Vuforia Engine will search for any targets that you have configured and created with an Observer.

An Observation is then the information about that target that is communicated to the application through Vuforia Engine’s state. As the application is running and Vuforia Engine observes the environment using the camera and device tracking information, Observations deliver information on the status of the tracking quality and the poses of the detected targets. This is essential information that helps you place and maintain digital content to a physical object and in making your content react to environment changes and device movement.

Unity

In Unity, Observers are represented by the different ObserverBehaviour. For instance, an ImageTargetBehaviour observes a specific Image Target. See Getting Started with Vuforia Engine in Unity for more information about how to set up Target game object in Unity.

Once an ObserverBehaviour like an ImageTargetBehaviour is created and active, it will automatically process Observations. Vuforia Engine will trigger events when the target is detected and lot, and automatically updates the position of the corresponding game object in the Unity scene. These events are by default processed by the DefaultObserverEventHandler component that is attached to any ObserverBehaviour’s game object.

The DefaultObserverEventHandler takes care of rendering augmentations when a target is actively tracked, and hiding it if it is not. Some configuration settings can be changed directly from the inspector of that component, and Unity events are exposed to add custom behavior.
It is also possible to replace the DefaultObserverEventHandler with a custom event handler implementation.

For more information about the Vuforia Engine life cycle in Unity and an overview of the API, see Vuforia Engine API for Unity. See also Pose Status and Status Info for detailed information on the returned status. 

Native

Observer Types

Each Vuforia feature can be identified with an enum value. When getting Observations from the state, it is often helpful to filter by the Observer type you are looking for:

VuObserverType

Identifiable as enum values

  • VU_OBSERVER_ANCHOR_TYPE
  • VU_OBSERVER_AREA_TARGET_TYPE
  • VU_OBSERVER_CLOUD_IMAGE_TARGET_TYPE
  • VU_OBSERVER_CYLINDER _TARGET_TYPE
  • VU_OBSERVER_DEVICE_POSE_TYPE
  • VU_OBSERVER_ILLUMINATION _TYPE
  • VU_OBSERVER_IMAGE_TARGET_TYPE
  • VU_OBSERVER_MODEL_TARGET_TYPE
  • VU_OBSERVER_MULTI_TARGET_TYPE
  • VU_OBSERVER_OBJECT_TARGET_TYPE
  • VU_OBSERVER_VIRTUAL_BUTTON_TYPE
  • VU_OBSERVER_VUMARK _TYPE
Observer Management

Identify the Observer by its type, or by its assigned unique id.

  • vuObserverGetType
  • vuObserverGetId

An Observer’s lifecycle is managed by Vuforia Engine. Create, destroy, activate and deactivate Observers are all done with Engine functions. See Vuforia Engine Lifecycle for more information and best practices.

Observation Types

Observations also have a type associated with them. Depending on its type you can access the pose and status of a target with vuObservationGetPoseInfo.

For example, to get information on the status info and target info of a tracked image, you would call vuImageTargetObservationGetStatusInfo and vuImageTargetObservationGetTargetInfo. For some generic info types, you can query if a particular info is available, e.g. for pose info you can call vuObservationHasPoseInfo(). To see what pose status and status info Observations provide, please see Status Poses and Status Info.

Access information specified by the Observation type:

VuObservationType

Identifiable as enum values

  • VU_OBSERVATION_ANCHOR_TYPE
  • VU_OBSERVATION _AREA_TARGET_TYPE
  • VU_OBSERVATION _CLOUD_IMAGE_TARGET_TYPE
  • VU_OBSERVATION _CYLINDER _TARGET_TYPE
  • VU_OBSERVATION _DEVICE_POSE_TYPE
  • VU_OBSERVATION _ILLUMINATION _TYPE
  • VU_OBSERVATION _IMAGE_TARGET_TYPE
  • VU_OBSERVATION _MODEL_TARGET_TYPE
  • VU_OBSERVATION _MULTI_TARGET_TYPE
  • VU_OBSERVATION _OBJECT_TARGET_TYPE
  • VU_OBSERVATION _VIRTUAL_BUTTON_TYPE
  • VU_OBSERVATION _VUMARK _TYPE
Observation Management
  • Check the Observation type with vuObservationGetType.
  • Or get the Observer associated to an Observation with vuObservationGetObserver.