projekty
/
imago.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
331a6c4
)
better capture on windows
author
Tomas Musil
<tomik.musil@gmail.com>
Tue, 1 May 2012 20:00:49 +0000
(22:00 +0200)
committer
Tomas Musil
<tomik.musil@gmail.com>
Tue, 1 May 2012 20:00:49 +0000
(22:00 +0200)
camera.py
patch
|
blob
|
history
capture.py
patch
|
blob
|
history
diff --git
a/camera.py
b/camera.py
index
a1be68b
..
7efacb4
100644
(file)
--- a/
camera.py
+++ b/
camera.py
@@
-13,7
+13,8
@@
if os.name == 'posix':
def get_image(self):
for _ in range(8): #HACK
def get_image(self):
for _ in range(8): #HACK
- im = cv.QueryFrame(self._cam)
+ cv.QueryFrame(self._cam)
+ im = cv.QueryFrame(self._cam)
# Add the line below if you need it (Ubuntu 8.04+)
#im = cv.GetMat(im)
#convert Ipl image to PIL image
# Add the line below if you need it (Ubuntu 8.04+)
#im = cv.GetMat(im)
#convert Ipl image to PIL image
@@
-26,12
+27,18
@@
if os.name == 'posix':
elif os.name in ('ce', 'nt', 'dos'):
from VideoCapture import Device
elif os.name in ('ce', 'nt', 'dos'):
from VideoCapture import Device
+ import time
# TODO exception handling
class Camera:
def __init__(self, device=0):
self._cam = Device()
self._cam.setResolution(640, 480)
# TODO exception handling
class Camera:
def __init__(self, device=0):
self._cam = Device()
self._cam.setResolution(640, 480)
+ #HACK to let the camera self-adjust:
+ print "The device is getting ready."
+ for _ in xrange(20):
+ self._cam.getImage()
+ time.sleep(0.5)
def get_image(self):
return self._cam.getImage()
def get_image(self):
return self._cam.getImage()
diff --git
a/capture.py
b/capture.py
index
a4268a0
..
98ad7be
100755
(executable)
--- a/
capture.py
+++ b/
capture.py
@@
-40,6
+40,9
@@
def main():
cam = Camera(device=args.device)
screen = Screen()
cam = Camera(device=args.device)
screen = Screen()
+ im = cam.get_image()
+ screen.display_picture(im)
+
im_number = 0
while True:
im_number = 0
while True: