【发布时间】:2020-07-29 20:14:02
【问题描述】:
我正在尝试制作一个在面部识别中包含眨眼的应用程序,但我很难找到有关眨眼的资源。有没有我可以阅读的包或资源?
【问题讨论】:
标签: flutter face-recognition blink
我正在尝试制作一个在面部识别中包含眨眼的应用程序,但我很难找到有关眨眼的资源。有没有我可以阅读的包或资源?
【问题讨论】:
标签: flutter face-recognition blink
您可以在 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链接。
【讨论】: