DOI: 10.3390/app16157730 ISSN: 2076-3417

Constrained Boundary Enhancement for SAM 2-Based Ship Segmentation in UAV Berthing and Unberthing Videos

Chenzheng Yang, Shenhua Yang, Pu Wang, Weijun Wang, Zeyang Huang

UAV-based ship segmentation is important for berthing and unberthing monitoring, ship–berth distance estimation, and situational awareness in port waters. However, direct video mask propagation with Segment Anything Model 2 (SAM 2) remains susceptible to local contour degradation in high-resolution UAV videos containing weak berth-side boundaries, adjacent tugboats, quay-side structures, water-surface reflections, and target-scale variations. To address this problem, a constrained local boundary refinement method is proposed for target-ship segmentation. The method follows a training-free, first-frame-mask-initialized semi-supervised video object segmentation setting, with all SAM 2 parameters remaining frozen. ROI Boundary Re-Inference first enhances weak contours within local target neighborhoods. Prompt-Consensus Refinement then retains boundary candidates consistently supported by multiple structured prompt variants. Finally, Boundary-Constrained Non-Erosive Fusion restricts supplementation to a narrow neighborhood of the propagated boundary and incorporates reliable candidates without deleting the original foreground. Experiments on a self-built UAV berthing and unberthing video dataset show that the proposed method improves Boundary F@5 px from 89.68% to 94.03% and J&F from 94.08% to 96.39%. These results demonstrate that the proposed method improves target-ship boundary delineation without model training or fine-tuning.

More from our Archive