def configure_acquisition(self, continuous=True, buffer_count=7):
"""Configure camera for live and triggered mode."""
mako_attributes = {
"AcquisitionMode": "Continuous",
"ExposureMode": "Timed",
"ExposureTimeAbs": 3000,
"TriggerActivation": "RisingEdge",
"TriggerMode": "Off",
"TriggerSelector": "FrameStart",
"TriggerSource": "Freerun",
}
self.set_attributes(mako_attributes)
if continuous:
self.camera.AcquisitionMode = "Continuous"
one = True
self.frames = [
self.camera.new_frame() for _ in range(buffer_count)
] # Make a frame buffer.
# For each buffered frame, we announce onece
for self.frame in self.frames:
# Announce this frame that maybe queued
self.frame.announce() # Error being thrown here for the 2nd image
# Start capture
self.camera.start_capture()
for self.frame in self.frames:
self.frame.queue_for_capture()
# Begin camera acquisition
self.camera.AcquisitionStart()
# If not live streaming, wait for a trigger
else:
self.camera.TriggerMode = "On"
self.camera.TriggerSource = "Line1"
self.camera.AcquisitionMode = "MultiFrame"
self.camera.ExposureMode = "TriggerWidth"