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

Images sent are encoded to bgr8 but are actually rgb8 #12

Open
TSoli opened this issue May 3, 2024 · 0 comments
Open

Images sent are encoded to bgr8 but are actually rgb8 #12

TSoli opened this issue May 3, 2024 · 0 comments

Comments

@TSoli
Copy link

TSoli commented May 3, 2024

The image messages sent claim the images are bgr8 but in my testing it seems they are actually rgb8. The line where the message is sent is here. To test this you could add

cv2.imshow(frame)
cv2.waitKey(1)

before sending the message and you will see that the blue and red channels appear flipped in the display. cv2 expects a BGR image so this means the images sent over UDP are actually RGB. To fix this either add

frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)

before converting the image to an image message or change the encoding on this line to "rgb8".

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