【问题标题】:how to do eye blinking inside face recognition in flutter如何在颤动的人脸识别中眨眼
【发布时间】:2020-07-29 20:14:02
【问题描述】:

我正在尝试制作一个在面部识别中包含眨眼的应用程序,但我很难找到有关眨眼的资源。有没有我可以阅读的包或资源?

【问题讨论】:

    标签: flutter face-recognition blink


    【解决方案1】:

    您可以在 Python 中使用 opencv 以及其他一些库来检测眨眼。

    一旦你消费了视频源,

    EYE_AR_THRESH = 0.3   
    
    for rect in rects:
        # determine the facial landmarks for the face region, then
        # convert the facial landmark (x, y)-coordinates to a NumPy
        # array
        shape = predictor(gray, rect)
        shape = face_utils.shape_to_np(shape)
        # extract the left and right eye coordinates, then use the
        # coordinates to compute the eye aspect ratio for both eyes
        leftEye = shape[lStart:lEnd]
        rightEye = shape[rStart:rEnd]
        # EAR = eye aspect ratio
        leftEAR = eye_aspect_ratio(leftEye)                     # important line
        rightEAR = eye_aspect_ratio(rightEye)                   # important line
        # average the eye aspect ratio together for both eyes
        ear = (leftEAR + rightEAR) / 2.0
    

    变量“ear”给出了眼睛的纵横比。现在,您比较它是否低于阈值。例如

    if ear < EYE_AR_THRESH:
        # eye is blinked. continue with your business logic.
    

    更多详情请参考this链接。

    【讨论】:

    • 我正在尝试相同的方法但无法获得它?谁能帮助我了解如何将其转换为颤振?
    猜你喜欢
    • 2020-11-17
    • 2011-12-11
    • 1970-01-01
    • 2020-06-21
    • 2012-07-18
    • 2011-12-14
    • 1970-01-01
    • 2017-02-05
    • 2010-12-04
    相关资源
    最近更新 更多