# tar -zxvf jpegsrc.v6b.tar.gz # cd jpeg-6b # ./configure --help //能查看他的设置选项 # export CC="arm-linux-gcc" # ./configure --prefix=/usr/local/arm/2.95.3/arm-linux/ --enable-shared --enable-static 然后我们需要修改一下makefile文件,因为我的系统的libtool似乎和这个版本配合的不是非常好。下边这些地方是需要注意的,:-),尤其是libtool,如果你的也工作不好的话。 # Where to install the programs and man pages. prefix = /usr/local/arm/2.95.3/arm-linux # The name of your C compiler: CC= arm-linux-gcc # If using GNU libtool, LIBTOOL references it; if not, LIBTOOL is empty. LIBTOOL = # $(O) expands to "lo" if using libtool, plain "o" if not. # Similarly, $(A) expands to "la" or "a". O = o A = a # library (.a) file creation command AR= arm-linux-ar rc # second step in .a creation (use "touch" if not needed) AR2= arm-linux-ranlib # make 安装前需要在 arm-linux 下建个目录,不然安装会出错 # mkdir ?p /usr/local/arm/2.95.3/arm-linux/man/man1 # make install // OK 了 相同,自己去检查一下安装是否成功,:-),库文件终于告一段落了。下边到我们的主角了,vgrabbj。
4.交叉编译vgrabbj # tar -zxvf vgrabbj-0.9.6.tar.gz # cd vgrabbj-0.9.6 # ./configure --help #export CC="arm-linux-gcc" #mkdir myvgr #./configure --host=arm-linux --prefix=./myvgr --disable-ftp --disable-timestamp 去掉不必的选项吧,多了不一定能的,:-)。 修改makefile #vim Makefile CFLAGS = -g -O2 -Wall -I/home/linux-2.4/include 添加斜体部分,:-)。 [root@localhost vgrabbj-0.9.6]# make [root@localhost vgrabbj-0.9.6]# make install 好了,这样你就在myvgr中有了一个vgrabbj可执行文件,把他下到研发板上就能采集图像了。
5.vgrabbj的使用 vgrabbj需要两个动态库文件,所以首先拷贝到研发板上,:-)。如下: [root@(none) lib]$cp -a libpng.so.2 /lib [root@(none) lib]$cp -a libpng.so.2.1.0.10rc1 /lib [root@(none) lib]$cd myvgr [root@(none) myvgr]$ls bin etc lib man [root@(none) myvgr]$cd bin [root@(none) bin]$ls vgrabbj [root@(none) bin]$./vgrabbj --help Usage: vgrabbj [options] -h This screen -c parse as config file -l Daemonize & sleep (min. 1!) between images -L Daemonize & sleep between images -a Switch vgrabbj’s auto brightness adjustment (default: off) You might need to set -F 4, too, if it doesn’t work -q Quality setting (0-100, default: 75), JPEG only -i Sets the imagesize of input device to sqcif=128x96,qsif=160x120,qcif=176x144, sif="320x240", cif="352x288", vga="640x480", svga="800x600", xga="1024x768", sxga="1280x1024", or uxga="1600x1200" (default:352x288) -o Output format (default:jpg) -f Write to (default: /dev/stdout) -d Read from as input (default: /dev/video)
Example: vgrabbj -l 5 -f /usr/local/image.jpg Would write a single jpeg-image to image.jpg approx. every five seconds
[root@(none) bin]$./vgrabbj -f ./1.jpg -d /dev/v4l/video0 Could not open configfile ./myvgr/etc/vgrabbj.conf, ignoring Reading image from /dev/v4l/video0 [root@(none) bin]$./vgrabbj -f ./2.jpg -d /dev/v4l/video0 Could not open configfile ./myvgr/etc/vgrabbj.conf, ignoring Reading image from /dev/v4l/video0 你把1.jpg,2.jpg拷到宿主机上,就能看到自己的劳动成果了,:-)。
文章评论(0条评论)
登录后参与讨论