docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRImageTrackingSubsystem

    A subsystem for detecting and tracking a preconfigured set of images in the environment.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    XRImageTrackingSubsystem
    SimulationImageTrackingSubsystem
    Implements
    ISubsystem
    Inherited Members
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.GetChanges(Allocator)
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnCreate()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnStart()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnStop()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnDestroy()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.provider
    SubsystemWithProvider.Start()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.OnDestroy()
    SubsystemWithProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public class XRImageTrackingSubsystem : TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>, ISubsystem

    Constructors

    XRImageTrackingSubsystem()

    Constructs a subsystem. Do not invoke directly; call Create on the XRImageTrackingSubsystemDescriptor instead.

    Declaration
    public XRImageTrackingSubsystem()

    Properties

    currentMaxNumberOfMovingImages

    The current maximum number of moving images to track. This can be different from requestedMaxNumberOfMovingImages.

    Declaration
    public int currentMaxNumberOfMovingImages { get; }
    Property Value
    Type Description
    int

    imageLibrary

    Get or set the reference image library. This is the set of images to look for in the environment.

    Declaration
    public RuntimeReferenceImageLibrary imageLibrary { get; set; }
    Property Value
    Type Description
    RuntimeReferenceImageLibrary
    Remarks

    A RuntimeReferenceImageLibrary is created at runtime and can be modifiable (see MutableRuntimeReferenceImageLibrary). You can create a RuntimeReferenceImageLibrary from an XRReferenceImageLibrary using CreateRuntimeLibrary(XRReferenceImageLibrary).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the subsystem has been started, and you attempt to set the image library to null.

    See Also
    OnStart()
    OnStop()
    XRReferenceImageLibrary
    MutableRuntimeReferenceImageLibrary

    requestedMaxNumberOfMovingImages

    The requested maximum number of moving images to track.

    Declaration
    public int requestedMaxNumberOfMovingImages { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the subsystem does not support tracking moving images. Check for support of this feature with supportsMovingImages.

    Methods

    CreateRuntimeLibrary(XRReferenceImageLibrary)

    Creates a RuntimeReferenceImageLibrary from an existing XRReferenceImageLibrary, or an empty library if serializedLibrary is null. Use this to construct the runtime representation of an XRReferenceImageLibrary.

    Declaration
    public RuntimeReferenceImageLibrary CreateRuntimeLibrary(XRReferenceImageLibrary serializedLibrary)
    Parameters
    Type Name Description
    XRReferenceImageLibrary serializedLibrary

    An existing XRReferenceImageLibrary created at edit time, or null to create an empty image library.

    Returns
    Type Description
    RuntimeReferenceImageLibrary

    A new RuntimeReferenceImageLibrary representing the deserialized version of serializedLibrary or an empty library if serializedLibrary is null.

    Remarks

    If the subsystem supports runtime mutable libraries (see supportsMutableLibrary), then the returned library will be a MutableRuntimeReferenceImageLibrary.

    See Also
    RuntimeReferenceImageLibrary

    GetChanges(Allocator)

    Retrieve the changes in the state of tracked images (added, updated, and removed) since the last call to GetChanges.

    Declaration
    public override TrackableChanges<XRTrackedImage> GetChanges(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The allocator to use for the returned set of changes.

    Returns
    Type Description
    TrackableChanges<XRTrackedImage>

    The set of tracked image changes (added, updated, and removed) since the last call to this method.

    Overrides
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.GetChanges(Allocator)

    OnStart()

    Starts the subsystem, that is, starts detecting images in the scene. imageLibrary must not be null.

    Declaration
    protected override void OnStart()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.Provider>.OnStart()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if imageLibrary is null.

    OnStop()

    Stops the subsystem, that is, stops detecting and tracking images.

    Declaration
    protected override sealed void OnStop()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.Provider>.OnStop()

    Implements

    UnityEngine.ISubsystem

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Constructors
      • XRImageTrackingSubsystem()
    • Properties
      • currentMaxNumberOfMovingImages
      • imageLibrary
      • requestedMaxNumberOfMovingImages
    • Methods
      • CreateRuntimeLibrary(XRReferenceImageLibrary)
      • GetChanges(Allocator)
      • OnStart()
      • OnStop()
    • Implements
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)