图片人脸识别
import cv2
filepath = 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
2021-11-15 08:37:56
42KB
c
nc
op
1