【问题标题】:Eye Blink Detection in flutter?颤动中的眨眼检测?
【发布时间】:2020-11-17 18:23:54
【问题描述】:

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

【问题讨论】:

    标签: android flutter flutter-dependencies


    【解决方案1】:

    对于颤振,我通过使用 Firebase ML 找到了眨眼检测的解决方案。 为此我不得不使用这个package

    它具有面部检测功能,包括“睁眼概率”。从而解决问题。详情请查看包装。

    FirebaseVision.instance.faceDetector().processImage
    

    您可以通过 git repo 查看包及其示例。

    如果有人遇到任何问题,请在此处发表评论。

    【讨论】:

    • 嗨!你能分享项目的代码吗?谢谢!
    【解决方案2】:

    您可以找到/训练张量流模型并将其转换为 .tflite 模型以及包含类列表的 .txt 文件。

    然后您可以使用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);
    }
    

    【讨论】:

    • 感谢您的回答。我会试试这个
    【解决方案3】:

    您可以使用 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 进行眼动追踪。

    【讨论】:

    • 感谢您的回答,如何将它与颤振集成?
    • 这个问题你还需要帮助吗?
    猜你喜欢
    • 2015-11-27
    • 2015-12-11
    • 2012-11-01
    • 1970-01-01
    • 2011-10-28
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    • 2020-07-29
    相关资源
    最近更新 更多