Binocular camera to calculate dense depth point cloud (2)

Binocular camera calculates dense depth point cloud


Following the previous article, we used real cameras to calculate 3D point clouds. In the experiment, we used ZED cameras.

1. ZED camera driver package

First of all, we need to install the driver package of the ZED camera on the computer. Here we only install the driver package of the CPU version, read the left and right images, and the driver package address [1]

```
cd catkin_ws/src
git clone https://github.com/transcendrobotics/zed_cpu_ros
cd ..
catkin_make
```

After the ZED camera is started correctly, we need to calibrate the internal and external parameters of the camera. The calibration values ​​at the factory are also provided on the ZED official website. You can download the file with the corresponding number through the serial number on the camera, but I feel that it is not accurate. , So it’s better to calibrate it yourself.
Note: When we use it here, the ZED camera is set to a resolution of 1280*720 (the value of the resolution parameter in the zed_cpu_ros.launch file is 2).

2. Calibrate the ZED camera

Create a new file camera_calibration.launch in the launch folder in the zed_cpu_ros package and fill in the following content

<launch>

    <include file="$(find zed_cpu_ros)/launch/zed_cpu_ros.launch"/>

    <arg name="size" default="8x6"/>
    <arg name="square" default="0.108"/>
    <arg name="no-service-check" default="true"/>

    <node pkg="camera_calibration" type="cameracalibrator.py" name="camera_calibration" output="screen" args="">
        <remap from="right" to="/camera/right/image_raw"/>
        <remap from="left" to="/camera/left/image_raw"/>
    </node>

</launch>

Where size represents the length and width of the checkerboard, square represents the size of the grid, I am using an 8x6 checkerboard here, and each grid is 108mm

Next, launch the launch file to start calibrating the ZED camera

roslaunch  zed_cpu_ros camera_calibration.launch

Insert picture description here
Then move the ZED camera and wait until the CALIBRATE button on the right turns green and then click the button to calibrate.

After the calibration is completed, you can see the polar line error of this calibration, as shown in the figure below:
Insert picture description here
Generally speaking, epi<0.2 is almost the same, and epi<0.15 is considered very good.

In the calibration process, it is recommended to use a larger calibration board, and then repeat the calibration several times to compare whether the external parameters are stable in a range.

After obtaining the left and right internal and external parameters, update the calibrated parameters to the two files left.yaml and right.yaml in the zed_cpu_ros/config directory. Then set the value of the use_zed_config parameter in the zed_cpu_ros.launch file to false to let the driver node use the two files we just updated left.yaml and right.yaml.

3. Run ELAS

Then start elas_ros according to the method in the previous blog, pay attention to check the output image after stereo correction.

After starting the camera ROS driver node, pay attention to check whether the camera_info topic has output. The conditions for ELAS operation must be:
camera/left/image_raw
camera/left/camera_info
camera/right/image_raw
camera/right/camera_info

The picture below is a result of using a ZED camera outdoors. I feel that the calibration parameters of this camera still have a great influence on the output depth. Another problem is that the left and right eye images of the ZED camera are not triggered synchronously, which may also cause the depth output. Ineffective.
Insert picture description here

Reference

[1] https://github.com/transcendrobotics/zed_cpu_ros

If you think the article is helpful to you, please give me a like. O(∩_∩)O

Welcome everyone to exchange and discuss in the comment area ([email protected])

If downloading code and data is slow, you can leave a mailbox in the comment area, and you can send the code and data test package to the mailbox.

Guess you like

Origin blog.csdn.net/crp997576280/article/details/107972081