Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting 3 channels in a colour stream #54

Open
aegorfk opened this issue Aug 6, 2018 · 0 comments
Open

Extracting 3 channels in a colour stream #54

aegorfk opened this issue Aug 6, 2018 · 0 comments

Comments

@aegorfk
Copy link

aegorfk commented Aug 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant