1
1
import numpy as np
2
2
import cv2
3
3
import time
4
- from SimpleCV .Camera import VimbaCamera
4
+ from SimpleCV .Camera import VimbaCamera , AVTCamera
5
5
from SimpleCV import Display
6
6
7
7
#c = VimbaCamera(0, threaded=True) # async
@@ -22,23 +22,42 @@ def test_getImageDisplay():
22
22
print "test_getImage_scv_display2.png saved"
23
23
"""
24
24
25
- def test_takeManyShots ():
26
- c = VimbaCamera ()
27
- printPrettyHeader ("Test takeManyShots" )
28
-
29
- numPics = 50
25
+ def _takeShots (cam , numPics , filename ):
30
26
start = time .time ()
31
27
print "Taking %d photos..." % numPics
32
28
for i in range (numPics ):
33
- img = c .getImage ()
34
- img .save ("takeManyShots_% d.png" % i )
29
+ img = cam .getImage ()
30
+ img .save ("%s_% d.png" % ( filename , i ) )
35
31
end = time .time ()
36
32
elapsed = end - start
37
33
print "Took %f seconds" % elapsed
38
34
35
+ """
36
+ def test_takeManyShots():
37
+ c = VimbaCamera()
38
+ printPrettyHeader("Test takeManyShots")
39
+
40
+ _takeShots(c, 50, "vimba")
41
+ """
42
+
43
+ def test_oneGrayShot ():
44
+ c = VimbaCamera (properties = {"mode" :"gray" })
45
+ printPrettyHeader ("Test oneGrayShot" )
46
+
47
+ img = c .getImage ()
48
+ img .save ("test_oneGrayShot.png" )
49
+
39
50
def test_oneShot ():
40
51
c = VimbaCamera ()
41
52
printPrettyHeader ("Test oneShot" )
42
53
43
54
img = c .getImage ()
44
- img .save ("test_oneShot.png" )
55
+ img .save ("test_oneShot.png" )
56
+
57
+ """
58
+ def test_AVT_takeManyShots():
59
+ c = AVTCamera()
60
+ printPrettyHeader("Test AVT_takeManyShots")
61
+
62
+ _takeShots(c, 50, "avtnative")
63
+ """
0 commit comments