This project is no longer maintained. Have a look at NAR Demo instead.
I’ve recently got interested in augmented reality and decided to write one up to learn how it works. Currently the system can track a reasonably feature rich planar object. Some technical features of the current system:
- Uses Nvidia CUDA to speed up feature extraction and matching
- Uses OpenCV 2.x
- Features using FAST corners (based on ideas from High speed feature matching by Simon Taylor and Ed Rosten)
- Feature used is very simple, only 64 bits in length, 8 bytes
- Robust Planar Pose algorithm (2006) by Gerald Schweighofer and Axel Pin, which I ported to C++ using OpenCV for matrix stuff
- Outlier filtering idea borrowed from Studierstube Natural Feature Tracker
- Capable of running >30 fps at 640×480 on a Nvidia Geforce GTS 360M in detection mode
- Some early support for loading Wavefront obj models exported from Blender
The program runs quite well on my laptop’s webcam but I’m unable to move the planar object quickly due to lots of motion blur in my dimly lit room. For this reason I have not yet implemented a feature tracker to speed/improve pose estimation. Nonetheless it runs quite good without it.
Last update 11 August 2011
Changes from last version
- Bug fixed in RPP.cpp, incorrect matrix indexing
- Renamed misleading ExtractNormalisedPatch() function to GetMeanSubtractedPatch()
- Linux (anything recent is fine, I used Ubuntu)
- CUDA supported NVIDA graphics card
- CodeBlocks IDE
- wxWidgets development libraries
- Nvidia CUDA libraries installed at /usr/local/cuda
- OpenCV 2.x or later (I used the SVN version)
- Webcam/camera supported by OpenCV
To compile, open up the project in CodeBlocks. To run, type in the project directory:
You have to run it from the project directory, because it relies on other directories relative to this.
If you want control over how the CUDA .cu files are compiled, right click on the file, Properties -> Advanced. By default it will compile for CUDA 1.2 capable devices.
The code is almost platform independent, only a Linux specific timing code is used. Meaning it should be possible to compile this on Windows with some patience.
I tried to make the interface as easy to use as possible. Instructions are displayed where needed, so hopefully using it will be obvious.
Importing Blender models
The Wavefront obj loader is still very alpha. I have not tested it on a variety of models, so don’t be surprise if things break! To use your own model export it as a Wavefront obj using the following options:
Make sure you manually select the model of interest beforehand, else it will export an empty file. The export options have to be selected EXACTLY as shown, at least for now. Blender will generate a .obj and .mtl file. I haven’t added a clean interface to load in 3D models (next on my TODO list). So for now just overwrite Tux.obj and Tux.mtl in the models directory for now. The original model of Tux is from http://objects.reprap.org/wiki/Tux.