davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++

Home Page:http://dlib.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

any sample code of eye blink detection

fatalfeel opened this issue · comments

any sample code of eye blink detection
make sure it is a human
reference python
https://github.com/Practical-CV/EYE-BLINK-DETECTION-WITH-OPENCV-AND-DLIB

any c++ example?

//transfer from https://pyimagesearch.com/2017/04/24/eye-blink-detection-opencv-python-dlib/
static double eye_aspect_ratio(full_object_detection shape)
{
double distA_r = length(shape.part(37) - shape.part(41));
double distB_r = length(shape.part(38) - shape.part(40));
double distC_r = length(shape.part(36) - shape.part(39));
double distA_l = length(shape.part(43) - shape.part(47));
double distB_l = length(shape.part(44) - shape.part(46));
double distC_l = length(shape.part(42) - shape.part(45));

double ear_r    = (distA_r + distB_r) / (2.0 * distC_r);
double ear_l    = (distA_l + distB_l) / (2.0 * distC_l);
double ear_avg  = (ear_r + ear_l) / 2.0;

return ear_avg;

}

Warning: this issue has been inactive for 35 days and will be automatically closed on 2022-05-22 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Warning: this issue has been inactive for 42 days and will be automatically closed on 2022-05-22 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.