Imageaquisition

Hi,
i am currently getting myimages like this:
stream.start()

for i in range (0,10):
    triggersoftware_node.execute()
    image, status = stream.wait()
    print(image.buffer_index)
    if image.buffer_index == 3:
        image.save('image%d.png' %(i))
        print(image.buffer_index)

is there another and more elegant way to do this instead of stream.wait()?
Greetings

Hi @Mucki

there are diffrent ways to acquire images. Just have a look at the examples in

  • StreamingAsync
  • StreamingParallel

However, I’m not sure what you expect to be more elegant?
Why don’t you omit the software trigger and set the camera to free run?

Please also note, that omitting stream.wait() would still acquire images into the ring buffer - at least as long as a free buffer is available. But without a blocking function like stream.wait() you would most certainly over-trigger the camera.

Hi Andreas,
more specifically i would like an Tutorial for Python which does the same as ringbuffer exmaple in CSharp or Delphi.
My Greetings

Hi @Mucki

we are currently working on features that will provide more convenient features in Python.
E.g. supporting an UI integration, which is already possible today but would be to much for a tutorial.

Callbacks fired when the contend of a ring buffer image change, are also an upcoming feature.

What is possible (but undocumented) is accessing individual ring buffer images.
The ring buffer has many features of a standard python list.
Please note, that this is only reasonable if lock mode is on (set to cvb.RingBufferLockMode.On).

E.g:

imageNr3 = device.stream.ring_buffer[3]

# or

for ring_buffer image in device.stream.ring_buffer:
  pass

Finally unlocking a ring buffer image (again lock mode must be on) is done by releasing the image.
Either through del or via python with

E.g:

with device.stream.ring_buffer[3] as imageNr3:
  pass