1.HD camera calibration

Wiki: http://wiki.ros.org/camera_calibration

Ordinary camera: https://github.com/bosch-ros-pkg/usb_cam.git

Monocular teaching: http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration

Due to some internal and external reasons of the camera, the image will be greatly distorted, mainly radial deformation and tangential deformation, causing the straight line to become curved. The farther the pixel is from the center of the image, the more serious the distortion will be. In order to avoid errors caused by data sources, the parameters of the camera need to be calibrated. Calibration essentially uses a known and determined spatial relationship (calibration plate) to reversely deduce the inherent and real parameters of the camera (internal parameters) by analyzing the pixels of the photographed pictures.

1.1. Preparation before calibration

Checkerboard (calibration board)

image-20210907171706358

1.2. Calibration

Start camera

jetson motherboard/Raspberry Pi 4B

Raspberry Pi 5

Before running, please confirm that the large program has been permanently closed

Enter docker

Note: If there is a terminal that automatically starts docker, or there is a docker terminal that has been opened, you can directly enter the docker terminal to run the command, and there is no need to manually start docker

Start docker manually

Enter the same docker from multiple terminals

Keep the program of the previous docker terminal running and open a new terminal

Enter the following command

Enter the same docker and use the following 18870bc3dc00 to modify the ID displayed on the actual terminal.

View Image Topics

image-20210907180729802

Start calibration node

jetson motherboard/Raspberry Pi 4B

Raspberry Pi 5

Enter the same docker from multiple terminals

Keep the program of the previous docker terminal running and open a new terminal

Enter the following command

Enter the same docker and use the following 18870bc3dc00 to modify the ID displayed on the actual terminal.

size: Calibrate the number of internal corner points of the checkerboard, for example, 9X6, with a total of six rows and nine columns of corner points.

square: The side length of the checkerboard, in meters.

image and camera: Set the image topic published by the camera.

image-20210907180204879

Calibration interface

X: The left and right movement of the checkerboard in the camera field of view

Y: The checkerboard moves up and down in the camera field of view

Size: the movement of the checkerboard back and forth in the camera field of view

Skew: The tilt and rotation of the checkerboard in the camera's field of view

After successful startup, place the checkerboard in the center of the screen and change to different positions. The system will identify it independently. The best situation is that the lines under [X], [Y], [Size], and [Skew] will first change from red to yellow and then to green as the data is collected, filling them as fully as possible.

image-20210907183329713

Click [CALIBRATE] to calculate the internal parameters of the camera. The more pictures you have, the longer it will take. Just wait. (Sixty or seventy pictures are enough, too many will easily cause jamming)

image-20210907184245152

Click [SAVE] to save the non-calibration result. The bottom line appears. Click [COMMIT] to exit.

image-20210907184525814

After the calibration is completed, the calibration results are stored in [/tmp/calibrationdata.tar.gz] and can be moved out to view the contents.

After decompression, there are the image just calibrated, an ost.txt file and an ost.yaml file. The yaml file is what we need, but it still needs to be modified before it can be used.