class AravisCapture: def __init__(self, name=None): if type(name) == Camera: self.cam = name else: self.cam = Camera(name) x, y, width, height = self.cam.get_region() print ("Camera model: ", self.cam.get_model_name()) print ("Vendor Name: ", self.cam.get_vendor_name()) print ("Device id: ", self.cam.get_device_id()) print ("Image size: ", width, ",", height) sensor = self.cam.get_sensor_size() print ("Sensor size: ", self.cam.get_sensor_size()) print ("Frame rate: ", self.cam.get_frame_rate()) self.cam.start_acquisition_continuous() print "camera started" self.counter = 0 def read(self): self.counter += 1 print "trying to get frame: ", self.counter frame = self.cam.get_frame(wait=True) return True, frame def cleanup(self): self.cam.stop_acquisition() self.cam.shutdown()
class AravisCapture(): def __init__(self, name=None): if type(name) == Camera: self.cam = name else: self.cam = Camera(name) x, y, width, height = self.cam.get_region() print("Camera model: ", self.cam.get_model_name()) print("Vendor Name: ", self.cam.get_vendor_name()) print("Device id: ", self.cam.get_device_id()) print("Image size: ", width, ",", height) sensor = self.cam.get_sensor_size() print("Sensor size: ", self.cam.get_sensor_size()) print("Frame rate: ", self.cam.get_frame_rate()) self.cam.start_acquisition_continuous() print "camera started" self.counter = 0 def read(self): self.counter += 1 print "trying to get frame: ", self.counter frame = self.cam.get_frame(wait=True) return True, frame def cleanup(self): self.cam.stop_acquisition() self.cam.shutdown()
from aravis import Camera if __name__ == "__main__": #cam = ar.get_camera("Prosilica-02-2130A-06106") #cam = Camera("AT-Automation Technology GmbH-20805103") cam = Camera() ID = cam.get_device_id() path = cam.name + ".xml" print("Writing genicam to: ", path) f = open(path, "w") f.write(cam.get_genicam()[0]) f.close()
import time from aravis import Camera if __name__ == "__main__": try: #cam = ar.get_camera("Prosilica-02-2130A-06106") cam = Camera("AT-Automation Technology GmbH-20805103") print("Camera model: ", cam.get_model_name()) print("Vendor Name: ", cam.get_vendor_name()) print("Device id: ", cam.get_device_id()) print("Region: ", cam.get_region()) #cam.load_config("full_frame_8bit.cxc") cam.set_feature("GevSCPSPacketSize", 1500) cam.start_acquisition() frame = cam.get_frame(wait=True) cam.stop_acquisition() from IPython import embed embed() finally: cam.shutdown()