Modules.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:apparent-age-gender-classification 作者: danielyou0230 项目源码 文件源码
def debug_face_classifier(file):
    face_cascade = cv2.CascadeClassifier(xml_face_classifier)
    image = cv2.imread(file)

    image = imutils.resize(image, width=500)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(image, 1.07, 3)
    print faces
    for (x, y, w, h) in faces:
        cv2.rectangle(image, (x, y), (x+w, y+h), (255, 0, 0), 2)
        #roi_gray = gray[y:y+h, x:x+w]
        #roi_color = image[y:y+h, x:x+w]

    cv2.imshow('Image', image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号