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

How to use image_proc/crop_decimate to crop an image?

asked 2016-11-15 16:08:34 -0600

Hamz gravatar image

updated 2016-11-16 05:02:03 -0600

gvdhoorn gravatar image

Hi, I used usb_cam driver to publish a camera raw image, and I'm trying to crop the published image using image_proc/crop_decimate. when I viewed the output of image_proc/crop_decimate, I did not see any difference between the original image and the cropped image. it seems that the image_proc/crop_decimate node is bypassing the parameters of my launch file. the size of the original image 640x480 and I want to crop the image to 640x300 This is my launch file script:

<node pkg="image_proc" type="image_proc"

<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
  <param name="x_offset" type="int" value="0" />
  <param name="y_offset" type="int" value="0" />
  <param name="width" type="int" value="640" />
  <param name="height" type="int" value="250" />

  <!-- remap input topics -->
  <remap from="usb_cam/image_rect_color" to="camera/image_raw"/>
  <remap from="usb_cam/camera_info" to="camera/camera_info"/>

  <!-- remap output topics -->
  <remap from="camera_out/image_raw" to="camera_crop/image_rect_color"/>
  <remap from="camera_out/camera_info" to="camera_crop/camera_info"/>

Does any one has an idea how to use image_proc/crop_decimate node?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-25 11:52:09 -0600

erush91 gravatar image

The "from" and "to" topic names should be switched for the input mapping. I have had success implementing this.

Regardless of whether you are remapping an input or an output topic, the "from" is what is topic referenced in the node(let) source code, and the "to" is the rostopic this is the actual input/output.

Here is the exact syntax:

Name that you are remapping.


Target name.


See this as an example:

edit flag offensive delete link more


Thanks, I think this should be marked as the answer

Ifx13 gravatar image Ifx13  ( 2022-01-19 03:33:15 -0600 )edit

Question Tools



Asked: 2016-11-15 16:08:34 -0600

Seen: 1,998 times

Last updated: Apr 25 '19