All Projects → fdcl-gwu → Aruco Markers

fdcl-gwu / Aruco Markers

Licence: bsd-3-clause
Working examples/tutorial for detection and pose estimation of ArUco markers with C++

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Aruco Markers

Air drums
This project enables you to play virtual drums simply by using concepts of image processing and computer vision.
Stars: ✭ 31 (-72.32%)
Mutual labels:  tutorial, opencv, augmented-reality, ar
Haxejs
Documentation about using JavaScript with Haxe
Stars: ✭ 25 (-77.68%)
Mutual labels:  tutorial, examples
Arshooter
A demo Augmented Reality shooter made with ARKit in Swift (iOS 11)
Stars: ✭ 794 (+608.93%)
Mutual labels:  tutorial, augmented-reality
Opencv Tutorials
Tutorials for learning OpenCV in Python from Scratch
Stars: ✭ 36 (-67.86%)
Mutual labels:  tutorial, opencv
Rxjava2 Android Samples
RxJava 2 Android Examples - Migration From RxJava 1 to RxJava 2 - How to use RxJava 2 in Android
Stars: ✭ 4,950 (+4319.64%)
Mutual labels:  tutorial, examples
Ethereum Development With Go Book
📖 A little book on Ethereum Development with Go (golang)
Stars: ✭ 754 (+573.21%)
Mutual labels:  tutorial, examples
Illixr
ILLIXR: Illinois Extended Reality Testbed
Stars: ✭ 33 (-70.54%)
Mutual labels:  augmented-reality, ar
Realityui
A Swift Package for creating familiar UI Elements and animations in a RealityKit rendered Augmented Reality or Virtual Reality scene.
Stars: ✭ 275 (+145.54%)
Mutual labels:  augmented-reality, ar
Awesome Webar
📱 A curated list of awesome WebAR projects, resources, tools and more.
Stars: ✭ 39 (-65.18%)
Mutual labels:  augmented-reality, ar
Build Deep Learning Env With Tensorflow Python Opencv
Tutorial on how to build your own research envirorment for Deep Learning with OpenCV, Python, Tensorfow
Stars: ✭ 66 (-41.07%)
Mutual labels:  tutorial, opencv
Articulate Common Lisp.github.io
docs/specs for a tutorial site for a Common Lisp environment
Stars: ✭ 90 (-19.64%)
Mutual labels:  tutorial, examples
Learning Rust
Rust 学习之路 > Rust Programming Tutorial, include articles, interview, example, problems.
Stars: ✭ 376 (+235.71%)
Mutual labels:  tutorial, examples
Face Landmark Android
Android AR Camera
Stars: ✭ 320 (+185.71%)
Mutual labels:  opencv, augmented-reality
Stealing Ur Feelings
Winner of Mozilla's $50,000 prize for art and advocacy exploring AI
Stars: ✭ 784 (+600%)
Mutual labels:  augmented-reality, ar
Jeelizar
JavaScript object detection lightweight library for augmented reality (WebXR demos included). It uses convolutional neural networks running on the GPU with WebGL.
Stars: ✭ 296 (+164.29%)
Mutual labels:  augmented-reality, ar
Jni By Examples
🎇Fun Java JNI By Examples - with CMake and C++ (or C, of course!) ‼️ Accepting PRs
Stars: ✭ 99 (-11.61%)
Mutual labels:  tutorial, examples
Vaporschool
Learn how to build vapor applications from rookie to champion in a constructive way!
Stars: ✭ 259 (+131.25%)
Mutual labels:  tutorial, examples
Opencv Python Series
An OpenCV & Python Tutorial Series and Reference.
Stars: ✭ 262 (+133.93%)
Mutual labels:  tutorial, opencv
Face Mask Detection
Face masks are crucial in minimizing the propagation of Covid-19, and are highly recommended or even obligatory in many situations. In this project, we develop a pipeline to detect unmasked faces in images. This can, for example, be used to alert people that do not wear a mask when entering a building.
Stars: ✭ 37 (-66.96%)
Mutual labels:  tutorial, opencv
Ar Alphabets
Augmented Reality on Web (Web AR) for Kids to learn Alphabets with fun. AR on all Mobile Devices
Stars: ✭ 98 (-12.5%)
Mutual labels:  augmented-reality, ar

ArUco Markers

This repository includes codes that can be used to work with the augmented reality library, ArUco. A few programs in the repository, including the codes to create the markers and to calibrate the cameras, are copies of the examples included with the OpenCV libraries with minor changes, which are added so that everything is in one place.

Contents

  1. Installing OpenCV
    1. Installing v3.4.2 (recommended)
    2. Installing the Latest
  2. Generating Markers
  3. Detecting the Markers
  4. Camera Calibration
  5. Pose Estimation
  6. Draw a Cube

Installing OpenCV

You can install the standalone ArUco library by downloading the source files which can be found in the above website and building and installing them. But it is highly recommended to install ArUco library packed in OpenCV library. The instruction below are for installing OpenCV with ArUco library.

You can install OpenCV using the master branch of their repository, OR using the submodules added to this repository. Building and installing OpenCV with the provided submodules guarantees that the other codes on this repository works without issues. So it is recommended to install from the submodules.

Installing v3.4.2 (recommended)

sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

git submodule update --init
cd libraries/opencv
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j4  # if you have more/less cores on your computer, substitute 4 with the number of cores
          # use command "nproc" to find the number of cores
sudo make install

Installing the Latest

sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git

# If you need a specific version, you should checkout to that version on 
# both the repositories before executing the below commands.

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j4  # if you have more/less cores on your computer, substitute 4 with the number of cores
          # use command "nproc" to find the number of cores
sudo make install

Generating Markers

To detect the markers using a camera, first you need to print the markers. The ArUco library comes with few functions to generate the markers, and they are copied to this repository for the ease of finding them.

cd create_markers
mkdir build && cd build
cmake ../
make

# Create a single marker.
# For details about the parameters, run just ./generate_marker
./generate_marker --b=1 -d=16 --id=108 --ms=400 --si marker.jpg

# Create a marker board.
# For details about the parameters, run just ./generate_board
./generate_board --bb=1 -h=2 -w=4 -l=200 -s=100 -d=16 --si board.jpg

The generated marker should look like this:

The generated board should look like this:

Detecting the Markers

First, print the generated markers. Connect a camera to the computer and run below commands:

cd detect_markers
mkdir build && cd build
cmake ../
make

./detect_markers

All the detected markers would be drawn on the image.

 

Camera Calibration

To accurately detect markers or to get accurate pose data, a camera calibration needs to be performed.

Run below commands to perform the camera calibration:

cd camera_calibration
mkdir build && cd build
cmake ../
make

# Below command is accurate only if you used the same parameters when you generated the markers.
# If you changed any of them, change below arguments accordingly.
./camera_calibration -d=16 -dp=../detector_params.yml -h=2 -w=4 -l=<side length of a single marker (in meters)> -s=<separation between two consecutive markers in the grid (in meters)> ../../calibration_params.yml

Then points the camera at the marker at different orientations and at different angles, and save those images by pressing key C. These instructions should appear on the screen. Around 30 images should be good enough.

Pose Estimation

To estimate the translation and the rotation of the ArUco marker, run below code:

cd pose_estimation

mkdir build && cd build
cmake ../
make

./pose_estimation -l=<side length of a single marker (in meters)>

# or, if you are trying this on an already saved video
./pose_estimation -l=<side length of a single marker (in meters)> -v=<path to the video>

Below image shows the output of this code. The distances shown in the left top corner are in meters with axes as same as those defined in OpenCV model, i.e., x-axis increases from left to right of the image, y-axis increases from top to bottom of the image, and the z-axis points outwards the camera, with the origin on the top left corner of the image. The axes drawn on the markers represent the orientation of the marker with the Red-Green-Blue axes order.

 

Draw a Cube

To estimate pose and draw a cube over the ArUco marker, run below code:

cd draw_cube

mkdir build && cd build
cmake ../
make

./draw_cube -l=<side length of a single marker (in meters)>

# or, if you are trying this on an already saved video
./draw_cube -l=<side length of a single marker (in meters)> -v=<path to the video>

Below GIF shows the output of this code.

 
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].