Skip to content

Commit e996289

Browse files
author
John Sun
committed
more testing
1 parent bd41f8d commit e996289

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

Diff for: SimpleCV/tests/test_vimba.py

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def _listAllCameras(c):
8989
for i in l:
9090
print 'Camera Id=%s' % i.cameraIdString
9191

92+
"""
93+
def test_runCommand_only():
94+
c = VimbaCamera()
95+
_runCommand(c)
96+
"""
97+
9298
def test_all():
9399
c = VimbaCamera()
94100
_getProperty(c)

Diff for: SimpleCV/tests/test_vimba_manyshots.py

+28-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import cv2
33
import time
4-
from SimpleCV.Camera import VimbaCamera
4+
from SimpleCV.Camera import VimbaCamera, AVTCamera
55
from SimpleCV import Display
66

77
#c = VimbaCamera(0, threaded=True) # async
@@ -22,23 +22,42 @@ def test_getImageDisplay():
2222
print "test_getImage_scv_display2.png saved"
2323
"""
2424

25-
def test_takeManyShots():
26-
c = VimbaCamera()
27-
printPrettyHeader("Test takeManyShots")
28-
29-
numPics = 50
25+
def _takeShots(cam, numPics, filename):
3026
start = time.time()
3127
print "Taking %d photos..." % numPics
3228
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))
3531
end = time.time()
3632
elapsed = end - start
3733
print "Took %f seconds" % elapsed
3834

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+
3950
def test_oneShot():
4051
c = VimbaCamera()
4152
printPrettyHeader("Test oneShot")
4253

4354
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

Comments
 (0)