在我们开始之前,需要准备一个USB接口的摄像头,一般的网络摄像头都可以。我们还需要应用内核补丁和USB摄像头驱动程序。这个补丁可以在这里下载:https://s3./pcduino/Images/Ubuntu+Updates/uImage_20130316.tar.gz 1.请下载这个补丁在pcDuino终端,解压它使用以下命令:
- tar -zxvf uImage_20130316.tar.gz
复制代码 2.升级内核
- sudo mount /dev/nanda /boot
- sudo cp uImage /boot/ -f
复制代码 3.安装guvcview,然后重启
- sudo apt-get install guvcview
- sudo reboot
复制代码 除了上述的方法,其实你还可以直接升级最新的ubuntu系统。。。到这里下载:http://www./?page_id=14 系统自带了这个USB的驱动。。。这时候你只需要执行上的第3步就OK了 4.重启后接着在命令行输入
就可以看到图像了。。。。 5.再来安装simpleCV
- sudo apt-get install ipython python-opencv python-scipy python-numpy python-setuptools python-pip
- sudo pip install https://github.com/ingenuitas/SimpleCV/zipball/master
- sudo apt-get install python-pygame
- sudo apt-get install python-imaging
复制代码 6.安装完成后,输入simplecv,可以直接进入shell编程
- ubuntu@ubuntu:~$ simplecv
- +-----------------------------------------------------------+
- SimpleCV 1.3.0 [interactive shell] - http://
- +-----------------------------------------------------------+
- Commands:
- "exit()" or press "Ctrl+ D" to exit the shell
- "clear" to clear the shell screen
- "tutorial" to begin the SimpleCV interactive tutorial
- "example" gives a list of examples you can run
- "forums" will launch a web browser for the help forums
- "walkthrough" will launch a web browser with a walkthrough
- Usage:
- dot complete works to show library
- for example: Image().save("/tmp/test.jpg") will dot complete
- just by touching TAB after typing Image().
- Documentation:
- help(Image), ?Image, Image?, or Image()? all do the same
- "docs" will launch webbrowser showing documentation
- SimpleCV:1> cam=Camera()
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- VIDIOC_QUERYMENU: Invalid argument
- SimpleCV:2> img=cam.getImage()
- SimpleCV:3> img.show()
- SimpleCV:5:
复制代码 最后的效果图:
|