Skip to content

TakashiYoshinaga/QuestArUcoMarkerTracking

Repository files navigation

Quest ArUco Marker Tracking

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.

Project Structure

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:

  • Single Marker Tracking Demo (ArUco)
    Single Marker Demo

  • Multi-Marker Tracking Demo (ArUco)
    Multi-Marker Demo

  • ChArUco Marker Tracking Demo
    ChArUco Demo


Dependencies

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.

SDK Requirements

  • QuestMarkerTracking_New: Meta XR SDK v83 or later (for Passthrough Camera Access support)
  • QuestMarkerTracking_Old: Compatible with earlier versions of Meta XR SDK

Usage

Selecting a Project Version

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

Marker Preparation

To use this project, please download and install the required marker files from the following links:

Unity Scenes

Both project versions contain the following scenes:

  • ArUco Marker Tracking (Single & Multi): ArUcoMarkerTracking.unity
  • ChArUco Marker Tracking: ChArUcoMarkerTracking.unity

Default Settings

ArUco Marker

  • Marker Dictionary: DICT_4X4_50
  • Marker Size: 0.1m
    Feel free to modify these settings to suit your needs.

ChArUco Marker

  • 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.

View Mode Switching

You can switch the view mode by pressing the A button on the controller.


How to Change the Number of ArUco Markers

If you want to track multiple ArUco markers simultaneously or change the number of markers in the scene, follow these steps.

  1. Open the ArUcoMarkerTracking.unity scene and select the ArUcoTrackingAppCoordinator GameObject.
  2. In the Inspector, locate the ArUcoMarkerTrackingAppCoordinator component and find the MarkerGameObjectPairs array.
  3. Change the size of this array to match the number of markers you want to use.
  4. 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.
  5. 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 to 49).

Below is an example of how Marker Id and Game Object pairs are set up in the Inspector:

fig1


Reference Repositories

This implementation is based on the following sample repositories:


Contact

If you have any questions, feel free to reach out:

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors