ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Strange color cv_bridge

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

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 -0600 )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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 393 times

Last updated: Feb 18 '19