Skip to main content
Version: 20 Mar 2024

MagicLeapMarkerUnderstandingFeature

NameSpace: MagicLeapSupport

Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature

Public Methods

MarkerDetector CreateMarkerDetector

Creates a marker detector with predefined settings.

public MarkerDetector CreateMarkerDetector(
MarkerDetectorSettings settings
)

Parameters

TypeNameDescription
MarkerDetectorSettingssettingsThe marker detector settings to be associated with the marker detector to be created.

Returns: The marker detector that has been created. Returns null if the number of active marker detectors is at the limit.


void DestroyAllMarkerDetectors

Destroys all actively tracked marker detectors.

public void DestroyAllMarkerDetectors()

void DestroyMarkerDetector

Destroys the specified marker detector.

public void DestroyMarkerDetector(
MarkerDetector markerDetector
)

Parameters

TypeNameDescription
MarkerDetectormarkerDetectorThe marker detector to be destroyed.

void ModifyMarkerDetector

Provides the ability to modify a marker detector with new settings. Note: this method actually destroys the old marker detector and replaces it with a newly created one. However, this approach maintains the index position of it in the marker detectors list.

public void ModifyMarkerDetector(
MarkerDetectorSettings settings,
ref MarkerDetector markerDetector
)

Parameters

TypeNameDescription
MarkerDetectorSettingssettingsThe marker detector settings to be associated with the marker detector to be created.
ref MarkerDetectormarkerDetectorThe specified marker detector to modify.

Returns: The newly created marker detector that replaced the old one. This returns null if the specified marker detector is not tracked.


void UpdateMarkerDetectors

Updates the status and data for all actively tracked marker detectors.

public void UpdateMarkerDetectors()

Protected Methods

GetFeatureId

protected virtual override string GetFeatureId()

Reimplements: GetFeatureId


OnInstanceCreate

protected override bool OnInstanceCreate(
ulong xrInstance
)

Parameters

TypeNameDescription
ulongxrInstance

OnSessionCreate

protected override void OnSessionCreate(
ulong xrSession
)

Parameters

TypeNameDescription
ulongxrSession

Public Attributes

FeatureId


public const string FeatureId = "com.magicleap.openxr.feature.ml2_markerunderstanding";


MarkerDetectors

The active marker detectors tracked by the marker understanding feature.


public IReadOnlyList< MarkerDetector > MarkerDetectors => markerDetectors;

TypeDescription
IReadOnlyList< MarkerDetector >Used to detect data from a specified type of marker tracker based on specific settings.

Returns: A readonly list of the active marker detectors.


MarkerDetectorsLimit

The maximum number of marker detectors allowed at once.


public const int MarkerDetectorsLimit = 64;


Public Enums

AprilTagType

Supported pre-defined AprilTag dictionaries. Marker Understanding supports pre-defined AprilTag dictionaries. AprilTag dictionaries can be looked up and markers can be generated for them here: http://chev.me/arucogen/

EnumeratorValueDescription
Dictionary_16H504x4 bits, minimum hamming distance between any two codes = 5, 30 codes
Dictionary_25H95x5 bits, minimum hamming distance between any two codes = 9, 35 codes
Dictionary_36H106x6 bits, minimum hamming distance between any two codes = 10, 2320 codes
Dictionary_36H116x6 bits, minimum hamming distance between any two codes = 11, 587 codes

ArucoType

Supported pre-defined ArUco dictionaries. Marker Understanding supports pre-defined ArUco dictionaries. ArUco dictionaries can be looked up and markers can be generated for them here: http://chev.me/arucogen/

EnumeratorValueDescription
Dictionary_4x4_5004 by 4 pixel ArUco marker dictionary with 50 IDs.
Dictionary_4x4_1004 by 4 pixel ArUco marker dictionary with 100 IDs.
Dictionary_4x4_2504 by 4 pixel ArUco marker dictionary with 250 IDs.
Dictionary_4x4_10004 by 4 pixel ArUco marker dictionary with 1000 IDs.
Dictionary_5x5_505 by 5 pixel ArUco marker dictionary with 50 IDs.
Dictionary_5x5_1005 by 5 pixel ArUco marker dictionary with 100 IDs.
Dictionary_5x5_2505 by 5 pixel ArUco marker dictionary with 250 IDs.
Dictionary_5x5_10005 by 5 pixel ArUco marker dictionary with 1000 IDs.
Dictionary_6x6_506 by 6 pixel ArUco marker dictionary with 50 IDs.
Dictionary_6x6_1006 by 6 pixel ArUco marker dictionary with 100 IDs.
Dictionary_6x6_2506 by 6 pixel ArUco marker dictionary with 250 IDs.
Dictionary_6x6_10006 by 6 pixel ArUco marker dictionary with 1000 IDs.
Dictionary_7x7_507 by 7 pixel ArUco marker dictionary with 50 IDs.
Dictionary_7x7_1007 by 7 pixel ArUco marker dictionary with 100 IDs.
Dictionary_7x7_2507 by 7 pixel ArUco marker dictionary with 250 IDs.
Dictionary_7x7_10007 by 7 pixel ArUco marker dictionary with 1000 IDs.

MarkerDetectorCamera

The MarkerDetectorCamera enum values are used to hint to the camera that should be used. This is set in the CustomProfileSettings structure and this setting currently only applies to the aruco detectors.

EnumeratorValueDescription
RGB0Single RGB Camera.
WorldOne or more world cameras.

Details*

RGB camera has higher resolution than world cameras and are better suited for use cases where the target to be tracked is small or needs to be detected from far.

World cameras make use of multiple world cameras to improve accuracy and increase the FoV for detection. from far.


MarkerDetectorCornerRefineMethod

The Aruco/April tag detector comes with several corner refinement methods. Choosing the right corner refinement method has an impact on the accuracy and speed trade-off that comes with each detection pipeline. Corner refinement only applies to Aruco and April tags, not QR codes.

EnumeratorValueDescription
None0No refinement, may have inaccurate corners.
SubpixCorners have subpixel coordinates. High detection rate, very fast, reasonable accuracy.
ContourHigh detection rate, fast, reasonable accuracy.
AprilTagReasonable detection rate, slowest, but very accurate.

MarkerDetectorFPS

Used to hint to the back-end the max frames per second that should be analyzed. This is set in the CustomProfileSettings structure and this setting applies to all enabled trackers.

EnumeratorValueDescription
Low0
Medium
High
Max

Details*

CPU load is a combination of enabled detector types, FpsHint and ResolutionHint. More detectors with a higher FPS and resolution hints will result in a higher CPU load. High CPU load can affect the performance of your system.


MarkerDetectorFullAnalysisInterval

In order to improve performance, the detectors don't always run on the full frame. Full frame analysis is however necessary to detect new markers that weren't detected before. Use this option to control how often the detector may detect new markers and its impact on tracking performance.

EnumeratorValueDescription
Max0Detector analyzes every frame fully.
FastDetector analyzes frame fully very often.
MediumDetector analyzes frame fully a few times per second.
SlowDetector analyzes frame fully about every second.

MarkerDetectorProfile

Represents the different tracker profiles used to optimize marker tracking in difference use cases.

EnumeratorValueDescription
Default0Generic tracker profile. Tracker profile that covers standard use cases. If this does not fit the needs of the application try the other profiles.
SpeedUse this profile to reduce the compute load and increase detection/tracker speed. This can result poor poses.
AccuracyUse this profile to optimize for accurate marker poses. This can cause increased load on the compute.
SmallTargetsUse this profile to optimize for markers that are small or for larger markers that need to detected from far.
LargeFOVUse this profile to be able to detect markers across a larger Field Of View. Marker Tracker system will attempt to use multiple cameras to detect the markers.
CustomApplication can define a custom tracker profiler.

MarkerDetectorResolution

The MarkerDetectorResolution enum values are used to hint to the back-end the resolution that should be used. This is set in the CustomProfileSettings structure and this setting currently only applies to the QR, UPC and EAN detectors.

EnumeratorValueDescription
Low0
Medium
High

Details*

CPU load is a combination of enabled detector types, MarkerDetectorFPS and MarkerDetectorResolution. More detectors and a higher fps and resolution hints will result in a higher CPU load. High CPU load can affect the performance of your system.


MarkerDetectorStatus

The current status of the readiness of the marker tracker.

EnumeratorValueDescription
Pending0
Ready
Error

MarkerType

Represents the different marker types supported by the API

EnumeratorValueDescription
Aruco0
AprilTag
QR
EAN13
UPCA
Code128