Вы находитесь на странице: 1из 28

Kim, Sung-Ho

School of Computer, Information and Communication Engineering Sangji Univ.

Contents
Compile simpleVRML with OpenVRML How does ARToolkit work?

Tutorials
References

Compile simpleVRML with OpenVRML


OpenVRML simpleVRML Setting OpenGL Library Download libpng-1.2.8.exe Delete OpenVRML\dependencies\lib\libpng.lib Install libpng-1.2.8.exe Copy C:\Program Files\GnuWin32\lib\libpng.lib to OpenVRML\dependencies\lib

Download jpeg-6b-4.exe
Delete OpenVRML\dependencies\lib\libjpeg.lib Install jpeg-6b-4.exe Copy C:\Program Files\GnuWin32\lib\jpeg.lib to OpenVRML\dependencies\lib Rename it from jpeg.lib to libjpeg.lib Copy jpeg62.dll, and libpng13.dll, and zlib1.dll from C:\Program Files\GnuWin32\bin to {ARToolKit}\bin

Copy msvcp71d.dll & msvcr71d.dll to {ARToolKit}\bin

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () OpenVRML/src/openvrml-0.14.3/ide-projects/windows/VisualC7/OpenVRML OpenVRML.sln MS Visual Studio Compile antlr project (Debug mode) AST.hpp & Token.hpp Error : inline operator <(RefToken l, RefToken r); // {return true; } => int inline operator <(RefToken l, RefToken r); // {return true; } lookat project Pass Compile openvrml project If error : std::_Equal http://www.boost.org/ boost download, OpenGL Lib MS Visual Studio Include, lib img.cpp 40 JPEG #define XMD_H #ifdef FAR #undef FAR #endif Project Properties > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions (Debug mode & Release mode) OPENVRML_ENABLE_IMAGETEXTURE_NODE OPENVRML_ENABLE_GZIP

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () Compile openvrml-gl project & regex project Error : size_t regerror(errcode, preg, errbuf, errbuf_size) int errcode; => size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) Setting Project antlr, openvrml, openvrml-gl and regex Project > Properties > Configuration Properties > Librarian > General > Output File Release mode : $(OutDir)/*.lib, Debug mode : $(OutDir)/*d.lib Rebuild Resolution Release & Debug Debug & Release mode Rebuild Solution

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () Copy OpenVRML\antlr\Release\antlr.lib to OpenVRML\lib Copy OpenVRML\openvrml\Release\openvrml.lib to OpenVRML\lib Copy OpenVRML\openvrml-gl\Release\openvrml-gl.lib to OpenVRML\lib Copy OpenVRML\regex\Release\regex.lib to OpenVRML\lib Copy antlrd.lib, antlr.lib, openvrmld.lib, openvrml.lib, openvrml-gld.lib, openvrml-gl.lib, regexd.lib, regex.lib to {ARToolKit}\lib

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () {ARToolkit}/ARToolkit.sln MS Visual Studio libARvideo Project > Properties > Configuration Properties > Linker > Input >

Additional Dependencies (Debug mode)


DSVLd.lib => DSVL.lib simpleVRML Project > Properties > Configuration Properties > Linker > Input > Additional Dependencies (Debug mode) opengl32.lib glu32.lib glut32.lib libARvrmld.lib libARvideod.lib libARd.lib liARgsub_lited.lib openvrmld.lib openvrml-gld.lib antlrd.lib regexd.lib ws2_32.lib libjpeg.lib libpng.lib zlib.lib

simpleVRML Project > Properties > Configuration Properties > Debugging > Working
Directory /bin Rebuild Only simpleVRML

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () Project libARvrml Project > Properties > Configuration Properties > VC++ Directories > Include

Directories OpenVRML/include/openvrml
Project > Properties > Configuration Properties > VC++ Directories > Include Directories OpenVRML/dependencies/include Project > Properties > Configuration Properties > VC++ Directories > Library Directories OpenVRML/lib Project > Properties > Configuration Properties > VC++ Directories > Library Directories OpenVRML/dependencies/lib

Rebuild Only libARvrml (Debug mode & Release mode)


Project > Properties > Configuration Properties > Librarian > General > Output File Release mode : $(OutDir)/*.lib, Debug mode : $(OutDir)/*d.lib

Compile simpleVRML with OpenVRML


(Continued)
OpenVRML simpleVRML () Project simpleVRML Project > Properties > Configuration Properties > Linker > Input > Additional Dependencies (Debug mode)

openvrmld.lib openvrml-gld.lib antlrd.lib regexd.lib


Rebuild Only simpleVRML (Debug mode & Release mode) Project > Properties > Configuration Properties > Librarian > General > Output File Release mode : $(ProjectDir)../../bin/$(ProjectName).exe Debug mode : $(ProjectDir)../../bin/$(ProjectName)d.exe If error
Release mode

Project > Properties > Configuration Properties > Linker > Input > Additional Dependencies (Debug mode)

libc.lib libcd.lib libcmt.lib libcmtd.lib msvcrt.lib


Camera parameter Error simpleVRML Project > Properties > Configuration Properties > Debugging > Working Directory /bin

How does ARToolkit work?


Basic Principles of ARToolkit The camera captures video of the real world and sends it to the computer. Software on the computer searches through each video frame for any square shapes. If a square is found, the software uses some mathematics to calculate the position of the camera relative to the black square. Once the position of the camera is known a computer graphics model is drawn from that same position. This model is drawn on top of the video of the real world and so appears stuck on the square marker. The final output is shown back in the handheld display, so when the user looks through the display they see graphics overlaid on the real world

How does ARToolkit work? (Continued)


Basic Principles of ARToolkit (Continued)

How does ARToolkit work? (Continued)


Limitations of ARToolkit If users cover up part of the pattern with their hands or other objects the virtual object will disappear. There are also range issues : Tracking range for different sized patterns
Pattern Size(inches) Usable Range(inches)

2.75 3.50
4.25 7.37

16 25
34 50

This range is also affected somewhat by pattern complexity Tracking is also affected by the marker orientation relative to the camera The tracking results are also affected by lighting conditions

How does ARToolkit work? (Continued..)


Steps of ARToolkit static void mainLoop(void) { static int contF = 0; ARUint8 *dataPtr; ARMarkerInfo *marker_info; int marker_num; int j, k; /* grab a video frame */ if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) { arUtilSleep(2); return; } if( count == 0 ) arUtilTimerReset(); count++; argDrawMode2D(); ...

How does ARToolkit work? (Continued..)


Steps of ARToolkit (Continued) .....

/* grab a vide frame */ if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) { arUtilSleep(2); return; } if( count == 0 ) arUtilTimerReset(); count++;
argDrawMode2D(); argDispImage( dataPtr, 0,0 );

/* detect the markers in the video frame */ if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) { cleanup(); exit(0); } arVideoCapNext();
.....

How does ARToolkit work? (Continued..)


Steps of ARToolkit (Continued) .... if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) { cleanup(); exit(0); } arVideoCapNext(); /* check for object visibility */ k = -1; for( j = 0; j < marker_num; j++ ) { if( patt_id == marker_info[j].id ) { if( k == -1 ) k = j; else if( marker_info[k].cf < marker_info[j].cf ) k = j; } } if( k == -1 ) { ....

How does ARToolkit work? (Continued..)


Steps of ARToolkit (Continued)

.... /* check for object visibility */ .... /* get the transformation between the marker and the real camera */ arGetTransMat(&marker_info[k], patt_center, patt_width, patt_trans); draw(); argSwapBuffers(); }

How does ARToolkit work? (Continued..)


Steps of ARToolkit (Continued) static void draw( void ) { .... /* load the camera transformation matrix */ argConvGlpara(patt_trans, gl_para); glMatrixMode(GL_MODELVIEW); glLoadMatrixd( gl_para );

glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glLightfv(GL_LIGHT0, GL_AMBIENT, ambi); glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_flash); glMaterialfv(GL_FRONT, GL_SHININESS, mat_flash_shiny); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMatrixMode(GL_MODELVIEW); //glTranslatef( 0.0, 0.0, 25.0 ); glTranslatef( 0, 0, 25.0 ); glutSolidCube(50.0); glDisable( GL_LIGHTING );
glDisable( GL_DEPTH_TEST );

ARToolkit Tutorials
Tutorial 1 : Tracking Stability http://www.hitl.washington.edu/artoolkit/documentation/tutorialhistory.htm Tutorial 2 : Camera and Marker Relationships http://www.hitl.washington.edu/artoolkit/documentation/tutorialcamera.htm Tutorial 3 : Multi-Marker Tracking http://www.hitl.washington.edu/artoolkit/documentation/tutorialmulti.htm Tutorial 4 : simpleLite http://www.hitl.washington.edu/artoolkit/documentation/devstartup.htm Tutorial 5 : simpleTest2 http://www.hitl.washington.edu/artoolkit/documentation/tutorialhistory.htm Tutorial 6 : Recognized Multiple Patterns http://www.hitl.washington.edu/artoolkit/documentation/devmulti.htm Build Notes : ARToolkit & OpenVRML Build Notes for running ARTOOLKIT integrated with OpenVRML on windows platform with Visual Studio 2005 ARToolkit for Dummies http://isa.umh.es/vr2/euron06/doc/labs/ARToolkit_for_Dummies.pdf

Tutorial : Tracking Stability


http://www.hitl.washington.edu/artoolkit/documentation/tutorialhistory.htm ARToolkit/examples/simple2/ ARToolkit/bin/simpleTest2.exe

Tutorial : Camera & Marker Relationships


http://www.hitl.washington.edu/artoolkit/documentation/tutorialcamera.htm ARToolkit/examples/simple/ ARToolkit/examples/exview/

Tutorial : Multi-Marker Tracking


http://www.hitl.washington.edu/artoolkit/documentation/tutorialmulti.htm ARToolkit/examples/multi/ ARToolkit/bin/multiTest.exe

Tutorial : simpleLite
http://www.artoolworks.com/support/library/ARToolKit_tutorial_1:_First_simple_ ARToolKit_scene http://www.hitl.washington.edu/artoolkit/documentation/devstartup.htm ARToolkit/examples/simpleLite/

Tutorial : simpleTest2
http://www.hitl.washington.edu/artoolkit/documentation/tutorialhistory.htm ARToolkit/examples/simple2/ ARToolkit/bin/simpleTest2.exe

Tutorial : Recognized Multiple Patterns


http://www.hitl.washington.edu/artoolkit/documentation/devmulti.htm ARToolkit/examples/twoView/

Tutorial : Add Sound File


Add an include file #include <windows.h> Use PlaySound() function PlaySound(file.wav, NULL, SND_ASYNC); Another methods FMOD (http://www.fmod.org) Audiere (http://audiere.sourceforge.net/)

Tutorial : Add Texture Mapping


Texture Mapping Sample Image & Movie

References
http://www.hitl.washington.edu/artoolkit/documentation/ http://isa.umh.es/vr2/euron06/doc/labs/ARToolkit_for_Dummies.pdf http://www.hitl.washington.edu/artoolkit/Papers http://gekko.tistory.com/45 http://www.artoolworks.com/ARToolKit_Professional.html http://www.pragprog.com/titles/cfar/augmented-reality http://jpyun56.wordpress.com/2010/01/18/augmented-realityapplication%EB%93%A4/ http://www.se.rit.edu/~jrv/research/ar/ http://cafe.naver.com/opencv http://calmarea.net/?p=167 http://blog.naver.com/PostView.nhn?blogId=piccoro77&logNo=100064267687&vi ewDate=&currentPage=1&listtype=0&userTopListOpen=false&userTopListCount =5&userTopListManageOpen=false&userTopListCurrentPage=undefined http://shine10e.tistory.com/59 http://augmentedrealityindia.org/2011/10/09/artoolkit-n-openvrml/

Вам также может понравиться