# Imageaquisition

**URL:** <https://forum.commonvisionblox.com/t/imageaquisition/659>\
**Category:** Python API\
**Created:** [January 22, 2019, 4:14pm UTC](https://forum.commonvisionblox.com/t/imageaquisition/659 "2019-01-22T16:14:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mucki](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@Mucki](https://forum.commonvisionblox.com/u/Mucki)\
**Post date:** [January 22, 2019, 4:14pm UTC](https://forum.commonvisionblox.com/t/imageaquisition/659/1 "2019-01-22T16:14:36Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![Andreas](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/andreas/32/75_2.png) [@Andreas](https://forum.commonvisionblox.com/u/Andreas)\
**Post date:** [January 22, 2019, 8:05pm UTC](https://forum.commonvisionblox.com/t/imageaquisition/659/2 "2019-01-22T20:05:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mucki](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@Mucki](https://forum.commonvisionblox.com/u/Mucki)\
**Post date:** [January 23, 2019, 1:41pm UTC](https://forum.commonvisionblox.com/t/imageaquisition/659/3 "2019-01-23T13:41:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Andreas](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/andreas/32/75_2.png) [@Andreas](https://forum.commonvisionblox.com/u/Andreas)\
**Post date:** [January 23, 2019, 9:26pm UTC](https://forum.commonvisionblox.com/t/imageaquisition/659/4 "2019-01-23T21:26:06Z")

</div>

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:

```python
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:

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

```
