使用opencv with python

时间:2018-05-15 05:50:03

标签: python opencv face-recognition

我能够使用python和opencv检测并识别面部。但不满意的准确性。我尝试使用20张图片进行第一次试用。然后是30,最后是500.但识别面部的准确性并不是那么令人满意。 我对某些面孔表现出错误的认可。我也尝试过使用置信度阈值。

        if id_ == 1 and confidence < 60:
            show_profile(1)

        elif id_ == 2 and confidence < 60:
            show_profile(2)

        elif id_ == 3 and confidence < 60:
            show_profile(3)

以下是显示识别图像的代码。 get_profile从数据库中获取信息。

def show_profile(profile_id):  # shows id related information on image
    cv2.putText(frame, 'Name: ' + get_profile(profile_id)[1], (x, y + h + 30),
                font, 0.5, (0, 200, 0), 1)
    cv2.putText(frame, 'Age: ' + str(get_profile(profile_id)[2]), (x, y + h + 50),
                font, 0.5, (0, 200, 0), 1)
    cv2.putText(frame, 'Gender: ' + str(get_profile(profile_id)[3]), (x, y + h + 70),
                font, 0.5, (0, 200, 0), 1)
    cv2.putText(frame, 'Designation: ' + str(get_profile(profile_id)[4]), (x, y + h + 90),
                font, 0.5, (0, 200, 0), 1)

1 个答案:

答案 0 :(得分:2)

您可能已达到opencv的限制。尝试使用更好的模型。基准测试的准确性可以在这里找到:https://www.sighthound.com/technology/face-recognition/benchmarks/pubfig200