I created an image from a window screenshot using Win32gui. The object has the type:
object 'PyCBitmap' - assoc is 000002AF9A64DB50, vi=<None>
I want to then pass this for analysis with OpenCV. I have had success reading in a saved .bmp file using:
cv2.imread(img_file, 0)
When trying using cv2.imread for a PyCBitmap object I get the following error:
TypeError: bad argument type for built-in operation
My question is:
How can I convert the PyCBitmap object into an acceptable type for cv2.imread, without having to save the object as a .bmp file first?
Thanks in advance,
Behzad
p.s I'm using opencv 3.1 with python bindings, I'm happy to follow advice written in C++ or python :)