How to use camera calibration in uvc_camera node?
I have done camera calibration according to this tutorial. I have my camera.yaml:
imagewidth: 640 imageheight: 480 cameraname: camera cameramatrix: rows: 3 cols: 3 data: [695.522341, 0.000000, 308.978108, 0.000000, 689.343000, 229.440273, 0.000000, 0.000000, 1.000000] distortionmodel: plumbbob distortioncoefficients: rows: 1 cols: 5 data: [-1.057717, 0.862148, -0.010012, 0.006670, 0.000000] rectificationmatrix: 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 uvccamera. After launching that, I echo the camerainfo topic, comes follow:
header: seq: 973 stamp: secs: 1529935088 nsecs: 499953536 frameid: camera height: 480 width: 640 distortionmodel: plumbbob 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] binningx: 0 binningy: 0 roi: xoffset: 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?
Asked by bitgxj on 2018-06-25 09:30:58 UTC
Answers
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.
Asked by jarvisschultz on 2018-06-25 10:41:27 UTC
Comments
/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.Asked by christophebedard on 2018-06-25 13:14:01 UTC