With the continuous increase of market demand, the application of low altitude rotary wing unmanned aerial vehicles is becoming increasingly widespread, and the requirements for active obstacle avoidance ability and endurance time are also increasing. This article focuses on the active obstacle avoidance technology of drones. The panoramic camera is installed on the drone. For the collected multi camera images, the first step is to perform stitching processing. The improved SURF algorithm is used to process the overlapping defects after image stitching. Then, the image is weighted and fused using the arc function weighted fusion image stitching algorithm to remove the stitching gaps. The fused image is used as input, and the improved YOLOv8 model is used as the target recognition model. After analyzing the basic performance of the model, in order to improve the algorithm’s lightweight level, the LAD calculation rule is integrated into the algorithm. Then, the EMA attention mechanism is added to improve the model’s recognition ability for specific obstacles, and depth separable convolution is added to enhance the algorithm’s ability to extract target features. Finally, an experimental environment was established, and through simulation experiments, the method proposed in this article improved the average recognition accuracy of obstacles by 2.3% while ensuring the endurance of the drone.