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

example for setting destination width and height and getting updated camera info when using image_proc/resize

asked 2019-09-10 11:41:00 -0600

GXY gravatar image

Hey, could someone please give me a concrete example about how to use the resize() function via command line?

This link seems to be promising, but it doesn't show how to set destination width and height and how to get updated camera info.

This link is also similar, but I don't understand which .h file it's about and why is a header file useful.

In the video tutorial I didn't find anything useful either.

I was expecting that I can specify the destination width and height via command line and also get the updated camera info. Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-09-12 05:05:27 -0600

Felix Ruess gravatar image

Basically you run the nodelet and remap the input topics. The resize parameters you can change via dynamic reconfigure and/or provide initial values as cmdline parameters.

E.g. to downscale the /stereo/left/image_rect to half the size:

rosrun nodelet nodelet standalone image_proc/resize image:=/stereo/left/image_rect camera_info:=/stereo/left/camera_info _scale_width:=0.5 _scale_height:=0.5
edit flag offensive delete link more

Comments

1

Hello, I am new to ROS and would like to include this resize in my launch file. Could you help me out with this? Thanks in advance!

Vasc gravatar image Vasc  ( 2022-07-05 04:46:36 -0600 )edit

What it looks like in a launch file:

<node name="resized" pkg="nodelet" type="nodelet"
    args="standalone image_proc/resize"
    output="screen">
  <remap from="image" to="/stereo/left/image_rect" />
  <remap from="camera_info" to="/stereo/left/camera_info" />
  <param name="scale_width" value="0.5" />
  <param name="scale_height" value="0.5" />
</node>

In a remapping ~image is the input image (which will appear as resized/image given the node name is resized), while image is the output image

lucasw gravatar image lucasw  ( 2022-11-04 15:48:07 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-09-10 11:41:00 -0600

Seen: 1,931 times

Last updated: Sep 12 '19