![]() |
Emily Yu Williams College Class of 2011 |
![]() |
The first step in implementing a template matching version of the blink detection was to find templates. Using the method to detect blinks from the previous page, I was able to save templates of the open and closed eyes. In the interface, the user blinked repeatedly in the search boxes like so:
When a good blink template was found, the images were saved like this:
Then, using a function from the OpenCV library called CVmatchTemplate, I tried to find a match in the video frames. However, when using this, I found that I could rarely correctly find a match using the function. Professor Betke suggested that by narrowing the search area, I might be able to find a match better, so I revised my code to find a search area based on the trackpoint (the coordinate of the feature being tracked). This is how it works:
I found the distance from the trackpoint to the edges of the template boxes. I created a rectangle and shifted it as the trackpoint moved. When this still didn't yielf accurate results using matchTemplate, I decided to write my own method to find the Normalized Correlation Coefficient.
Forward
Back