Abstract:In order to solve the problem of limited field of view during ship berthing and achieve the visualization of berthing distance, a berthing distance perception method based on UAV vision is proposed. First, the UAV is used to collect the berthing video of the ship, and the EMA mechanism is added on the basis of the YOLOv8 segmentation model to achieve the fine segmentation of the ship edges. Next, the berth line is extracted by the regional growth algorithm and the Hough line detection. Finally, the closest distance calculation model is used to convert ships and berths into three-dimensional world coordinate system, and the closest distance between ships and berths is searched. The experimental results show that the accuracy of the algorithm after adding the EMA attention mechanism can reach 92.3% of the segmentation accuracy, and the error of the closest distance between the ship and the berth is less than 0.1m. This method can not only monitor the environment around the berthing ship, but also achieve the visualization of the distance between the ship and the berth, which has a good application prospect in berthing operation.