0

I am trying to extract 3 channels from an image coming from Kinect2 stream. So, first I ream the color stream with the pylibfreenect2 package.

color = frames["color"]

So I have the following shape

print(color.asarray().shape) #(1080, 1920, 4)

As I understood, 4 is rather the number of bytes per pixel or the alpha-channel. I want the image to have 3 channels (RGB) and have a shape of (1080, 1920, 3). I tried to do it like:

image_c = cv2.cvtColor(c, cv2.COLOR_RGBA2RGB)

But had an error from PIL package:

TypeError: Cannot handle this data type
Kate Lyapina
  • 364
  • 1
  • 2
  • 9

0 Answers0