颤动中的眨眼检测?

时间:2020-07-28 10:24:29

标签: android flutter flutter-dependencies

找不到任何实现/程序包,与任何与眨眼检测有关的信息都扑朔迷离,如果有人实现,请分享。 扑动中眨眼检测有什么包装创意吗?还是我必须用母语做?任何建议将不胜感激。 谢谢

3 个答案:

答案 0 :(得分: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

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

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

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

有关更多信息,请访问this tutorial进行眼动追踪。

答案 1 :(得分:0)

您可以找到/训练一个Tensor Flow模型,并将其与包含类列表的.txt文件一起转换为.tflite模型。

然后您可以使用tflite包来使用模型。

从图像流中获取结果。将其与camera 0.5.8+2插件一起使用。

await cameraController.startImageStream((CameraImage img) {
    var recognitions = await Tflite.runModelOnFrame(
    bytesList: img.planes.map((plane) {return plane.bytes;}).toList(),// required
    imageHeight: img.height,
    imageWidth: img.width,
    imageMean: 127.5,   // defaults to 127.5
    imageStd: 127.5,    // defaults to 127.5
    rotation: 90,       // defaults to 90, Android only
    numResults: 2,      // defaults to 5
    threshold: 0.1,     // defaults to 0.1
    asynch: true        // defaults to true
    );

print(recognitions);
}

答案 2 :(得分:0)

对于抖动,我找到了使用Firebase ML进行眨眼检测的解决方案。 为此,我不得不使用此package

它具有面部检测器功能,其中包括“睁眼概率”。从而解决问题。有关详细信息,请检查包装。

FirebaseVision.instance.faceDetector().processImage

您可以通过git repo检查软件包及其示例。

如果有人遇到任何问题,请在这里评论。