如何在扑动中进行人脸识别中的眨眼

how to do eye blinking inside face recognition in flutter

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

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

一旦您使用了视频源,

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 link.