*3.2. Experiment of Visual SLAM Based on CO-HDC*

In this paper, two sets of tests are carried out to evaluate the visual SLAM based on CO-HDC. The first set of tests is that dynamic feature points for single-frame pictures in motion and intermediate results are shown. The second set of tests is that the instance visual SLAM based on CO-HDC proposed in this paper and ORB-SLAM2 algorithms are run on the TUM RGBD public dataset. Other than this, experimental results are compared with each other.

The dataset used in this paper are rgbd\_dataset\_freiburg3\_walking\_xyz (dataset one), rgbd\_dataset\_freiburg3\_walking\_halfsphere (dataset two) and rgbd\_dataset\_ freiburg3\_walking\_static (dataset three) in the TUM dataset Dynamic Objects. This dataset contains moving people, and the camera is also in motion to evaluate the robustness of the SLAM system or motion calculations in scenes with fast-moving dynamic objects. In the dataset, the video frame rate is 30 Hz, and the sequence contains a full sensor resolution is 640 × 480. The ground real trajectory is obtained from a motion capture system of eight high speed tracking cameras.

#### 3.2.1. Feature Point Extraction and Matching after CO-HDC Instance Segmentation

A comparison between ORB-SLAM2 and the proposed visual SLAM based on CO-HDC instance segmentation is carried out. ORB-SLAM2 assumes that feature points in the scenes are static, and feature points matching is performed directly after feature points extraction. However, this may lead to pose estimation errors and map relative drifts under dynamic environments. At the same time, the proposed visual SLAM segments the dynamic objects and retains static feature points. Moreover, it performs feature points matching using static point only.

Firstly, the feature point extraction and matching in the ORB-SLAM2 algorithm are performed. The two adjacent frames in the video sequence of the dataset are randomly selected, as shown in Figure 9a,b. Figure 9c,d show the feature extraction in the ORB-SLAM2 algorithm, where some feature points fall on the human body. Then, the feature matching is shown in Figure 9e.

In the BAS-DP algorithm, parameter initialization includes the initial trial step attenuation factor *H*, step *S*, the ratio of step and whisker *C*, the number of iterations *n* and the number of parameters to be optimized *k*. Among them, the distance optimization function *f*(*x*) is shown in Formula (2). According to this formula, the function values *fl* and *fr* corresponding to the left whisker position *xl* and the right whisker position *xr* of the longicorn beetle can be calculated, and the next position *x* of the longicorn beetle can be calculated at the same time. Perform calculating function *f*(*x*) n times in total. The optimal function value corresponding to the last position *x* of the longicorn beetle is obtained as the optimal solution.

**Figure 9.** Results of feature extraction and matching based on ORB-SLAM2: (**a**) Original Figure 1; (**b**) Original Figure 2; (**c**) Feature points extracted before screening of original Figure 1; (**d**) Feature points extracted before screening of original Figure 2; (**e**) The ORB matching results of original Figures 1 and 2.

3.2.2. Using Datasets to Test the Preference of ORB-SLAM2 and Instance Visual SLAM Based on CO-HDC Algorithm

The dataset provides an automated assessment tool for visual odometer system drift and global attitude error for SLAM systems, which is divided into absolute trajectory errors (ATE) and relative pose errors (RPE). The ATE difference is used to calculate the difference between the actual values and estimated values of the camera pose of the SLAM system. The RPE is used to calculate the difference between the pose changes on the same two timestamps. Firstly, the estimated value is aligned with the real value according to the timestamp of the pose. The drift of the system is also evaluated. From Figures 11–13, the RPE of instance SLAM based on CO-HDC is much smaller than ORB-SLAM2. The amount of change in pose is calculated at the same time. From Figures 14–16, it can be concluded that the proposed SLAM performs better than ORB-SLAM2, as the ATE of the proposed SLAM is also smaller than ORB-SLAM2. In Table 5, compared with ORB-SLAM2, the Rmse of the proposed method in absolute trajectory error is about 30 times smaller and is only 0.02 m. The comparison in Tables 6 and 7 also confirms the advantages of the proposed SLAM.

**Figure 10.** Results of feature extraction and matching based on proposed SLAM: (**a**) Figure for dynamic dot culling of first frame; (**b**) Figure for dynamic dot culling of second frame; (**c**) Feature points extracted after screening of first frame; (**d**) Feature points extracted after screening of second frame; (**e**) The ORB matching results of original Figures 1 and 2 after screening.

**Figure 11.** Relative pose error of dataset one: (**a**) The relative pose error of dataset one using ORB-SLAM2; (**b**) The relative pose error of dataset one using instance SLAM based on CO-HDC.

**Figure 12.** Relative pose error of dataset two: (**a**) The relative pose error of dataset two using ORB-SLAM2; (**b**) The relative pose error of dataset two using instance SLAM based on CO-HDC.

**Figure 13.** Relative pose error of dataset three: (**a**) The relative pose error of dataset two using ORB-SLAM2; (**b**) The relative pose error of dataset two using instance SLAM based on CO-HDC.

**Figure 14.** Absolute trajectory error of dataset one: (**a**) The absolute trajectory error of dataset one using ORB-SLAM2; (**b**) The absolute trajectory error of dataset one using instance SLAM based on CO-HDC.

**Figure 15.** Absolute trajectory error of dataset two: (**a**) The absolute trajectory error of dataset two using ORB-SLAM2; (**b**) The absolute trajectory error of dataset two using instance SLAM based on CO-HDC.

**Figure 16.** Absolute trajectory error of dataset three: (**a**) The absolute trajectory error of dataset two using ORB-SLAM2; (**b**) The absolute trajectory error of dataset two using instance SLAM based on CO-HDC.


**Table 5.** Pose error representative value of dataset one.

**Table 6.** Pose error representative value of dataset two.


**Table 7.** Pose error representative value of dataset three.


The platform of this experiment is a personal laptop configured as CPU I7 7700HQ, GPU 1050TI and 16G memory. The evaluation tool is used to compare the errors of the two systems running the above two datasets.

Through the above experiments, comparing ORB-SLAM2 and instance SLAM based on CO-HDC, we can see that the performance of instance SLAM based on CO-HDC is better than traditional SLAM.
