android - 颤动中的眨眼检测?
问题描述
在颤振中找不到任何实现/打包任何与眨眼检测相关的东西,如果有人实现了,请分享。颤动中的眨眼检测有什么包装的想法吗?或者我必须在本地做?任何建议将不胜感激。谢谢
解决方案
您可以使用 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.
我确实认为这将是最简单和最有效的方法
有关更多信息,请访问本教程关于眼动追踪。
推荐阅读
- list - 如何使用Scala中的函数式编程从Map(String,List(String))列表中提取不可变
- python - pandas:将具有相同值的连续行分组为一组
- java - 如何防止 CSVPrinter 再次重写数据
- amazon-product-api - 在 AWS 上拒绝访问请求的资源
- css - 为什么我的 CSS 动画过渡不起作用
- php - 数组中的 Laravel 验证值 - livewire
- r - 箭头显示 R ggplot2 图中每个第 n 个数据点的路径方向
- javascript - 打印日期无效
- spring - 正文为空时的 WebFlux 服务器记录请求和响应
- math - 如何检查一个圆是否在多边形的“外部”?