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".
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
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 addbefore converting the image to an image message or change the encoding on this line to
"rgb8"
.