ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

how to modify and publish camera_info?

asked 2016-10-04 08:42:21 -0500

baozhang gravatar image

updated 2016-10-04 11:21:21 -0500

gvdhoorn gravatar image


I would like to make a cropped image from raw image in python.

In my program, I can subscribe /usb_cam/image_raw (sensor_msgs/Image, height=480, width=640) and /usb_cam/camera_info (sensor_msgs/CameraInfo).

Then, I modified roi in /usb_cam/camera_info like below,

edited_camera_info.roi.x_offset = 320
edited_camera_info.roi.y_offset = 240

and publish edited camera info and image.


However, there are no differences between /usb_cam/image_raw and /editted_image_raw.

Is it possible to crop a part of an image by modifying camera_info? Or, is there any alternative ways to realize to crop an image?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-04 11:22:28 -0500

gvdhoorn gravatar image

No, I don't think that is supposed to work like that.

For cropping an image have a look at the image_proc package, in particular the image_proc/crop_decimate nodelet.

edit flag offensive delete link more


Thank you for replying.

I decided to use image_proc/crop_decimate nodelet.

baozhang gravatar image baozhang  ( 2016-10-04 22:34:52 -0500 )edit

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


Asked: 2016-10-04 08:42:21 -0500

Seen: 697 times

Last updated: Oct 04 '16