使用opencv进行人脸识别的可信度

时间:2016-06-21 10:19:58

标签: python opencv

我尝试使用eugene face识别面部和使用OpenCV Python进行局部二值模式直方图算法。使用eugene人脸识别获得的置信度为2000,3000等。如果图像被正确识别,那么置信度应该是多少?

for image_path in image_paths:
 predict_image_pil = Image.open(image_path).convert('L')
 predict_image = np.array(predict_image_pil, 'uint8')
 faces = faceCascade.detectMultiScale(predict_image)
 for (x, y, w, h) in faces:
    nbr_predicted, conf = recognizer.predict(predict_image[y: y + h, x: x + w])
    nbr_actual = int(os.path.split(image_path)[1].split(".")[0].replace("subject", ""))
    if nbr_actual == nbr_predicted:
        print "{} is Correctly Recognized with confidence {}".format(nbr_actual, conf)
    else:
        print "{} is Incorrect Recognized as {}".format(nbr_actual,         nbr_predicted)
    cv2.imshow("Recognizing Face", predict_image[y: y + h, x: x + w])

0 个答案:

没有答案