Robotics StackExchange | Archived questions

Is there a node/package for periodic camera calibration?

Hi there, I have a single rgb camera with known intrinsic parameters mounted to a robot together with a chessboard pattern fixed the robot's base.

The chess board is fixed and I already publish its transform relative to the base, but the camera position may change (tilt) overtime which will certainly influence on the visual measurements I am making.

So my question is: Is there a node/package that I can use that automatically publishes the TF for a camera given a fixed pattern? I remind you that I already have the intrinsics parameters and that theses are published using CameraInfo.

Thanks, Pedro

Asked by PedroGusmao on 2014-07-11 02:03:11 UTC

Comments

Answers

I have not heard of such a package. Surely you could run anything periodically with just a simple script, but the cleanest way to do what you are after is use the OpenCV function solvePNP(). It takes as an input the 2D pixel coordinates of your calibration pattern points and the corresponding 3D world coordinates. The output is the translation vector and the rotation vector. You can get a rotation matrix out of the rotation vector with OpenCV function Rodrigues(). The pattern 2D coordinates can be found from the image using either findChessboardCorners() or findCirclesGrid(), depending on your pattern.

This is exactly what OpenCV uses for camera calibration and ROS simply uses OpenCV for the task. You will find the OpenCV examples on the Internet.

One thing to keep in mind is that due to the possible symmetry of your calibration pattern, the rotation vector might be 180 degrees rotated from what you expect.

Sorry for giving an OpenCV answer to a ROS question.

Asked by rasmus25 on 2014-07-11 08:27:41 UTC

Comments