Abstract:Aiming to address the challenges of joint crop-row and weed localization in ultra-large-scale UAV orthophotos of sugarcane fields, where fragmented weed morphology, inter-row interference, and accumulated angular errors over long distances often lead to unstable segmentation and row extraction offsets, a localization method integrating CANESNet semantic segmentation with cascaded RANSAC-based linear regression was proposed. CANESNet adopted a dual-branch encoder combining Segformer and MobileNetV3, with DCNv4 and a UNet-style multi-level decoder introduced to enhance continuous crop-row representation and fine weed-boundary recovery. Based on the segmentation masks, crop-row feature points were extracted and grouped using rotational projection, followed by two-stage RANSAC fitting to merge cross-regional row segments and suppress cumulative fitting errors. Experimental results showed that CANESNet achieved mPA, mIoU, Acc, and F1 values of 91.21%, 85.50%, 96.68%, and 94.49%, respectively, with an inference speed of 52.79 f/s. For the weed category, the IoU, PA, and precision reached 61.52%, 81.19%, and 71.75%, respectively. The cascaded RANSAC method achieved a crop-row extraction success rate of 92.65%, with an average positional deviation of 0.013 m and an average angular deviation of 0.074°. These results indicated that the proposed method can stably extract sugarcane crop-row centerlines and localize weed areas without manually presetting the number of crop rows, providing reliable environmental perception support for navigation-line generation and precision weeding operations in sugarcane fields.