I am trying to get image from Point Grey Camera using PyCapture2, provided by them as a python wrapper for FlyCapture2. I can take retrieve the image buffer but I am not able to get image as Mat datatype to be used in OpenCV.
For reference:
while not cv2.waitKey(100) & 0xFF == ord('q'):
try:
raw_object = camera.retrieveBuffer()
except PyCapture2.Fc2error as fc2Err:
print "Error retrieving buffer : ", fc2Err
continue
rgb_object = raw_object.convert(PyCapture2.PIXEL_FORMAT.BGR)
How to convert this rgb_object into a Mat Image?
This is what I did:
And if you want color image:
reference: http://answers.opencv.org/question/74788/point-grey-usb3-camera-pixel-color-format/