Can't find any implementation/package anything related blink detection in flutter, if anyone implemented please share. Eye blink detection in flutter any package idea? or I have to do it in native? any suggestion will be appreciated. Thanks
You can use Python's OpenCV package along many others to detect eye movements/blinking and then integrate it with flutter
Once you consume the video feed,
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
The var 'ear' gives eye aspect ratio. Now, you compare if it is below the threshold.
if ear < EYE_AR_THRESH:
# eye is blinked. continue with your business logic.
I do think this would be the easiest and most effective method
For more info please visit this tutorial on eye-tracking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With