2020
10-28
10-28
Python用dilb提取照片上人脸的示例
上代码:#coding=utf-8importcv2importdlibpath="imagePath/9.jpg"img=cv2.imread(path)gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)#人脸分类器detector=dlib.get_frontal_face_detector()#获取人脸检测器predictor=dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")color=(0,255,0)#定义绘制颜色dets=detector(gray,1)forfaceindets:shape=predictor(img,face)#寻找人脸的68个...
继续阅读 >