# License along with pydc1394. If not, see # <http://www.gnu.org/licenses/>. # # Copyright (C) 2009, 2010 by Holger Rapp <*****@*****.**> # and the pydc1394 contributors (see README File) from pydc1394 import DC1394Library, Camera l = DC1394Library() cams = l.enumerate_cameras() cam0_handle = cams[0] print "Opening camera!" cam0 = Camera(l, cam0_handle['guid']) print "Vendor:", cam0.vendor print "Model:", cam0.model print "GUID:", cam0.guid print "Mode:", cam0.mode print "Framerate: ", cam0.framerate.val print "Acquiring one frame!" cam0.start() i = cam0.shot() print "Shape:", i.shape print "Dtype:", i.dtype cam0.stop() print "All done!"
cam0.exposure.mode = 'auto' cam0.white_balance.mode = 'auto' except AttributeError: # thrown if the camera misses one of the features pass for feat in cam0.features: print "%s (cam0): %s" % (feat,cam0.__getattribute__(feat).val) #choose color mode print cam0.modes cam0.mode = cam0.modes[0] if len(sys.argv) > 1: cam0.start(interactive=False) sleep(0.5) #let hardware start ! matrix = cam0.shot() cam0.stop() else: cam0.start(interactive=True) sleep(0.5) #let hardware start ! matrix = cam0.current_image cam0.stop() print "Shape:", matrix.shape i = Image.fromarray(matrix) i.save("t.bmp") i.show()