https://github.com/ajaymin28/aruco_python

This is Aruco Build in Python, basically it is written in C++. This is the bindings through Opencv

https://github.com/ajaymin28/aruco_python

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary

Keywords

opencv opencv-python opengl
Last synced: 5 months ago · JSON representation

Repository

This is Aruco Build in Python, basically it is written in C++. This is the bindings through Opencv

Basic Info
  • Host: GitHub
  • Owner: ajaymin28
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 10.6 MB
Statistics
  • Stars: 18
  • Watchers: 2
  • Forks: 10
  • Open Issues: 0
  • Releases: 0
Topics
opencv opencv-python opengl
Created about 8 years ago · Last pushed 8 months ago
Metadata Files
Readme

README.md

Augmented Reality with Aruco Markers in Python

A Python project that brings augmented reality to life by overlaying 3D objects on Aruco markers using OpenCV and OpenGL.

Demo

YouTube Demo


Requirements

  • Python 3.x
  • OpenCV 3.x (opencv_contrib required for Aruco support)
  • imutils
  • PyYAML
  • pygame
  • PyOpenGL

Install Python packages via pip:

bash pip install imutils pyyaml pygame PyOpenGL

Developed and tested on Anaconda 4 (Python 3.x, Windows 10), but should work on most platforms.


Project Structure

  • main.py: Main code. Loads the 3D object, initializes your camera, detects Aruco markers, and overlays the 3D object.
  • objloader.py: Utility for loading OBJ files (see PyGame Wiki).
  • .obj and .mtl files: Your 3D model (exported from Blender or other 3D software). Both are required for proper rendering.

Getting Started

  1. Camera Calibration
  • Calibrate your camera first. Use scripts in the calibration directory (see details below).
  • This generates a .yaml file for your camera matrix.

    1. Prepare Your Files
  • Place your camera_matrix.yaml, .obj, and .mtl files in the project’s main directory.

    1. Run the Demo

bash python main.py


Calibration

You can calibrate using either a chessboard or an Aruco board.

Aruco Board Calibration

  • Edit calibration/main.py:

    • Set your video source (camera index or file).
    • Set output YAML filename.
  • Run and follow the instructions.

  • When done, copy the generated YAML to the main directory.

Chessboard Calibration

  • Edit calibration/aruco.py:

    • Set your video source and output YAML filename.
  • Run the script.

  • Move or rename the generated YAML file to match the main directory config.


Using Your Own 3D Objects

  • Download .obj models with matching .mtl files (e.g., from Free3D).
  • Replace the .obj and .mtl files in your main directory.
  • Without an .mtl file, objects will render black.
  • You can create/edit models in Blender or other 3D tools.

Troubleshooting & Tips

  • OpenGL window lighting may be dimmer than OpenCV—work in a well-lit room.
  • All required files (main.py, objloader.py, model files, camera_matrix.yaml) must be in the same folder.
  • Report bugs or issues by opening an issue or reaching out.

License & Attribution

  • 3D models included are not owned by me. See the license/readme in models/ or zip/sinband/ for details.

References


Owner

  • Name: Jaimin Bhoi
  • Login: ajaymin28
  • Kind: user
  • Location: Bangalore
  • Company: Tata Consulatancy Services

A computer engineer. on my way to make computers do great things.

GitHub Events

Total
  • Watch event: 1
  • Push event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Push event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 2
  • Total pull requests: 0
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 2.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tuhintiwari (1)
  • BryceQing (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels