12.08.2013 Views

Development of an Augmented Reality system using ARToolKit

Development of an Augmented Reality system using ARToolKit

Development of an Augmented Reality system using ARToolKit

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Development</strong> <strong>of</strong> <strong>an</strong> <strong>Augmented</strong> <strong>Reality</strong> <strong>system</strong> <strong>using</strong> <strong>ARToolKit</strong> <strong>an</strong>d user invisible markers<br />

Figure 3.9 Application steps <strong>an</strong>d their corresponding <strong>ARToolKit</strong> functions<br />

Steps 2 through 5 have been discussed earlier, <strong>an</strong>d are repeated continously, while steps<br />

1 <strong>an</strong>d 6 are only performed on initialization <strong>an</strong>d shutdown <strong>of</strong> the application. The<br />

application may also need to respond to occuring events. A program consists <strong>of</strong> a main<br />

routine that carries out the actions in step 1, by <strong>using</strong> the init function. Within the main<br />

routine the argMainLoop function is responsable for calling the functions that<br />

correspond to the application steps 2 through 5. Closing the application will make the<br />

cle<strong>an</strong>up function stop the video processing <strong>an</strong>d close down the video path.<br />

A video image is captured <strong>an</strong>d displayed on the screen, either a warped image corrected<br />

for camera distortions or <strong>an</strong> unwarped image. arDetectMarker is used to search the<br />

image for markers, which already have been read in by the init function. The function<br />

delivers the number <strong>of</strong> found markers, <strong>an</strong>d information concerning markers in the<br />

marker_info structure. This contains the coordinate information <strong>an</strong>d recognition<br />

confidence values <strong>an</strong>d object id numbers for each <strong>of</strong> the markers. For finding the<br />

tr<strong>an</strong>sformation between the markers <strong>an</strong>d the camera arGetTr<strong>an</strong>sMat function is used.<br />

Finally, virtual objects are drawn by the draw function, based upon the association <strong>of</strong><br />

virtual objects <strong>an</strong>d marker patterns read in by init.<br />

3.5 Training marker patterns<br />

To allow <strong>ARToolKit</strong> to carry out its main functionality <strong>of</strong> overlaying virtual objects on<br />

fiducial markers, it needs to be taught the different marker patterns to recognize. These<br />

are specified in a text file, by stating the name <strong>of</strong> the marker, its corresponding pattern<br />

<strong>an</strong>d its width. Patterns to be recognized c<strong>an</strong> be created by <strong>an</strong> <strong>ARToolKit</strong> subprogram<br />

that makes template files. For doing so one first needs to print out <strong>an</strong> empty pattern file,<br />

just containing a black square with a white square in the middle. Then a pattern needs to<br />

be attached to the white square, either a black <strong>an</strong>d white or color one. The pattern<br />

recognition program is used to capture this pattern, preferably under similar lighting<br />

conditions as when the AR application will be running. When the pattern is found this is<br />

indicated by <strong>an</strong> appearing red <strong>an</strong>d green square around it. The camera should be rotated<br />

until the red corner <strong>of</strong> the highlighted square is in the top left h<strong>an</strong>d corner. Figure 3.10<br />

shows <strong>an</strong> identified marker pattern. Then the pattern is stored in a bitmap file <strong>an</strong>d c<strong>an</strong> be<br />

used in AR applications.<br />

Figure 3.10 Training marker patterns<br />

35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!