This repository enables single and multi-marker detection and tracking using OpenCV for Meta Quest 3/3S.
It provides sample scenes that support both ArUco(Single/Multi) and ChArUco(Single) markers for augmented reality applications on Quest devices.
This repository contains two versions of the project:
-
QuestMarkerTracking_New: Uses the Passthrough Camera Access component introduced in Meta XR SDK v83 for simpler camera image access.
-
QuestMarkerTracking_Old: Uses the previous WebCamTexture-based approach.
For a demonstration, check out the following videos:
⚠ Important Notice
When opening the project for the first time, you will likely encounter errors. This is because OpenCV for Unity is not yet installed.
Please ignore the errors initially, proceed to open the project, and install OpenCV for Unity manually.
This project uses OpenCV for Unity.
Please PURCHASE and install it from the Unity Asset Store:
OpenCV for Unity
Tested with OpenCV for Unity v3.0.0.
- QuestMarkerTracking_New: Meta XR SDK v83 or later (for Passthrough Camera Access support)
- QuestMarkerTracking_Old: Compatible with earlier versions of Meta XR SDK
Choose the appropriate project folder based on your requirements:
- Open QuestMarkerTracking_New for the latest implementation using Passthrough Camera Access
- Open QuestMarkerTracking_Old for the WebCamTexture-based approach
To use this project, please download and install the required marker files from the following links:
- ArUco Markers: ArUcoMarker.pdf
- ChArUco Marker: ChArUcoMarker.pdf
Both project versions contain the following scenes:
- ArUco Marker Tracking (Single & Multi):
ArUcoMarkerTracking.unity - ChArUco Marker Tracking:
ChArUcoMarkerTracking.unity
- Marker Dictionary: DICT_4X4_50
- Marker Size: 0.1m
Feel free to modify these settings to suit your needs.
- Marker Dictionary: DICT_4X4_50
- Board Configuration: 5 x 4 squares
- Square Size: 0.05m
These values are used by default in the ChArUco sample scene. Adjust them as needed.
You can switch the view mode by pressing the A button on the controller.
If you want to track multiple ArUco markers simultaneously or change the number of markers in the scene, follow these steps.
- Open the ArUcoMarkerTracking.unity scene and select the
ArUcoTrackingAppCoordinatorGameObject. - In the Inspector, locate the ArUcoMarkerTrackingAppCoordinator component and find the
MarkerGameObjectPairsarray. - Change the size of this array to match the number of markers you want to use.
- For each Element, specify:
- Marker Id: The ID of the marker you want to detect.
- Game Object: The GameObject to display on top of the detected marker.
- Important Notes:
- Make sure there are no duplicate Marker IDs across the Elements.
- Keep the Marker IDs within the valid range defined by the dictionary you are using (for example, DICT_4X4_50 allows IDs from
0to49).
Below is an example of how Marker Id and Game Object pairs are set up in the Inspector:
This implementation is based on the following sample repositories:
If you have any questions, feel free to reach out:
- X (Twitter):
- LinkedIn: Tks Yoshinaga


