thearn / webcam-pulse-detector

A python application that detects and highlights the heart-rate of an individual (using only their own webcam) in real-time.
Other
3.15k stars 595 forks source link

Slow performance with high-res cameras #22

Closed mike-lawrence closed 11 years ago

mike-lawrence commented 11 years ago

You might consider resampling the image to a lower resolution for the face detection parts; those really eat up time when dealing with large images. Once you find the face, you can use the original image to compute the stats.

thearn commented 11 years ago

The Haar cascade detection is performed with the CASCADE_SCALE_IMAGE flag enabled, which should downsample the image for the detection. I haven't experimented with high resolution camera though, so it sounds like some additional tweaks should be made. Thanks for the heads up!

mike-lawrence commented 11 years ago

Ah, I didn't actually profile the code, I just guessed that it was the detection part that was taking up time. Wonder what it is then...