ARToolKit is a C and C language software library that lets programmers easily develop Augmented Reality applications. Augmented Reality (AR) is the overlay of virtual computer graphics images on the real world, and has many potential applications in industrial and academic research. A tutorial guide for developers to learn ways to create immersive worlds with Augmented Reality And Virtual Reality Tutorial at OurTechArt.com.
Download the ARToolkit package from www.hitl.washington.edu/artoolkit/download and unpack it. If you run Windows, copy this file into the unpacked folder ARToolKit bin or download the OpenGL GLUT files from the web and copy them to your folder. Now print the file ARToolKit patterns pattHiro.pdf and start the program simpleVRML.
ARToolKit for the PC is distributed as a single compressed file, ARToolKit2.32.win32.zip. Once you receive this file copy it into the directory where you want ARToolKit to be located and uncompress it using WinZip or a similar decompression utility.
20 Jan 2017
HoloLens is fascinating in terms of holographic display and in-room localization, but the capability of the front-facing camera (locatable camera) is not fully utilized for potential augmented reality applications.
ARToolKit
Since ARToolKit has served AR/VR for more than 10 years, and it is open-source, it would be nice to have it running on HoloLens. The obstacles towards this goal are quite clear as well:
Universal Windows has a whole different set of tools and run-time libraries. The dependencies of existing ARToolKit does not exist on UWP, such as pthreads, video libraries, opencv.
ARToolKit is written in native C/C++ code, and an additional wrapper is needed for development on Unity, which is recommended for HoloLens. (If you are not good at Direct3D, and Windows App)
Luckily, after spending some time on this, I successfully get some pieces of code written, and actually make ARToolKit runs on HoloLens.
The repository is called HoloLensARToolKit on Github.
Demos
The following videos and screenshots are taken with HoloLensARToolKit v0.1.
Samples of HoloLensARToolKit
There are three samples of HoloLensARToolKit, each representing a certain kind of marker that is supported: single marker, cube marker and multi marker.
Minion on the Cube
This video is taken on HoloLens Device Portal, also known as Mixed Reality Capture. You might have noticed that there is still some lag between the video that is captured and update in the rendering.
More Screenshots
Single Marker
Cube Marker
Multi Marker
Finally
You can access more articles describing the implementation details of HoloLensARToolKit in my blog, simply clicking on the tag: hololens-artoolkit.
With ARToolKit integrated with HoloLens, many more augmented reality applications are possible. If you are AR/VR developer, you must see what I mean here.
Thanks for reading.
Related Posts
Introduction We have seen before how to create a simple ARToolKit program. Now we want introduce an important feature of ARToolKit: the history function. Go to the bin directory and run the simpleTest2 program. You will see something similar to the screenshot in Figure 1.
You will notice no immediate difference with the simpleTest program. However, if you move the pattern close to the camera (as in Figure 2) and press 'c', a difference appears. In one case the cube seems very stable and in the other case it seems to jitter around slightly. In the former case we are using a history function, in the latter not.
Figure 2: A closer view reveals jittering when the history function is not used.
In this tutorial introduce how to use the history functions of ARToolKit.
Using the History Functions Open the simpleTest2.c program in examples/simple2. In the mainLoop function you will be find this new function call:
The arGetTransMatCont function uses information from the previous image frame to reduce the jittering of the marker. With arGetTransMat, only the information from the current image frame is used to compute the position of the marker. When using the history function, the result will be less accurate because the history information increases performance at the expense of accuracy.
ARToolKit provides another function based on history, but for the detection phase. We have already introduced this function, it is arDetectMarker. The corresponding function that does not use a history if arDetectMarkerLite. As before, using a history will reduce the accuracy, but offer more stability and is a little faster.
Replace the arDetectMarker call with this one:
Recompile simpleTest2 and position the marker so that it faces the camera (as in Figure 3). You will notice than the cube does more and more 'popping'.
Figure 3: A closer view reveals jittering when the history function is not used.
Artoolkit Tutorial
The popping effect is due to the lost information from the last frame, and the bad orientation of the marker is not sufficient for the detection step. Even if template matching was not done successfully, if there is a tracked marker with almost same size and same position in previous frame, the marker is regarded as a same marker of previous frame.