How to use camera calibration in uvc_camera node?
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?
/image_raw
is the raw image (i.e. not rectified). IIRCuvc_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 theimage_proc
node, specifically.