Hi,
I’m trying to acquire 12 bits mono images via a software triggering over a VC-25M10G-M41I0 camera. I am able to acquire a single image, even though the ring buffer does not increase, but this image is also an 8bits mono image instead of the required 12 bits.
So:
- Why does the stream.statistics[cvb.StreamInfo.NumBuffersPending] not increase after a trigger_software.execute()?
- Why is the image still in a 8 bits format instead of the 12 bits?
I am posting a part of my code below:
with cvb.DeviceFactory.open(cvb.install_path()+"Drivers\GenICam.vin"
) as device:
#device = cvb.DeviceFactory.open(cvb.install_path()+"Drivers\GenICam.vin")
dev_node_map = device.node_maps["Device"]
pixel_node = dev_node_map["PixelFormat"]
pixel_node.value = "Mono12"
print("pixeltype set to: " + str(pixel_node.value))
trigger_mode = dev_node_map["TriggerMode"]
trigger_source = dev_node_map["TriggerSource"]
trigger_mode.value = "On"
trigger_source.value = "Software"
trigger_software = dev_node_map["TriggerSoftware"]
print("Trigger: ",str(trigger_mode),str(trigger_source) )
stream = device.stream()
ringBufferCount = stream.ring_buffer.count
print('Size ring buffer', ringBufferCount)
device.stream().start()
images_in_buffer = stream.statistics[cvb.StreamInfo.NumBuffersPending]
print('Number of images in buffer: ', int(images_in_buffer))
trigger_software.execute()
print('trigger done: ', trigger_software.is_done)
trigger_software.execute()
images_in_buffer = stream.statistics[cvb.StreamInfo.NumBuffersPending]
print('Number of images in buffer: ', int(images_in_buffer))
trigger_software.execute()
for i in range(2):
print("i:",i)
image, status = stream.wait_for(5000)
images_in_buffer = stream.statistics[cvb.StreamInfo.NumBuffersPending]
print('Number of images in buffer: ', int(images_in_buffer))
print("status1: ", status, cvb.WaitStatus.Ok)
if status == cvb.WaitStatus.Ok:
print("Acquired image: ")
image_array = cvb.as_array(image.clone(), copy=True)
print("max value: ", np.amax(image_array))
plt.subplot(1, 4, i+1)
plt.imshow(image_array[0:5000,0:5000], cmap='hot', interpolation='nearest')
else:
#raise RuntimeError( "timeout during wait"
# if status == cvb.WaitStatus.Timeout else
# "acquisition aborted")
print('error')
images_in_buffer = stream.statistics[cvb.StreamInfo.NumBuffersPending]
print('Number of images in buffer: ', images_in_buffer)
This leads to the following result:
pixeltype set to: Mono12
Trigger: On Software
Size ring buffer 3
Number of images in buffer: 0
trigger done: True
Number of images in buffer: 0
i: 0
Number of images in buffer: 0
status1: 0 0
Acquired image:
max value: 96
i: 1
Number of images in buffer: 0
status1: 0 0
Acquired image:
max value: 255
Number of images in buffer: 0