## 3 Results and Discussion
This lack of smoothness led to inaccuracies in segmenting the target objects, as the rough edges could either include or exclude adjacent areas incorrectly. Opposing this, the segmentation output from the YOLO models showed smoother boundaries, where the edges were more consistent and less jagged, which indicated that the YOLO models could delineate objects with higher precision (Figure 4). Smoother segmentation resulted in a more accurate representation of the objects' shapes and sizes, which is critical for tasks requiring precise volume estimation, such as in agricultural applications for yield prediction. The confusion matrices for depth-based and RGB-based segmentation revealed the performance of the YOLOv8 and Detectron2 frameworks, highlighting the strengths and weaknesses of each approach (Figures 6 and 7). Depth-based segmentation outperformed RGB-based methods, achieving higher true positive (TP) and true negative (TN) rates (Figure 6). For depth-based segmentation, Detectron2 achieved TP = 3,725,692 and TN = 7,357,565, while YOLOv8n-seg recorded TP = 3,751,174 and TN = 7,193,692. YOLOv8n-seg also showed fewer false positives (FP = 77,158) and false negatives (FN = 344,376) compared to Detectron2 (FP = 102,640, FN = 180,503). This accuracy, combined with YOLOv8n-seg's faster processing time (18.10 ms vs. Detectron2's 57.67 ms), highlights its suitability for real-time agricultural applications. In contrast, RGB-based segmentation performed worse, with increased error rates (Figure 7). Detectron2 achieved TP = 3,206,732 and TN = 6,438,264, while YOLOv8n-seg achieved higher values of TP = 3,477,835 and TN = 6,949,937. However, both frameworks recorded significantly higher false positives and false negatives, with Detectron2 at FP = 426,944 and FN = 680,060 and YOLOv8n-seg at FP = 350,497 and FN = 588,131. The lack of depth information and lens distortions (up to \(-20.43\%\)) further hindered RGB-based segmentation. While YOLOv8n-seg processed images faster (28.42 ms vs. Detectron2\({}^{\prime}\)s 95.68 ms), RGB segmentation remained inadequate for precision tasks in the 3D space. Based on both the quantitative and qualitative analyses, YOLOv8n-seg is recommended as a general segmentation solution for real-time applications using ToF imagery. However, for performance in the RGB domain specifically, the Detectron2 ResNet50 model is recommended for its IoU (0.785) and MCC (0.815). In real-time applications, the YOLOv8n-seg model is recommended for both mediums, with a significantly lower processing time (depth: 18.10 ms, RGB: 28.42 ms) and no significant difference in accuracy metrics (IoU: 0.944 and MCC: 0.957). YOLOv8 outperforms Detectron2 due to fundamental architectural differences. YOLOv8 employs a single-stage design, directly predicting segmentation outputs from feature maps without relying on a region proposal network (RPN). This streamlined approach reduces computational overhead and processing time while maintaining high accuracy. In contrast, Detectron2's two-stage architecture, which uses an RPN and separate steps for detection and segmentation, introduces additional latency and increases computational complexity. YOLOv8 further benefits from adaptive anchor-free mechanisms and dynamic loss weighting, enabling the better handling of irregularly shaped objects and varying scales, such as those found in the context of wild blueberries. Its optimized convolutional layers and attention mechanisms produce smoother segmentation boundaries and reduce errors, as observed in the qualitative analysis. Detectron2, while robust, relies heavily on its FPN for multi-scale feature aggregation, which adds to its processing time and limits real-time applicability. The results highlighted the unique strength of leveraging 2D neural network frameworks for depth map segmentation as a novel methodology for addressing 3D segmentation challenges.