首页 > 解决方案 > 颤动中的眨眼检测?

问题描述

在颤振中找不到任何实现/打包任何与眨眼检测相关的东西,如果有人实现了,请分享。颤动中的眨眼检测有什么包装的想法吗?或者我必须在本地做?任何建议将不胜感激。谢谢

标签: androidflutterflutter-dependencies

解决方案


您可以使用 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

var 'ear' 给出了眼睛的纵横比。现在,您比较它是否低于阈值。

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

我确实认为这将是最简单和最有效的方法

有关更多信息,请访问本教程关于眼动追踪。


推荐阅读