Ask Your Question
0

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

Comments

1

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

l4ncelot gravatar imagel4ncelot ( 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 imagePeteBlackerThe3rd ( 2019-02-18 03:11:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

tungngo gravatar image

Read part 2 (Converting ROS image messages to OpenCV images) in this tutorial: http://wiki.ros.org/cv_bridge/Tutoria... 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

Stats

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

Seen: 73 times

Last updated: Feb 18