1、Astra camera calibration1.1、Preparation before calibration1.2、calibration1.2.1、Color image Calibration1.2.2、Depth image calibration
Wiki:http://wiki.ros.org/camera_calibration
Official website link:https://orbbec3d.com/develop/
Astra camera:https://github.com/orbbec/ros_astra_camera
Due to the internal and external reasons of the camera, the image will be greatly distorted, mainly radial deformation and tangential deformation, which cause the straight line to become curved. The farther the pixel is from the center of the image, the more serious the distortion. In order to avoid errors caused by the data source, it is necessary to calibrate the parameters of the camera.
Disadvantages of infrared depth camera ranging:
(1) It is impossible to accurately measure the distance of a black object, because the black substance can absorb infrared rays, and the infrared rays cannot return, so the distance measurement cannot be performed.
(2) It is impossible to accurately measure the distance of the mirror-reflecting object, because only when the depth camera is on the vertical line of the mirror-surface object, the receiver can receive the reflected infrared rays, and it will cause overexposure.
(3) It is impossible to accurately measure the distance of transparent objects, because infrared rays can pass through transparent objects.
(4) It is impossible to accurately measure the distance of objects that are too close.
You need a checkerboard. This tutorial uses a 9x6 checkerboard and a 20mm square, which should be flattened during calibration.
The calibration uses the internal vertex of the checkerboard, so the "10x7" checkerboard uses the internal vertex parameter "9x6", as shown in the example below.
The calibration board of any specification can be used, just change the parameters.
An open area without obstacles and calibration board patterns
Monocular camera that publishes images via ROS
Checkerboard (calibration board)
Obi Zhongguang camera model and corresponding launch file
Launch file | Start the camera model |
---|---|
astra.launch | Astra,Astra S,Astra mini,Astra mini S |
astraplus.launch | Astra plus |
astrapro.launch | Astra pro |
embedded_s.launch | Deeyea |
dabai_u3.launch | Dabai |
gemini.launch | Gemini |
Device view
lsusb
Depth Camera ID: 2bc5:0403
Color camera ID: 2bc5:0501
The appearance of these two IDs indicates that the device is connected.
Satrt up Astra camera
xxxxxxxxxx
roslaunch astra_camera astrapro.launch
View picture topic
xxxxxxxxxx
rostopic list
Start the calibration node
xxxxxxxxxx
# Color map
rosrun camera_calibration cameracalibrator.py image:=/camera/rgb/image_raw camera:=/camera/rgb --size 9x6 --square 0.02
size: The number of internal corners of the calibrated checkerboard, such as 9X6, the corners have six rows and nine columns.
square: The side length of the checkerboard, in meters.
image and camera: Set the topic of the image released by the camera.
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's field of view
Size: the back and forth movement of the checkerboard in the camera's field of view
Skew: The tilt and rotation of the checkerboard in the camera field of view
After the startup is successful, put the checkerboard into the center of the screen and change different poses. The system will recognize it autonomously. In the best case, 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 much as possible.
Click [CALIBRATE] to calculate the camera internal parameters, the more pictures, the longer the time, just wait.
Click [SAVE] to save the uncalibrated result, the bottom line appears, click [COMMIT] to exit.
After the calibration, the calibration result is stored in [/tmp/calibrationdata.tar.gz], you can move it out to see the content
xxxxxxxxxx
sudo mv /tmp/calibrationdata.tar.gz ~
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 needs to be modified before it can be used.
-Change ost.yaml to head_camera.yaml -Change the name of camera_name: to head_camera -Move the file to ~/.ros/camera_info folder
Start the calibration node
xxxxxxxxxx
rosrun camera_calibration cameracalibrator.py image:=/camera/ir/image camera:=/camera/ir --size 9x6 --square 0.02
size: The number of internal corners of the calibrated checkerboard, such as 9X6, the corners have six rows and nine columns.
square: The side length of the checkerboard, in meters.
image and camera: Set the topic of the image released by the camera.
The calibration process is similar to color camera calibration, but the visualization of depth camera calibration is not so intuitive; it just displays the calibration result when it is recognized, and it is completely dark when it is not recognized.
xxxxxxxxxx
rqt_image_view
The following operations are similar to color camera calibration, changing different poses. The system will recognize it autonomously. In the best case, 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 much as possible. Click [CALIBRATE] to calculate the camera internal parameters, the more pictures, the longer the time, just wait.
Click [SAVE] to save the non-calibration result, the bottom line appears, click [COMMIT] to exit. After the calibration, the calibration result is stored in [/tmp/calibrationdata.tar.gz], you can move it out to see the content.
xxxxxxxxxx
sudo mv /tmp/calibrationdata.tar.gz ~
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 needs to be modified before it can be used.