This repository enables single and multi-marker detection and tracking using OpenCV with the Passthrough Camera API 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.
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 v2.6.5.
To use this project, please download and install the required marker files from the following links:
- ArUco Markers: ArUcoMarker.pdf
- ChArUco Marker: ChArUcoMarker.pdf
- 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
ArUcoTrackingAppCoordinator
GameObject. - In the Inspector, locate the ArUcoMarkerTrackingAppCoordinator component and find the
MarkerGameObjectPairs
array. - 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
0
to49
).
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