Aiming at the problem of UAV three-dimensional trajectory planning in complex power detection environment,a novel unmanned aerial vehicle three-dimensional flight path planning method based on jumping and adaptive pin-hole imaging opposition-based learning rat swarm optimizer(JAPRSO)was proposed.JAPRSO algorithm introduced Sobol sequence initial-ization population to enhance population diversity.A nonlinear adaptive factor was introduced to dynamically balance local devel-opment and global search capabilities.In order to avoid the algorithm falling into local optimum,the jumping attacked prey mechanism is embedded.In order to improve the global optimization capability of the algorithm,a jumpy and adaptive pin-hole imaging opposition-based learning mechanism is introduced into hunting prey behavior.The simulation results show that the per-formance of the proposed method is better than RSO algorithm,the Gray Wolf Optimization(GWO)algorithm,Tuna Swarm Op-timization(TSO)algorithm and Seagull Optimization Algorithm(SOA),meanwhile,the proposed method can effectively avoid threat area,safe and feasible to get the track is least costly fast track,and it can be applied to solve complex unmanned aerial ve-hicle three-dimensional path planning problem for power detection.