Abstract:When towing for rescue in certain hazardous environments, it is difficult for rescue personnel to approach. Rescue personnel can use remote control to operate the trailer bar to complete the installation of the trailer hook. This paper proposes a trailer hook detection and positioning method ECSA-YOLOv5 for rescue vehicles. Firstly, the YOLOv5 algorithm is improved by designing an efficient attention module ECSA, which replaces the module on the previous layer of the spatial pyramid pooling module. Additionally, a small object detection layer of 160×160 is added to obtain the pixel coordinates of the trailer hook in the image more accurately; By incorporating guided filtering in the preprocessing stage of the SGBM stereo matching algorithm and introducing weighted least squares (WLS) filtering and outlier handling in the post-processing stage, a more optimized disparity map can be obtained, resulting in more accurate target depth information and improving the accuracy of trailer hook position information calculation. Experimental verification was conducted based on the Jetson Agx Xavier development board, and the results showed that the ECSA-YOLOv5 model improved the AP value by 5.8% compared to the YOLOv5s model, reaching 99.0%. The average realtime detection frame rate was 14 fps, and when the positioning distance was within 3 meters, the error was below 3.5%, which can meet the accuracy and real-time requirements of trailer hook detection and positioning.