2. Calibration of camera internal reference

2.1、Code Function Description

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

2.2、Preparation before calibration

Checkerboard (calibration board)

1684900748657

2.3、Start up

2.3.1、Start the camera

Take starting the Astra pro camera as an example, after SSH connects to the car, enter in the terminal,

Start the camera before calibration, and turn off the camera until all calibrations are completed.

Obi Zhongguang camera model and the corresponding launch file:

launch filecamera model
ros2 launch astra_camera astra_pro.launch.xmlAstrapro
ros2 launch astra_camera astro_pro_plus.launch.xmlAstraproplus
ros2 launch astra_camera astra.launch.xmlAstramini

Since the car has no graphical interface, the next calibration program needs to be run in a virtual machine.

Enter following command in the virtual machine terminal.

1684891718031

The topic we need to calibrate the RGB color image is /camera/color/image_raw, and the topic used to calibrate the ir infrared image is /camera/ir/image_raw.

2.3.2、Color Image Calibration

The virtual machine installs the camera calibration function package.

Input following command in virtual machine terminal.

Input " y", press Enter to start the installation, and wait for the installation to complete.

Input following command in virtual machine terminal.

1684909551282

Collect images by moving up, down, back and forth, left and right, and turning them over, so that the [X], [Y], [Size], and [Skew] on the right turn green, as shown in the figure below, and then click [CALIBRATE] to start calculating the internal camera parameters. About 60-70 pictures.

1684909700451

After the calibration is completed, click [SAVE], as shown in the figure below.

1684909957146

The calibration result is saved to [/tmp/calibrationdata.tar.gz], and the file can be moved out to view the content.

After exiting the program, enter the following command in the virtual machine terminal.

1684911685467

We will get the calibrated png file, ost.yaml and ost.txt files in the calibrationdata_rgb folder in this directory.

Since the Astra driver loads the calibrated built-in parameters in the code when it starts, there is no need to load the calibrated parameters. In the case of [AR vision] in [opencv series courses], the internal reference of the camera will be used.

2.3.3、ir infrared calibration

Since the RGBD camera uses structured light as the depth imaging principle, the infrared light projected by it is a special disordered spot, which makes the infrared receiving device unable to receive clear and complete picture content.

At this point we can have several special processing methods:

Choose a processing method according to your needs.

Enter the following command in the virtual machine terminal.

1684910374142

In the same way, the following operation is similar to the color camera calibration, change different poses, and fill the lines under [X], [Y], [Size], and [Skew] as much as possible.

1684910952649

Click [CALIBRATE] to calculate the internal parameters of the camera, and click [SAVE], as shown below.

1684911006332

The calibration result is saved to [/tmp/calibrationdata.tar.gz], and the file can be moved out to view the content.

After exiting the program, enter the following command in the virtual machine terminal.

1684911041314

We will get the calibrated png file, ost.yaml and ost.txt files in the calibrationdata_depth folder in this directory.