## 2 Three-Dimensional Object Segmentation and Labeling Algorithm
### Distance Connected Component Algorithm
\) and \(SA=\left\{(u,v)\ |-R\leq u,v\leq R\right\}\) is the search set and \(R\) is an integer that determines the search area. Then, ground edge contour removal is performed to avoid improper merging of edge contours in places where the object is in contact with the ground. First, the V-disparity method [35] is used to produce a projection map of the calculated disparity values of all edge pixels, as shown in Figure 4a, where the d-axis represents the change in disparity value and the v-axis represents the vertical coordinate of the image. The V-disparity map summarizes the change in disparity value of edge pixels in each row along the v-axis. If there is an edge contour of the ground, there will be a distribution of oblique line segments  
Figure 3: Stereovision diagram. on the V-disparity map. Then, the Hough Transform [36] is used to analyze whether there are oblique line segments in the V-disparity map. If there are oblique line segments, the edge pixels distributed in this area are deleted. The red line shown in Figure 4b is the longest oblique line segment detected. Figure 4c is the edge image after the ground is removed, and the edge contours of some objects in contact with the ground (e.g., a car tire, signal pole, and telegraph pole base) are also filtered out. Although there will be a small error in the height measurement of the object, the reduction of these edge contours does not affect the subsequent object segmentation. Finally, distance object labeling is performed. Each edge pixel is considered as the center pixel in the order of raster-scan and determines whether there are adjacent edge pixels in four adjacent positions, that is, the left, upper left, upper, and upper right of the center pixel. If there is no adjacent edge pixel or the absolute value of the difference in distance between the center pixel and all adjacent edge pixels is greater than the preset distance threshold (_TH_dis_), a new label number is assigned to the center pixel and records it in the object-label array. If the absolute value of the difference in distance between the center pixel and adjacent edge pixel is less than or equal to _TH_dis_, the adjacent edge pixel with the smallest absolute value of the difference in distance to the center pixel is considered as the reference point, assign the same label number to the center pixel and the reference point, calculate the absolute value of the difference in distance between this reference point and other adjacent edge pixels, and change the label number of adjacent edge pixels with a distance less than or equal to _TH_dis_ to the same label number as the reference point. During distance object labeling, the object-label array is used to store the label number and connection relationship of each object. When the label number of the adjacent edge pixel is modified, different objects are connected. Therefore, the object-label array is updated simultaneously to ensure that each object is connected correctly. The setting of the distance threshold, _TH_dis_, is automatically adjusted. Based on the parameters provided by KITTI (the relevant parameters will be explained in detail in the experimental results section), the change in the disparity value of one pixel at a distance of approximately 5 m and 20 m is converted to a distance change of 7 cm and 113 cm, respectively. This shows that the same disparity change has different resolutions at different distances. If the continuity of the disparity is directly used to determine the connection of adjacent pixels, the discontinuity of the disparity value of adjacent pixels  
Figure 4: Ground edge contour removal. (**a**) V-disparity map; (**b**) Distribution of the ground edges; (**c**) Edge image after removing the ground edge contour. will lead to misjudgment of the connection at close range. Therefore, this paper proposes an equation to automatically set the distance threshold. The _TH_dis_ is set based on the parameters related to the camera system.