Ask Your Question
1

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"
      ns="usb_cam"
      name="image_proc">
</node>

<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <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"/>
</node>

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

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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: http://wiki.ros.org/roslaunch/XML/remap

Name that you are remapping.

from="original-name"

Target name.

to="new-name"

See this as an example: http://gizmosmith.com/2018/09/24/conf...

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

2 followers

Stats

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

Seen: 772 times

Last updated: Apr 25