MagicLeapMarkerUnderstandingFeature
NameSpace: MagicLeapSupport
Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature
Public Methods
MarkerDetector CreateMarkerDetector
Creates a marker detector with predefined settings.
public MarkerDetector CreateMarkerDetector(
MarkerDetectorSettings settings
)
Parameters
Type | Name | Description |
---|---|---|
MarkerDetectorSettings | settings | The 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
Type | Name | Description |
---|---|---|
MarkerDetector | markerDetector | The 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
Type | Name | Description |
---|---|---|
MarkerDetectorSettings | settings | The marker detector settings to be associated with the marker detector to be created. |
ref MarkerDetector | markerDetector | The 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
Type | Name | Description |
---|---|---|
ulong | xrInstance |
OnSessionCreate
protected override void OnSessionCreate(
ulong xrSession
)
Parameters
Type | Name | Description |
---|---|---|
ulong | xrSession |
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;
Type | Description |
---|---|
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/
Enumerator | Value | Description |
---|---|---|
Dictionary_16H5 | 0 | 4x4 bits, minimum hamming distance between any two codes = 5, 30 codes |
Dictionary_25H9 | 5x5 bits, minimum hamming distance between any two codes = 9, 35 codes | |
Dictionary_36H10 | 6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes | |
Dictionary_36H11 | 6x6 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/
Enumerator | Value | Description |
---|---|---|
Dictionary_4x4_50 | 0 | 4 by 4 pixel ArUco marker dictionary with 50 IDs. |
Dictionary_4x4_100 | 4 by 4 pixel ArUco marker dictionary with 100 IDs. | |
Dictionary_4x4_250 | 4 by 4 pixel ArUco marker dictionary with 250 IDs. | |
Dictionary_4x4_1000 | 4 by 4 pixel ArUco marker dictionary with 1000 IDs. | |
Dictionary_5x5_50 | 5 by 5 pixel ArUco marker dictionary with 50 IDs. | |
Dictionary_5x5_100 | 5 by 5 pixel ArUco marker dictionary with 100 IDs. | |
Dictionary_5x5_250 | 5 by 5 pixel ArUco marker dictionary with 250 IDs. | |
Dictionary_5x5_1000 | 5 by 5 pixel ArUco marker dictionary with 1000 IDs. | |
Dictionary_6x6_50 | 6 by 6 pixel ArUco marker dictionary with 50 IDs. | |
Dictionary_6x6_100 | 6 by 6 pixel ArUco marker dictionary with 100 IDs. | |
Dictionary_6x6_250 | 6 by 6 pixel ArUco marker dictionary with 250 IDs. | |
Dictionary_6x6_1000 | 6 by 6 pixel ArUco marker dictionary with 1000 IDs. | |
Dictionary_7x7_50 | 7 by 7 pixel ArUco marker dictionary with 50 IDs. | |
Dictionary_7x7_100 | 7 by 7 pixel ArUco marker dictionary with 100 IDs. | |
Dictionary_7x7_250 | 7 by 7 pixel ArUco marker dictionary with 250 IDs. | |
Dictionary_7x7_1000 | 7 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.
Enumerator | Value | Description |
---|---|---|
RGB | 0 | Single RGB Camera. |
World | One 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.
Enumerator | Value | Description |
---|---|---|
None | 0 | No refinement, may have inaccurate corners. |
Subpix | Corners have subpixel coordinates. High detection rate, very fast, reasonable accuracy. | |
Contour | High detection rate, fast, reasonable accuracy. | |
AprilTag | Reasonable 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.
Enumerator | Value | Description |
---|---|---|
Low | 0 | |
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.
Enumerator | Value | Description |
---|---|---|
Max | 0 | Detector analyzes every frame fully. |
Fast | Detector analyzes frame fully very often. | |
Medium | Detector analyzes frame fully a few times per second. | |
Slow | Detector analyzes frame fully about every second. |
MarkerDetectorProfile
Represents the different tracker profiles used to optimize marker tracking in difference use cases.
Enumerator | Value | Description |
---|---|---|
Default | 0 | Generic tracker profile. Tracker profile that covers standard use cases. If this does not fit the needs of the application try the other profiles. |
Speed | Use this profile to reduce the compute load and increase detection/tracker speed. This can result poor poses. | |
Accuracy | Use this profile to optimize for accurate marker poses. This can cause increased load on the compute. | |
SmallTargets | Use this profile to optimize for markers that are small or for larger markers that need to detected from far. | |
LargeFOV | Use 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. | |
Custom | Application 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.
Enumerator | Value | Description |
---|---|---|
Low | 0 | |
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.
Enumerator | Value | Description |
---|---|---|
Pending | 0 | |
Ready | ||
Error |
MarkerType
Represents the different marker types supported by the API
Enumerator | Value | Description |
---|---|---|
Aruco | 0 | |
AprilTag | ||
QR | ||
EAN13 | ||
UPCA | ||
Code128 |