ARToolKit安装指南—第一个程序

来源:互联网 发布:arduino蓝牙发送数据 编辑:程序博客网 时间:2024/05/29 03:43

主机系统是ubuntu14.04 64位

安装前的准备:

需满足的软件包 安装指导
1.OpenGL and GLUT
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libglut-dev / sudo apt-get install freeglut3-dev

确定OpenGL和GLUT运行期包都安装好了。一般来说,是在/usr/X11R6/lib,/usr/lib或 /usr/local/lib内查找是否存在opengl.so,glu.so和glut.so。
确定OpenGL和GLUT SDKs都被安装好了。一般来说,是在/usr/X11R6/include,/usr/include或/usr/local/include内查找是否存在opengl.h,glu.h,和glut.h。

2.Video Library 确定视频库已经安装好了:
v4l2 配置:sudo apt-get install libv4l-dev
安装gstreamer:
sudo apt-get install libgstreamer0.10-dev gstreamer-tools gstreamer0.10-tools gstreamer0.10-doc
sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse

在Linux下,确保V4L RunTime 和 SDK 都安装好,或者确保 dv1394,dv1394 RunTime 和 SDK都安装好了。
在SGI下,只在SGI O2 models下测试过ARToolKit,不过按理来说,对于采用类似的视频输入设备的其他SGI机型,也应该能正常工作。
编译ARToolKit:

4.打开控制台,准备开始编译ARToolKit。
输入:tar zxvf ARToolKit-2.71.tgz
把ARToolKit-2.71.tgz解压到任意目录。
配置并编译:cd {ARToolKit}
./Configure里选择5即GStreamer即5 y y
make
会出现错误
ioctl ioctl !!!
修改example simpletest.c为

char            *vconf = "Data\\WDM_camera_flipV.xml";#elsechar            *vconf = "v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24,width=640,height=480 ! identity name=artoolkit sync=true ! fakesink";1.v4l2src device=/dev/video0 use-fixed-fps=falseUsing Video4Linux2, set the device to /dev/video0, etc. There are probably more options, who knows what they are.2.ffmpegcolorspaceconverts the color space of the video stream, e.g. from YUV to RGB3.capsfilter caps=video/xrawrgb,bpp=24,width=640,height=480set the capture parameters; 24 bit, 320x240, and some other stuff.4.identity name=artoolkitI guess you use this to refer to the stream later?5.fakesinka 'sink' is something that does something with the data stream, such as displaying it, writing to disk, network, etc. fakesink is just a generic terminator to hold the data so ARToolkit can manipulate it. I think. 修改Configure文件:LIBS="-lpthread -lglut -lGLU -lGL -lXi -lX11 -lm $GST_LIBS"可选在include/AR/sys/videoLinuxV4L.hlib/SRC/VideoLinuxV4L/video.c中修改“linux/videodev.h” 头文件名to “libv4l1-videodev.h”修改之后make:又出现ARVideo may be configured using one or more of the following options,separated by a space:这是要先进行make clean 后再进行make才可以。

5.运行./bin/simpleTest
可能出现camera parameter load error!!!
这要在simple.c文件中调用的文件路径要全路径,Data/不好使。

然后再次编译,运行后出现:

Usingsupplied video config string [v4l2src device=/dev/video0use-fixed-fps=false ! ffmpegcolorspace ! capsfiltercaps=video/x-raw-rgb,bpp=24,width=640,height=480 ! identityname=artoolkit ! fakesink].libARvideo:GStreamer 0.10.36libARvideo:GStreamer pipeline is PAUSED!libARvideo:GStreamer negotiated 640x480libARvideo:GStreamer pipeline is PLAYING!libARvideo:GStreamer pipeline is PAUSED!Imagesize (x,y) = (640,480)***Camera Parameter ***--------------------------------------SIZE= 640, 480Distortionfactor = 159.250000 131.750000 104.800000 1.012757350.475740.00000 158.25000 0.000000.00000363.04709 120.75000 0.000000.000000.00000 1.00000 0.00000--------------------------------------libARvideo:GStreamer pipeline is PLAYING!]

6.把一个黑色四变形打印出来,在摄像头前就可以出现在黑色四边形上就有一个蓝色的立方体出现。

0 0