morefigs / pymba

Python wrapper for Allied Vision's Vimba C API
MIT License
105 stars 84 forks source link

Capture of multiple frames #72

Closed ohinrichs closed 5 years ago

ohinrichs commented 6 years ago

In a test construction we try to capture frames with a very high framerate. The camera is taking pictures behind a strobe, which is turning with frequency of about 50 Hz and has a small window. The signal of the strobe can be used as an external trigger. So the plan is to start taking multiple frames (about 300) after the external trigger (maybe with some delay) with a high framerate (about 2000 to 3000 fps) and then saving the frames to a file. When the trigger is disabled the framerate is achieved. But when the trigger is activated only 25 fps are possible, even when "cam.AcquisitionFrameCount = 300". We tried different combinations of TriggerSelector (AcquisitionStart, AcquisitionRecord, FrameStart) and AcquisitionMode (Continuous, Multiframe, Recorder). It seems that only one frame is captured or saved after the trigger. So the question is: Do we have to use another function to get multiple frames after the trigger than "frame.queueFrameCapture()" and "frame.getBufferByteData()"? How does the recorder work and what are the functions for that? Can you provide an example for capturing multiple frames at once?

morefigs commented 6 years ago

I don't know off the top of my head. It's probably more a question of reading the Vimba manual and seeing if there is functionality for high speed capture, as generally speaking pymba is just a thin wrapper for Vimba functions.

sciunto commented 6 years ago

I do have the same question. Indeed, the online documentation mentions various modes of acquisitions, which are not currently illustrated in the examples or the documentation of pymba.

morefigs commented 5 years ago

To capture images at high speed you need to construct a buffer of multiple frames and process them independently of capture. I'll aim to get an example up soon.

sciunto commented 5 years ago

thanks @morefigs !

morefigs commented 5 years ago

There's good info in the Vimba manual about doing the above.

morefigs commented 5 years ago

@ohinrichs I've added camera convenience functions for streaming images asynchronously, which should be an efficient way to capture at high frame rates. You may need to tweak frame_buffer_size in order to be able to save frames to disk at such a high frame rate without dropping frames.

morefigs commented 5 years ago

Closing for now. If this is still an issue with Pymba >= 0.3 please open a new issue.