ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Strange color cv_bridge

asked 2017-11-01 21:09:09 -0500

tsw gravatar image

I subscribe to the topic camera/rgb/image_raw and convert the image taken to opencv, when I run cv2.imshow to show the image it shows the right color. But when I tried to converted the image using the following line the color becomes strange after I show it cv2.cvtColor(image,cv2.COLOR_RGB2BGR)

edit retag flag offensive close merge delete



Doesn't opencv use BGR as default? If so then this convert wouldn't make sense in my opinion.

l4ncelot gravatar image l4ncelot  ( 2017-11-02 02:05:48 -0500 )edit

I agree. If the image displays with the correct color first, why are you attempting to change it from what you know is right?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-02-18 03:11:45 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-02-18 02:13:10 -0500

tungngo gravatar image

Read part 2 (Converting ROS image messages to OpenCV images) in this tutorial: Then change the encoding passthrough to a suitable encoding.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-11-01 21:09:09 -0500

Seen: 589 times

Last updated: Feb 18 '19