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

how to modify and publish camera_info?

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

baozhang gravatar image

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

gvdhoorn gravatar image

Hello.

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.

pub_edited_image.publish(no_edited_image)
pub_edited_camera_info.publish(edited_camera_info)

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
1

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

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

Comments

Thank you for replying.

I decided to use image_proc/crop_decimate nodelet.

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

Question Tools

1 follower

Stats

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

Seen: 787 times

Last updated: Oct 04 '16