Ask Your Question
0

I want to create a software that can monitor blinking per minute with a USB camera using simpleCV and openCV .

asked 2014-01-21 06:00:38 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I tried with simpleCV, got a open source code, with simple modifications i am able to write down a code which is able to detect the blinking (at a particular position of image a small change appears and gone). Now i want to calculate the blinking per minute and want to plot a live graph. I saw some code and projects those used Fourier transform for this kind of work but not able to implement in my project , i finally landed here please help me out thanks in advance:

from SimpleCV import *

cam = Camera()
threshold = 5.0 # if mean exceeds this amount do something

while True:
        previous = cam.getImage() #grab a frame
        time.sleep(0.5) #wait for half a second
        current = cam.getImage() #grab another frame
        diff = current - previous
        matrix = diff.getNumpy()
        mean = matrix.mean()

        diff.show()

        if mean >= threshold:
                print "Motion Detected"
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-01-21 08:39:04 -0600

updated 2014-01-21 08:44:10 -0600

to draw a graph you can start using matplotlib

Matplotlib Examples

edit flag offensive delete link more
0

answered 2014-01-21 10:21:49 -0600

The code you are using will detect any motion. In order to detect blinking you could you Haar classifiers of an open eye to see how many such eye images are present in the image. For plotting graph, Matplotlib will be you best option

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-01-21 06:00:38 -0600

Seen: 365 times

Last updated: Jan 21 '14