Blink threshold is hardcoded
Currently the blink threshold is hardcoded inside the engine.Engine class, ideally this should be a param passed in so an external user can adjust it. Alternatively, a method could be written to take in an expected number of blinks, and adjust the blink threshold to match the expected number (so you could run through a small sample of video on the same subject to attain the threshold, then set that threshold to process the rest of the dataset)
I think adjusting the threshold to a small video sample could work. Often, contrasts, facial appearance etc. have an effect on how blinks affect the (mono)chromatic distribution. In mice, blinking causes a less pronounced shift in mean/std than in human (based on my trials). Both are very distinct, however.
As you suggest, we should make the param user adjustable too.
Yeah, I'll have a tinker. Supplying the parameters would be an easy first step, but writing some sort of interactive tuning model would be a bit trickier, as the user would have to supply information about an expected number of blinks, and time stamps.
Thinking a bit more, a simpler input could be to have a separate blink video to test against, supplied by the user, which then generates an updated parameter file that could be used against further application runs.