2020
11-19
11-19
python实现图像,视频人脸识别(opencv版)
图片人脸识别importcv2filepath="img/xingye-1.png"img=cv2.imread(filepath)#读取图片gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)#转换灰色#OpenCV人脸识别分类器classifier=cv2.CascadeClassifier("C:\Python36\Lib\site-packages\opencv-master\data\haarcascades\haarcascade_frontalface_default.xml")color=(0,255,0)#定义绘制颜色#调用识别人脸faceRects=classifier.detectMultiScale(gray,sc...
继续阅读 >