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

Visualize 2d objects in 2d image in rviz

asked 2018-07-26 03:29:06 -0500

sietschie gravatar image

updated 2018-07-26 08:56:25 -0500


I would like to visualize some 2d objects using lines or bounding boxes in a 2d image in RVIZ. So far I was not able to find a way. I am suspecting that this might not be supported by RVIZ. But since I only started using ROS it is also likely that I was just looking at the wrong place.

Here is what I found out so far:

  • I can visualize things in 3D using markers.
  • I can visualize an image using the display type Image.
  • I can also visualize an image using the display type camera, and I think if there is correct calibration information, the 3d markers get projected in that image.

But is there a way to directly draw something like the markers into a 2d image?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-26 11:32:56 -0500

The easiest way to do this is to make your own node which subscribes to the image topic, draws the markers on top of the image and publishes it on a new topic. I do this for debugging vision algorithms on a regular basis.

The image transport package can be used to receive and publish openCV images, openCV's basic drawing functions are described here.

edit flag offensive delete link more


I really need this..The way draw by a node cannot solve if i have multiple boxes from different node, which will publish too much new images..Is there any way to solve as rviz plugin?

LMerCy gravatar image LMerCy  ( 2021-11-10 23:55:02 -0500 )edit

Question Tools


Asked: 2018-07-26 03:28:13 -0500

Seen: 1,423 times

Last updated: Jul 26 '18