1 | initial version |
I figured it out (at the moment tested with a USB 2.0 Chameleon device in OS X El Capitan).
After reading the frame,
success, frame_raw = self.capture.read()
I just simply had to convert the frame_raw
into color using the Bayer color-scheme like this:
frame = cv2.cvtColor(frame_raw, cv2.COLOR_BAYER_GR2BGR)
This conversion also works for grabbing frames directly using pydc1394 in Python because the raw pixel matrix is just a Numpy array which OpenCV also uses to represent images.
2 | No.2 Revision |
I figured it out (at the moment tested with a USB 2.0 Chameleon device in OS X El Capitan).
After reading the frame,
success, frame_raw = self.capture.read()
I just simply had to convert the frame_raw
into color using the Bayer color-scheme like this:
frame frame_bgr = cv2.cvtColor(frame_raw, cv2.COLOR_BAYER_GR2BGR)
This conversion also works for grabbing frames directly using pydc1394 in Python because the raw pixel matrix is just a Numpy array which OpenCV also uses to represent images.
However, for a USB 3.0 BlackFly camera, the conversion in my case is as follows:
frame_bgr = cv2.cvtColor(frame_raw[...,0], cv2.COLOR_BAYER_BG2BGR)
3 | No.3 Revision |
I figured it out (at the moment tested with a USB 2.0 Chameleon device in In OS X El Capitan).Capitan, using OpenCV 3.0 and Python:
After reading Read the frame,
success, frame_raw = self.capture.read()
I just simply had to Then, convert the frame_raw
into color using the Bayer color-scheme like this:
For a USB 2.0 Chameleon device:
frame_bgr = cv2.cvtColor(frame_raw, cv2.COLOR_BAYER_GR2BGR)
This conversion also works for grabbing frames directly using pydc1394 in Python because the raw pixel matrix is just a Numpy array which OpenCV also uses to represent images.
However, for a USB 3.0 BlackFly camera, the conversion in my case is as follows:
frame_bgr = cv2.cvtColor(frame_raw[...,0], cv2.COLOR_BAYER_BG2BGR)