jordens / pyflycapture2

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

I wonder if there are more sample examples #5

Closed dujianyi closed 9 years ago

dujianyi commented 9 years ago

Hey,

I wonder if more sample examples could be provided, I am currently using this wrapper with PyQt5 to show live video, but O really can't understand how to figure it out.

Thank you!

abaldwin99 commented 9 years ago

Yes examples would go a long way. I'm considering purchasing a camera for use with this software. I'm planning to go for python first and fall back to the supported C# if I can't get library working. I will gladly contribute my own examples if/when I have them but first I need to get off the ground.

jordens commented 9 years ago

Apart from capturing images and supplying you with pixel arrays there is very little this library will do for you. If you want to display video, use a generic toolkit and get that going with random data (no pyflycapture2), then plug in pyflycapture2.

Here is another example https://github.com/jordens/bullseye/blob/master/bullseye/flycapture2_capture.py

dujianyi commented 9 years ago

Hey Jordens,

Thank you for the update! But I don't think it helps with my problem. Now I have an array from "retrieve_buffer" with size of 1024 * 768, I wonder how I can display it on the screen? Is it grey picture?

Thank you!

jordens commented 9 years ago

there is no problem here. the array is just what your pixels see. if you have r-g-b pixels you have to figure out how to do the interpolation. plotting pictures is done with any other library.

abaldwin99 commented 9 years ago

Thanks Jordens that makes sense. So in theory I should be able to plug the RGB array returned from this library into PIL's putdata function and then save it. Would you prefer such a script be pull requested to your repo here or should I keep it separate?

jordens commented 9 years ago

it is not an rgb array. if you sensor is rgb, the data is the bayer grid. this is all explained in the documentation. i don't think "saving an array with pil" is a helpful addition.