## 3 Methodology
### LiDAR-Camera Object Distance Extraction
#### 3.3.1 Complete Region Depth Extraction  
This CoRDE extracts depth values from within the bounding box and segmentation mask. It has two primary stages. Initially, all pixel values within the bounding box and segmentation mask are extracted from the transparent Sparse Depth Image. Next, the minimum pixel intensity value is then identified, as smaller depth values signify proximity  
Figure 4: Bounding box output from YOLOv8 shown for each object.  
Figure 5: Segmentation mask output from YOLOv8 shown for each object.  
to objects. The minimal intensity value is thereafter correlated to its respective distance by a predetermined normalization function.  
The bounding box (bbox) is a rectangular area surrounding the detected object. It is typically provided by object detection models and has been defined by four coordinates. \(x_{\text{min}}\), \(x_{\text{max}}\), \(y_{\text{min}}\), and \(y_{\text{max}}\) represent the left, right, upper, and lower bounds, respectively. Every pixel within this rectangle is regarded as belonging to the object.  
\[Bbox=\{(x,y)\mid x_{\text{min}}\leq x\leq x_{\text{max}},\quad y_{\text{min}} \leq y\leq y_{\text{max}}\} \tag{5}\]  
The pixel coordinates of the bounding box frame generated by the object detection method are located on the transparent Sparse Depth Image (\(I(x,y)\)). Then, the depth values in this frame are subsequently extracted. Each extracted pixel value contains a depth value.  
\[D_{\text{Bbox}}=\{I(x,y)\mid(x,y)\in Bbox\} \tag{6}\]  
To determine the actual distance to the object from the depth data, the predetermined normalization function is employed, and the minimal depth within the bounding box is computed using Equation (7).  
\[d_{\text{min}}^{\text{Bbox}}=\min_{(x,y)\in Bbox}I(x,y) \tag{7}\]  
The transparent Sparse Depth Image (shown in Figure 3a) and the RGB image (as shown in Figure 3b) have been fused as inputs for the Complete Region Depth Extraction. The output image displays the depth value points for each object, as illustrated in Figure 6.  
A segmentation mask (SegMask) is a classification map that is presented pixel-by-pixel, determining which pixels are associated with the item. The shape of the object that it offers is more precise than that of a bounding box. The segmentation mask is represented as follows:  
\[SegMask(x,y)=\begin{cases}1,&\text{if $(x,y)$ is part of the object}\\ 0,&\text{otherwise}\end{cases} \tag{8}\]  
The segmentation mask with \((x,y)\) coordinates in the shape of a polygon is provided by the semantic object detection method. The mask, called SegMask, is a frame line containing the object. Polygon coordinates are found in the transparent Sparse Depth Image (\(I(x,y)\)). After that, the pixel points contained within the polygon are extracted from the transparent Sparse Depth Image. Each extracted pixel has a depth value that corresponds to it.  
\[D_{\text{SegMask}}=\{I(x,y)\mid SegMask(x,y)=1\} \tag{9}\]  
Figure 6: Depth value points for each object in Complete Region Depth Extraction (CoRDE) result using the bounding box.  
A predefined normalization function is used to estimate the distance from the depth data to the object. Since each pixel extracted from the segmentation mask area belongs to the object, Equation (10) is utilized to calculate the estimated distance.  
\[d_{\min}^{\text{SepMask}}=\min_{(x,y)\in D_{\text{SegMask}}}I(x,y) \tag{10}\]  
The depth values of each object are fused with the semantic segmentation results of the object detection method with the transparent Sparse Depth Image. In Figure 7, the extracted pixel points are colored to provide better clarity and comprehension.  
Table 2 shows that the bounding box provides a rectangular shape, which may include background pixels, whereas the segmentation mask offers the exact shape of the object, reducing background noise.  
As a result, the segmentation mask provides more precise depth values by focusing only on the object's pixels, while the bounding box may introduce inaccuracies due to the inclusion of pixels at varying depths.