tentone / tello-ros2

ROS2 node for DJI Tello and Visual SLAM for mapping of indoor environments.
MIT License
144 stars 45 forks source link

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

Open TSoli opened 6 months ago

TSoli commented 6 months ago

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".