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

How to use camera calibration in uvc_camera node?

asked 2018-06-25 09:30:58 -0500

bitgxj gravatar image

I have done camera calibration according to this tutorial. I have my camera.yaml:

image_width: 640 image_height: 480 camera_name: camera camera_matrix: rows: 3 cols: 3 data: [695.522341, 0.000000, 308.978108, 0.000000, 689.343000, 229.440273, 0.000000, 0.000000, 1.000000] distortion_model: plumb_bob distortion_coefficients: rows: 1 cols: 5 data: [-1.057717, 0.862148, -0.010012, 0.006670, 0.000000] rectification_matrix: rows: 3 cols: 3 data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000] projection_matrix: rows: 3 cols: 4 data: [492.770355, 0.000000, 310.383965, 0.000000, 0.000000, 577.829346, 219.297603, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]

I want to use this calibration file when I am using uvc_camera. After launching that, I echo the camera_info topic, comes follow:

header: seq: 973 stamp: secs: 1529935088 nsecs: 499953536 frame_id: camera height: 480 width: 640 distortion_model: plumb_bob D: [-1.057717, 0.862148, -0.010012, 0.00667, 0.0] K: [695.522341, 0.0, 308.978108, 0.0, 689.343, 229.440273, 0.0, 0.0, 1.0] R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] P: [492.770355, 0.0, 310.383965, 0.0, 0.0, 577.829346, 219.297603, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0


The params above are right. But when I run

rosrun rqt_image_view rqt_image_view

and subscribe the topic /image_raw I saw nothing changes. My question is : does the calibration work? If it is work, why I can't see the changes? If it does not, what's the right way to use the calibration file?

edit retag flag offensive close merge delete

Comments

/image_raw is the raw image (i.e. not rectified). IIRC uvc_camera publishes /image_raw , but you need to then use the calibration information to process those images. Like @jarvisschultz said, check out http://wiki.ros.org/image_proc and the image_proc node, specifically.

christophebedard gravatar image christophebedard  ( 2018-06-25 13:14:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-25 10:41:27 -0500

Generally the camera driver (uvc_camera in your case) is not responsible for using the camera calibration. Rather, it makes the calibration information available for other processes to use for things like rectification.

You likely should read the image_proc page. By properly starting the image_proc node/nodelets, you'll automatically have access to rectified and grayscale versions of the raw camera image.

Depending on what you are doing, you may also want to look at the image_geometry package that provides tools for reading images and calibration files and performing geometric computations correctly.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-06-25 09:30:58 -0500

Seen: 388 times

Last updated: Jun 25 '18