0 安装环境
操作系统: win7 (64bit)
python :2.7.9.4 (32bit)
openCV: 2.4.13
1 安装openCV
下载地址http://opencv.org/ , 选择 https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.13/opencv-2.4.13.exe/download
解压后,得到,选择build\python\2.7\x86\cv2.pyd, 复制到python-2.7.9\Lib\site-packages\中即可。
关于C或者JAVA接口的安装,可参考build\doc\opencv_tutorials.pdf, 里面各种平台的详细安装步骤,以及结合IDE编译的说明。
Linux版本的下载地址https://github.com/Itseez/opencv/archive/2.4.13.zip
2 python 代码下载测试
下载地址 https://github.com/shantnu/FaceDetect/archive/master.zip; github 网址:https://github.com/shantnu/FaceDetect/
解压后
操作说明
Run the code like this: *python face_detect.py abba.png haarcascade_frontalface_default.xml* If you want to understand how the code works, the details are here: https://realpython.com/blog/python/face-recognition-with-python/ Update: Now supports OpenCV3. This change has been made by furetosan ( https://github.com/furetosan) and tested on Linux. To run the OpenCV3 version, run facedetect_cv3.py.
命令行