Finally, a useful blink tag! Detecting your user blinking
Inspired by a demo by Paul Rouget, I’ve created an image processing demo that detects eye blinks in real-time. It uses a combination of , , and worker threads. The frames are “projected” on to a to get access to the raw pixels. The Euclidean colour distance is calculated inter-frame and thresholded, resulting in a view that shows movement (shown on a second canvas). A worker thread then performs several algorithms including tracing, sorting, and positioning check of the blobs of pixels. If the worker thread determines an eye blink, it posts back to the main thread which uses the canvas to draw bounding boxes around the eyes. The algorithm is based on a paper I wrote almost 10 years ago describing a communication system I built for a patient with severe spinal injuries. I had originally implemented it in C++ using Microsoft’s “Video For Windows” (a precursor to DirectShow). I bet I would have laughed if someone said that I’d be able to write the same system in JavaScript less than 10 yrs later!
張貼留言
沒有留言:
張貼留言