- Chris Mobley <[email protected]>, Computational Multiphysics Systems Laboratory, Virginia Tech
Note: Please use the GitHub issues for questions and problems regarding the opencv_camera_calibration package and its components. Do not write emails.
This tool uses OpenCV to calibrate a camera via a ROS Image stream. It uses chess or circle boards.
- ROS Indigo
- OpenCV
for the ROS packages look at the package.xml
Windows:
ESC
,q
: QuitSPACE
,s
: Save the current image for calibrationt
: Toggle text on screen
Terminal:
CRTL
+c
: Quit
Checkboard Patterns are available at OpenCV:
Recommended preparation:
- Print your calibration pattern and glue it to a flat object. It is very important that the calibration pattern is very flat.
- Get two tripods, one for holding the calibration pattern, and another one for holding the camera sensor. Ideally, the tripod for the camera will have a ball head, to allow you to move it easily and lock it in place before you take an image. It is very important that the sensor is stable (and the image is clear and not blurred) before you take an image.
- When recording images, start the recording program, then press spacebar to record each image. The calibration pattern should be detected (indicated by color lines overlayed on the calibration pattern), and the image should be clear and stable.
- It is recommended to take images that show the calibration pattern in all areas of the image, and with different orientations of the pattern (tilting the pattern relative to the plane of the image), and at least two distances. So you can easily reach 100 images per calibration set.
- We normally start at a short distance, where the calibration pattern covers most of the image, there we take several pictures tilting the calibration pattern vertically, then horizontally. Imagine a ray coming out of the camera sensor, this makes sure that you have images where the calibration pattern is not perpendicular to that ray.
- Then we move the calibration pattern further away, and for different orientations (tilting) of the pattern, we take many images so that we calibration pattern is present around most of the camera image. For example, at first the calibration pattern is on the left upper corner. Then on the next image on the upper middle, then on the upper right corner. Then some images where the calibration pattern is in the middle vertically, etc...
Detailed steps:
- Change
record_images.launch
andcamera_calibration.launch
files to match the topic of the camera and parameters of the checkerboard choosen - If you haven't already, start the camera
- Record images for the camera:
roslaunch opencv_camera_calibration record_imgs.launch
- Calibrate the intrinsics and extrinsics parameters:
roslaunch opencv_camera_calibration camera_calibration.launch
- Copy the data into the chosen camera .yaml file
- Restart the camera