DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Jhon's picture

Unregistered

Feeds

aliases

  • Jhon

Jhon

9 months ago

in Fun with Python, OpenCV and face detection on In Traction
I figured it out how to properly use cvWaitKey.

In your code you are waiting just 10 ms for a key, and only after the image was processed.
So, if you wait a little bit longer(maybe 100ms, but this will slow down a lot the fps) you will be able to catch the keys.

However, there is also another problem cvWaitKey returns -1 when no key was pressed, but return a string(char) holding the key pressed, so you need to do the following:
if k!=-1 and ord(k) == 0x1b: # ESC
print 'ESC pressed. Exiting ...'
break
1 reply
Jo Vermeulen's picture
Jo Vermeulen Ah thanks, that's very helpful!

9 months ago

in Small update on face detection post on In Traction
Could you upload your sources, I really want to learn DBUS and py-notify?
Besides, it looks really nice your software, I would like to have a copy.
1 reply
Jo Vermeulen's picture
Jo Vermeulen When I find some time to do so, I surely will. For learning D-Bus, you can already have a look at the source code for PydgetRFID.
Returning? Login