A configuration you use when you just want to track known images using the device's back camera feed.


class ARImageTrackingConfiguration : ARConfiguration


All AR configurations establish a correspondence between the real world the device inhabits and a virtual 3D coordinate space where you can model content. When your app displays that content together with a live camera image, the user experiences the illusion that your virtual content is part of the real world.

With ARImageTrackingConfiguration, ARKit establishes a 3D space not by tracking the motion of the device relative to the world, but solely by detecting and tracking the motion of known 2D images in view of the camera. ARWorldTrackingConfiguration can also detect images, but each configuration has its own strengths:

  • World tracking has a higher performance cost than image-only tracking, so your session can reliably track more images at once with ARImageTrackingConfiguration.

  • Image-only tracking lets you anchor virtual content to known images only when those images are in view of the camera. World tracking with image detection lets you use known images to add virtual content to the 3D world, and continues to track the position of that content in world space even after the image is no longer in view.

  • World tracking works best in a stable, nonmoving environment. You can use image-only tracking to add virtual content to known images in more situations—for example, an advertisement inside a moving subway car.

When an image-tracking configuration detects known images, it tracks their movement with six degrees of freedom (6DOF): specifically, the three rotation axes (roll, pitch, and yaw), and three translation axes (movement in x, y, and z).

To use ARImageTrackingConfiguration, define ARReferenceImage objects (either at runtime or by bundling them in your Xcode asset catalog) and assign them to the configuration's trackingImages property. Then, as with any AR configuration, pass the configuration to your session's run(_:options:) method.


Creating a Configuration


Initializes a new image-tracking configuration.

Choosing Images to Track

var trackingImages: Set<ARReferenceImage>

A set of images that ARKit attempts to detect and track in the user's environment.

var maximumNumberOfTrackedImages: Int

The maximum number of images to simultaneously track movement for.

Managing Device Camera Behavior

var isAutoFocusEnabled: Bool

A Boolean value that determines whether the device camera uses fixed focus or autofocus behavior.


Inherits From

Conforms To

See Also

Image Tracking

Tracking and Altering Images

Create images from rectangular shapes found in the user’s environment, and augment their appearance.

Detecting Images in an AR Experience

React to known 2D images in the user’s environment, and use their positions to place AR content.

class ARReferenceImage

The description of an image you want ARKit to detect in the physical environment.

class ARImageAnchor

Information about the position and orientation of an image detected in a world-tracking AR session.