jordens / pyflycapture2

python bindings for the flycapture v2 api (libflycapture-2c)
37 stars 31 forks source link

Triggering Camera #13

Closed KelseyJustis closed 8 years ago

KelseyJustis commented 8 years ago

Good afternoon,

I am try to use your software with a Fea3 camera. I want to first say thank you for the work you have done so far!

I was wondering if you had any examples on how to capture an image upon receiving an external signal; I am able to use a modified version of your provided example with a software trigger and the predefined method in the flycapture.pyx file, but cannot trigger a capture without running into errors.

If you have any extra code examples on how to work with your code would you mind sharing?

Thank you again for your help already.

Best, Kelsey

jordens commented 8 years ago

I currently don't have access to these cameras and don't have any code that uses the hardware triggers. It should work fine if you set it up along the lines of the flycapture2 example C code. But I'll leave this issue open. Maybe somebody else has a working code snippet.

KelseyJustis commented 8 years ago

Thank you; I'll check out the C code for some more inspiration. Any help is definitely appreciated.

Best, Kelsey

KelseyJustis commented 8 years ago

I believe I found my issue; line 39 in test_flycapture2.py has

" print [np.array(c.retrieve_buffer(im)).sum() for i in range(80)]".

This requires a trigger to fire 80 times before all 80 frames are summed together and show the result otherwise the console gives no output or times out.

If you change this number you can get results after fewer trigger firings, but for my use it was better to have the raw image rather than the summative one. I'll attach my generalized code here now for others as a possible trigger example for this awesome library:)

Thank you again for your work! Best, Kelsey

external_trigger_example.txt

jordens commented 8 years ago

Thanks! Generalizing the test script and removing assumptions about the hardware in it would be a welcome change. Feel free to create a pull request for it.