最近的任务是完成通道被动式人脸识别:
首先是人脸检测
import cv2 cap = cv2.VideoCapture("WeChat.mp4") face_haar = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") while 1: ret, frame = cap.read() foundFaces = face_haar.detectMultiScale(frame, scaleFactor=1.3, minNeighbors=9, minSize=(50, 50), flags=5) for (x, y, w, h) in foundFaces: cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2) cv2.imshow(" t image", frame) cv2.waitKey(1) cap.release() cv2.destroyAllWindows()
参考:
http://www.cnblogs.com/neo-T/p/6432596.html
http://blog.csdn.net/baidu_36933868/article/details/70521317 通过anaconda安装TensorFlow