kbrafford / pyfly2

Python wrapper for Point Grey Research's FlyCapture2 C API
18 stars 10 forks source link

add GrabNumPyImage() method and OpenCV integration example #6

Closed JoeHowse closed 9 years ago

JoeHowse commented 9 years ago

I have added a GrabNumPyImage() method to the Camera class. This method returns an image as a NumPy array, which can be used by OpenCV, SciPy, and many other libraries. The method has an optional argument called "format", whose value is a string. Valid values are 'bgr' (for 24 bpp BGR, which is the default value, since OpenCV normally uses BGR), 'rgb' (for 24 bpp RGB), or 'gray' (for 8 bpp monochrome).

I have also added an example showing the use of GrabNumPyImage in a simple OpenCV GUI.

Tested with a Grasshopper3 GS3-U3-23S6M.

kbrafford commented 9 years ago

Sorry that took me so long. Thanks for the input!