Writing an application with ARToolKit is very easy: a simple outline is used for creating an AR application. We base on it for writing a new application. Similarly, training pattern phase is largely simplified with the use of simple tool.
The following steps must be taken in your application main code:
|Initialization||1. Initialize the video capture and read in the marker pattern files and camera parameters.|
|Main Loop||2. Grab a video input frame.|
|3. Detect the markers and recognized patterns in the video input frame.|
|4. Calculate the camera transformation relative to the detected patterns.|
|5. Draw the virtual objects on the detected patterns.|
|Shutdown||6. Close the video capture down.|
Steps 2 through 5 are repeated continuously until the application quits, while steps 1 and 6 are just performed on initialization and shutdown of the application respectively. In addition to these steps the application may need to respond to mouse, keyboard or other application specific events.