Marker Tracker Overview
The Magic Leap allows you to detect two-dimensional icons from a marker dataset and then continuously track the targets' locations and orientations as you or the markers move through the environment. You can also place and anchor digital content based on the presence and dimensions of a physical marker.
Magic Leap devices track fiducial markers, using a tracking system separate from the image tracking system. You can only have one type of active tracker at a time, however the Marker Tracker allows you to track multiple types of markers at once.
The MLBarcodeScanner
and MLArucoTracker
APIs on the Magic Leap 1 have been unified into a single MLMarkerTracker
API for Magic Leap 2.
This feature requires the MARKER_TRACKING
permission to be enabled in your project's Manifest Settings. (Edit > Project Settings > Magic Leap > Manifest Settings)
Supported Fiducial Markers
- QR
- Aruco
- EAN_13 (experimental)
- UPC_A (experimental)
Due to the 4X4 and the 'Aruco Original' dictionaries suffering from frequent false detections, we discourage their use.
Troubleshooting and FAQ
- Make sure the target markers are well-lit, whether physically printed or digitally displayed, or else the camera may not detect the marker. At the same time, make sure there isn't too much light reflecting off the marker that may obscure its features.
- Print your markers in black and white. High contrast is important to detect the marker and poses.
- To aid detection, include a white border around your marker. The white border must be large enough to be clearly visible on the camera.
Learn More
📄️ Marker Tracker API Overview
This section provides an overview of the marker tracker and references to create a custom Marker Tracking script.
📄️ Marker Tracker Example
This section includes an example of detecting Fiducial Markers on the Magic Leap 2 headset.
📄️ Marker Tracker Events Example
The Magic Leap 2's marker tracker API is light weight and can be extended depending on your application's needs. This section provides an example of extending the API to broadcast an event when a marker is found, lost or updated based on the amount of time that has passed since the marker was update.
📄️ Migrating from ML1
The MLBarcodeScanner and MLArucoTracker APIs have been unified into a single MLMarkerTracker API. Additionally, unlike the ML1, the Marker Tracker on the Magic Leap 2 manages its own lifecycle, meaning that the Tracker does not have to be stopped or disposed manually when exiting the app.