1. 安装 1) 安装支持软件包: sudo apt-get install pythonpython-opencv python-scipy python-numpy python-setuptools python-pip 2) 用pip(Python Package Index)工具安装SimpleCV库: sudo pip install(链接) 下载ingenuitas-SimpleCV-1.3-65-g47497f3.zip,然后用pip install ingenuitas-SimpleCV-1.3-65-g47497f3.zip安装 3) 安装其它支持软件 sudo apt-get installpython-pygame sudo apt-get installpython-imaging 2. 测试 1) 编写face测试脚本,代码如下,并命名为faces.py from SimpleCV import Image myImage = Image("test.jpg") faces = myImage.findHaarFeatures('face') if faces: for face infaces: print"Face at:"+str(face.coordinates()) face.draw() else: print"No faces detected." myImage.save("test0.jpg")
|