This is Aruco built in Python using python bindings of opencv.
- Requirements
- python 3.x
- opencv 3.x
- opencv_contrib (for aruco)
- Packages requirements for python & opencv install it using pip commands.
- imutils
- yaml
I have used anaconda 4 with python version 3.x in windows 7.
- main.py
-> this file contains the main code which loads the 3d object in program, also initializes your camera and finds aruco marker and places the 3d object above the aruco marker.
- objloader.py
-> this file is provided by pygame refer to www.pygame.org/wiki/OBJFileLoader
- Obj and Mtl files.
obj file is generally created by blender or any 3d object creator program. (gaming softwares) Mtl is material for the Obj file. (must require or your object will be rendered as black)
- How to use this.
Make sure you calibrate your camera first from calibration directory. (main.py from calibration includes comments to understand) the generated .yaml file should be used in main.py
- Calibration
In Aruco_python calibration can be done two ways.
1.using chess board. 2.using aruco board.
I prefer using chess board (refer main method in calibaration/aruco.py)/ -> rename the yaml file to the same name as main directory yaml file (must).
for calibrating using aruco (refer calibration/main.py)
Once it says calibration done and data written in file. Copy the calibrated yaml file to the main directory and replace the older file (must).
now just run the main.py
->make sure you put all files in one directory.
- How to modify and use other 3d objects.
Requirements
You need to have following
- Brain (must require)
- python opengl (an introduction to opengl, and how it works. )
- blender (to modify and to create new objects as per your requirements.)
- unity 3d (optional)
- Aruco marker printed. (http://terpconnect.umd.edu/~jwelsh12/enes100/markergen.html)
visit https://free3d.com/3d-models/obj-file
Download any .obj file that you might require. Make sure you download obj file that have mtl file with it or only obj file will render black obj on your screen.
Bugs
- Light is little low on opengl window as compared to opencv window. (make sure you work in environment which have enough light)
Anything you find let me know. :)
- Licence
I do not own any of the obj files, please read the readme file model/zip/sinband directory.
Refernces