This my latest and greatest markerless/natural feature augmented reality demo. This new code is called NAR Demo, short for Nghia’s Augmented Reality Demo, for a lack of a better name So what’s the difference between NAR Demo and MarkerlessARDemo? A bucket load, just to name a few:
- No CUDA specific code, anyone can run it now (woohoo!)
- Irrlicht Engine for cross platform GUI, the power of a full featured game engine!
- Multi-threaded design for real-time processing
- Replaced FAST feature with more robust Difference of Gaussian blob features
- Experimental optical flow code, this improves stability a lot (less jittering)
- Bug fixes from MarkerlessARDemo
- LOTS of code cleaning
NAR Demo is meant to serve as an educational tool, there are no plans to make it anything beyond that.
I’ve made a PDF document that focuses on the computer vision aspect of NAR. It’s general and not code specific and might be useful if are writing your own AR system. Download NAR_Demo.pdf, also found in the doc directory of the 7z package.
Last update 05/02/2012
- Minor bug fixes in DOG.cpp
- Added computer vision documentation in doc (work in progress)
NAR_Demo-0.2.1.7z (7.2MB) Use 7zip to decompress. This file includes both a Linux (CodeBlocks) and Visual Studio 2010 project. I’ve only tested it on a 64bit machine. There is a pre-compiled Windows 64bit binary in the root folder if you want to test it out without compiling. But first please read the usage section down below. IMPORTANT: The OpenCV Windows dlls I provided have been compiled on an Intel i7. If you have a CPU that doesn’t support SSE3 instructions it might crash. In which case, you will have to compile your own version of OpenCV.
The code is also available on GitHub
To compile you need the following libraries installed
If you are using the Visual Studio project you will have to edit the project and point it to the directories of the libraries mentioned above.
32 bit systems: If you are compiling for a 32 bit system you need to edit NAR/NAR_Config.h and comment out #define USE_SSE4. The POPCNT assembly instruction seems to work only with 64 bit compilers.
The executable NAR_Demo or NAR_Demo.exe can be found in the root directory. It accepts no arguments, but first you have to provide it an image of the object you want to detect at the following path:
There is no default AR_object.png provided, NAR_Demo WILL NOT run without this file.
I recommend finding some software that can view your webcam/camera, hold the object in front, take a screenshot, and crop as required. The image should be no bigger than your video resolution. The object MUST be planar/flat for it work correctly.
Once NAR_Demo is running, just hold up your object for detection.
You might notice it’s very slow (< 4 FPS) when the object is not detected. This is due to OpenCV’s cv::findHomography function, which lacks an option to specify the maximum number of RANSAC iterations, it’s hard coded to 2000. I’ve submitted a suggestion to OpenCV’s bug track system, here’s hoping they read it.
Simplified BSD. See LICENSE.txt in the root directory.