[kamera commit] r66 - trunk/kamera

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 28, 2008, 1:24:33 AM11/28/08
to kamera-...@googlegroups.com
Author: ugur.jnmbk
Date: Thu Nov 27 22:24:24 2008
New Revision: 66

Modified:
trunk/kamera/opencvwidget.py

Log:
proper timeout selection

Modified: trunk/kamera/opencvwidget.py
==============================================================================
--- trunk/kamera/opencvwidget.py (original)
+++ trunk/kamera/opencvwidget.py Thu Nov 27 22:24:24 2008
@@ -23,8 +23,14 @@
class CamThread(QtCore.QThread):
def run(self):
camera = highgui.cvCreateCameraCapture(0)
+ timeout = highgui.cvGetCaptureProperty(camera,
highgui.CV_CAP_PROP_FPS)
+ #30 fps if cam gives no value
+ if not timeout > 0:
+ timeout = 33
+ else:
+ timeout = 1000 / timeout
while True:
- self.msleep(30)
+ self.msleep(timeout)
self.cvimage = highgui.cvQueryFrame(camera)
self.emit(QtCore.SIGNAL("image"), (self.cvimage))

Reply all
Reply to author
Forward
0 new messages