Unmanned aerial vehicle obstacle avoidance method and device based on linear target perception, equipment and medium

CN122776845APending Publication Date: 2026-09-18HANGZHOU HAOLINK INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610925118.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-25
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

[0011]鉴于以上内容,有必要提供一种基于线状目标感知的无人机避障方法、装置、设备及介质,旨在解决无人机巡检过程中无法对线状目标进行有效检测及避障的问题

Benefits of technology

[0016]As can be seen from the above technical solutions, this invention can enhance the image to be processed through a directional ridge enhancement filter, making the ridges more obvious; it can extract features from the line enhancement map using a multi-scale linear feature extraction network, which can simultaneously capture the global structure of long lines and ultra-fine local details; it can perform global correlation enhancement processing on the intermediate feature map using a Transformer network, which can improve the continuity of line segments and reduce discontinuities and jitter; it adopts a multi-modal fusion localization mechanism, which identifies the endpoints of line segments and their corresponding fusion confidence based on the line enhancement map and heat map, and can effectively eliminate false targets and improve localization accuracy through the fusion of vision and depth; it performs sub-pixel level continuity restoration and 3D line segment reconstruction based on the endpoints of line segments and fusion confidence, which can solve the problem of discontinuous and abrupt visual detection, which cannot form stable line segments that can be used for obstacle avoidance; it generates an obstacle avoidance strategy based on dynamic safety distance and obstacle avoidance priority, enabling the UAV to safely avoid the identified linear obstacles and avoid entanglement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122776845A_ABST
    Figure CN122776845A_ABST
Patent Text Reader

Abstract

This invention relates to the field of intelligent control technology for unmanned aerial vehicles (UAVs), providing a method, apparatus, device, and medium for UAV obstacle avoidance based on linear target perception. It enhances the image by using a directional ridge enhancement filter to make ridges more prominent; utilizes a multi-scale linear feature extraction network for feature extraction, simultaneously capturing the global structure of long lines and ultra-fine local details; employs a Transformer network for global correlation enhancement, improving line segment continuity and reducing discontinuities and jitter; a multi-modal fusion positioning mechanism effectively eliminates false targets through the fusion of vision and depth, improving positioning accuracy; and solves the problem of discontinuous and abrupt visual detection, which prevents the formation of stable line segments suitable for obstacle avoidance, by performing sub-pixel-level continuity recovery and 3D line segment reconstruction. Finally, it generates obstacle avoidance strategies based on dynamic safety distance and obstacle avoidance priorities, enabling the UAV to safely avoid identified linear obstacles and prevent entanglement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent control technology for unmanned aerial vehicles (UAVs), and in particular to a method, apparatus, device, and medium for UAV obstacle avoidance based on linear target perception. Background Technology

[0002] In current drone inspection scenarios, the industry generally adopts the following technical approaches: (1) Traditional visual detection scheme based on RGB (Red Green Blue) cameras: Convolutional Neural Network (CNN) and object detection network (such as YOLO (You Only LookOnce) and RetinaNet) are used to identify linear objects in the inspection images. This method mainly relies on image texture, contrast and geometric features to achieve detection.

[0003] (2) Obstacle detection scheme based on depth camera or lightweight lidar: Obtain surrounding point cloud data by using a ToF (Time of Flight) camera (a three-dimensional imaging camera that obtains depth information through the time-of-flight ranging principle) or a lightweight lidar with less than 16 lines (Light Detection and Ranging, LiDAR), and perform spatial modeling and distance estimation for larger obstacles as the basis for obstacle avoidance.

[0004] (3) Simple visual-depth information fusion scheme: adopt rule-based logic (such as visual detection confidence threshold combined with depth consistency verification) to achieve basic fusion, which is used to reduce false detection or provide auxiliary judgment for obstacle avoidance.

[0005] (4) Obstacle avoidance control strategy based on fixed threshold: the obstacle avoidance method is triggered by distance threshold, that is, when the distance to the obstacle is less than the set threshold (such as 1.2m), the obstacle is decelerated, bypassed or hovered.

[0006] While the above solutions can work in general inspection scenarios, they still have the following technical shortcomings for small-sized linear targets with extremely fine textures, weak textures, and extremely low pixel ratios: (1) Small linear targets are difficult to detect visually: When observing from a distance, small linear targets such as wires occupy only 1-3 pixels in the image. Weak texture, complex background, backlight, and insufficient exposure will make the detection almost fail. However, the mainstream detection network has not optimized the features for the ridge structure, resulting in a high false negative rate, unstable detection, and it cannot be used for safe obstacle avoidance.

[0007] (2) Depth sensors can hardly detect thin line targets: The diameter of thin line targets such as wires is usually 8–25 mm, which is much smaller than the diameter of the laser beam. The return point of the lidar is almost zero, and the depth map has a large noise, which makes it impossible to construct the three-dimensional position of the linear obstacle through the point cloud.

[0008] (3) Multimodal information is difficult to fuse: General fusion algorithms cannot utilize the continuity, directionality, and weak texture of small linear targets, resulting in unstable fusion results and large fluctuations in confidence.

[0009] (4) The detection results of linear targets change drastically in consecutive frames: position jitter, many breakpoints, and inability to maintain topological continuity, resulting in discontinuous 3D modeling and making the obstacle avoidance algorithm unable to make stable decisions.

[0010] (5) Traditional obstacle avoidance strategies cannot be applied to linear obstacles: fixed threshold obstacle avoidance cannot be dynamically adjusted in combination with conditions such as speed, wind disturbance, and target direction. Moreover, linear obstacles have a very small cross-sectional area, which makes them even more dangerous. As a result, there are still accidents involving tangled wires during UAV inspections, which restricts the development of unmanned inspections. Summary of the Invention

[0011] In view of the above, it is necessary to provide a method, device, equipment and medium for UAV obstacle avoidance based on linear target perception, which aims to solve the problem that UAVs cannot effectively detect and avoid linear targets during inspection.

[0012] A UAV obstacle avoidance method based on linear target perception, the method comprising: In response to an obstacle avoidance command triggered by the target drone, the system acquires the image to be processed, which is collected in real time by the target drone. The image to be processed is enhanced by a directional ridge enhancement filter to obtain a line-enhanced image; A multi-scale linear feature extraction network is used to extract features from the line enhancement map to obtain an intermediate feature map; The intermediate feature map is subjected to global correlation enhancement processing using a Transformer network to obtain a fused feature map. The fused feature map is input into the detection head to obtain a heat map; A multimodal fusion localization mechanism is adopted to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map; Based on the endpoints of the line segments and the fusion confidence level, subpixel-level continuity restoration and 3D line segment reconstruction are performed to obtain a linear target; Calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

[0013] A drone obstacle avoidance device based on linear target perception, the drone obstacle avoidance device based on linear target perception includes: The acquisition unit is used to acquire the image to be processed in real time collected by the target drone in response to the obstacle avoidance command triggered by the target drone; An enhancement unit is used to enhance the image to be processed through a directional ridge enhancement filter to obtain a line-enhanced image; An extraction unit is used to extract features from the line enhancement map using a multi-scale linear feature extraction network to obtain an intermediate feature map. The enhancement unit is further configured to perform global correlation enhancement processing on the intermediate feature map using a Transformer network to obtain a fused feature map; The input unit is used to input the fused feature map into the detection head to obtain a heat map; The identification unit is used to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map using a multimodal fusion localization mechanism. The reconstruction unit is used to perform sub-pixel-level continuity restoration and three-dimensional line segment reconstruction based on the endpoints of the line segments and the fusion confidence level to obtain a linear target; The obstacle avoidance unit is used to calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and to generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

[0014] A computer device, the computer device comprising: A memory for storing at least one instruction; and a processor for executing the instructions stored in the memory to implement the UAV obstacle avoidance method based on linear target perception.

[0015] A computer-readable storage medium storing at least one instruction, which is executed by a processor in a computer device to implement the UAV obstacle avoidance method based on linear target perception.

[0016] As can be seen from the above technical solutions, this invention can enhance the image to be processed through a directional ridge enhancement filter, making the ridges more obvious; it can extract features from the line enhancement map using a multi-scale linear feature extraction network, which can simultaneously capture the global structure of long lines and ultra-fine local details; it can perform global correlation enhancement processing on the intermediate feature map using a Transformer network, which can improve the continuity of line segments and reduce discontinuities and jitter; it adopts a multi-modal fusion localization mechanism, which identifies the endpoints of line segments and their corresponding fusion confidence based on the line enhancement map and heat map, and can effectively eliminate false targets and improve localization accuracy through the fusion of vision and depth; it performs sub-pixel level continuity restoration and 3D line segment reconstruction based on the endpoints of line segments and fusion confidence, which can solve the problem of discontinuous and abrupt visual detection, which cannot form stable line segments that can be used for obstacle avoidance; it generates an obstacle avoidance strategy based on dynamic safety distance and obstacle avoidance priority, enabling the UAV to safely avoid the identified linear obstacles and avoid entanglement. Attached Figure Description

[0017] Figure 1 This is a flowchart of a preferred embodiment of the UAV obstacle avoidance method based on linear target perception of the present invention.

[0018] Figure 2 This is a functional block diagram of a preferred embodiment of the UAV obstacle avoidance device based on linear target perception of the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of a computer device that implements a preferred embodiment of the UAV obstacle avoidance method based on linear target perception according to the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] like Figure 1 The diagram shown is a flowchart of a preferred embodiment of the UAV obstacle avoidance method based on linear target perception according to the present invention. The order of the steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements.

[0022] The UAV obstacle avoidance method based on linear target perception is applied to one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0023] The computer device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smartphone, personal digital assistant (PDA), interactive network television (IPTV), smart wearable device, etc.

[0024] The computer equipment may also include network equipment and / or user equipment. The network equipment includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.

[0025] The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0026] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0027] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0028] The network in which the computer device is located includes, but is not limited to, the Internet, wide area network, metropolitan area network, local area network, and virtual private network (VPN).

[0029] S10, in response to an obstacle avoidance command triggered by the target drone, acquire the image to be processed collected in real time by the target drone.

[0030] In this embodiment, the target drone can be used for security inspection.

[0031] In this embodiment, the obstacle avoidance command can be automatically triggered when the target drone starts up, so as to realize the full detection of the target drone's operation process.

[0032] In this embodiment, the image to be processed can be a high-resolution RGB (Red, Green, Blue) image captured by the target drone, such as a 4K (3840×2160) resolution image with a frame rate of 30–60fps.

[0033] In this embodiment, since the linear target is only 1-3 pixels wide in the image, it is difficult to see with the naked eye. Therefore, preprocessing is necessary to enhance the presence of the line.

[0034] Specifically, after acquiring the image to be processed collected in real time by the target UAV, the method further includes: The image to be processed is subjected to brightness normalization processing to obtain a brightness normalized image; Calculate the mean brightness of the brightness-normalized image; Adaptive gamma correction is performed on the pixel values ​​of the brightness-normalized image based on the mean brightness. Wherein, when the average brightness value is greater than the high brightness threshold, the gamma value is adjusted to be less than 1; or When the average brightness value is greater than or equal to the low brightness threshold and less than or equal to the high brightness threshold, the gamma value is adjusted to 1; or When the average brightness value is less than the low brightness threshold, the gamma value is adjusted to be greater than 1.

[0035] For example, the following formula can be used to normalize the brightness of the image to be processed: I′=(I-μ) / σ; Where I′ represents the brightness value after brightness normalization (or the normalized image matrix), that is, the output image after subtracting the mean and dividing by the standard deviation; I represents the brightness value of the image to be processed (or the pixel value matrix of the image to be processed); μ represents the mean of the image to be processed; σ represents the standard deviation of the image to be processed.

[0036] Among them, the high brightness threshold and low brightness threshold are thresholds for judging the brightness of the image, and can be configured according to actual processing needs.

[0037] By performing the above brightness normalization process, the brightness distribution can be unified, the brightness difference of the image under different lighting conditions can be eliminated, and the influence of lighting factors can be reduced. This is equivalent to allowing the model to focus only on the structure and not on the light intensity.

[0038] By performing adaptive gamma correction, bright images can be darkened and highlights reduced, while dark images can be brightened and shadow details enhanced. For example, power lines are often placed against a backlit background (such as in front of the sky). By performing adaptive gamma correction, the details of the originally pure white sky can be brought out, making the power lines stand out more.

[0039] S11, the image to be processed is enhanced by a Directional Ridge Filter (DRF) to obtain a line-enhanced image.

[0040] In this embodiment, since the linear structure is directional, it is necessary to detect ridge features from multiple directions. Furthermore, since the linear structure is only 1–3 pixels wide, it is necessary to enhance it to make it more visible in the image.

[0041] Specifically, the enhancement process of the image to be processed using a directional ridge enhancement filter to obtain a line-enhanced image includes: Obtain the configured sampling angle and filter kernel; For each sampling angle, the filter kernel is projected onto a two-dimensional image space to generate a directional filter aligned with each sampling angle; The image to be processed is convolved using a directional filter aligned with each sampling angle to obtain a response map for each direction; For each pixel in the image to be processed, the maximum pixel value corresponding to that pixel is obtained from the response map in each direction as the strongest ridge response corresponding to that pixel; The line enhancement map is obtained by integrating the strongest ridge responses of all pixels in the image to be processed.

[0042] Since the line direction has a 180° periodicity, 0° is equivalent to 180°. Therefore, sampling up to 165° can cover all directions. That is, the sampling angle can be configured as {0°, 15°, ..., 165°}. The 15° step size is an optimal trade-off between directional resolution and real-time computational load. In actual use, it can also be replaced with step sizes such as 10° or 22.5° depending on the computing power and accuracy requirements.

[0043] To enhance the brightness abrupt changes on both sides of the 1-3 pixel wide ridge, the filter core can be configured as a one-dimensional second-order differential high-pass kernel [1,-2,1]. The one-dimensional second-order differential high-pass kernel [1,-2,1] can be used to detect brightness changes. When the filtering direction is consistent with the direction of the wire, the enhancement of the wire is strongest, thereby amplifying the edge signal of the linear target, enhancing the edge of the linear target by 2-5 times, and making the linear target in the final output line enhancement map darker or brighter and more prominent.

[0044] The computational complexity is low and the directional response is clear under the one-dimensional second-order difference high-pass kernel [1,-2,1], making it suitable for airborne real-time enhancement of thin lines. Of course, in other embodiments, depending on the actual operational requirements, second-order Gaussian derivatives, Hessian matrices, Frangi filters, and other ridge kernels can also be used.

[0045] The above embodiments can significantly enhance the detection of extremely small linear targets, making them easier to detect in subsequent steps.

[0046] S12, use a multi-scale linear feature network (MLFN) to extract features from the line enhancement map to obtain an intermediate feature map.

[0047] In this embodiment, the multi-scale linear feature extraction network includes a long line segment shape extraction branch, a local texture extraction branch, and a sub-pixel detail extraction branch; the long line segment shape extraction branch is composed of convolutional layers and dilated convolutional layers, the local texture extraction branch is composed of stacked convolutional layers, and the sub-pixel detail extraction branch is composed of sub-pixel convolutional layers and directional convolutional layers.

[0048] Among them, the long line segment shape extraction branch is a large receptive field used to extract the shape of long line segments.

[0049] For example, the convolutional layer of the long line segment shape extraction branch can be a convolution with a kernel size of 7×7, and the dilation rate of the dilated convolutional layer of the long line segment shape extraction branch is 4 to increase the receptive field. The long line segment shape extraction branch enables linear targets such as wires to penetrate the image. Although the number of pixels is small, the overall direction is clear; this branch can "see further areas" and capture the overall direction of the line.

[0050] The local texture extraction branch is a mesoscale branch used to extract local textures.

[0051] For example, the local texture extraction branch can be a 3×3 convolution × 4-layer stack. Although the texture of linear targets such as wires is weak, the gradient between their edges and the background still exists, and their local features can be extracted through the local texture extraction branch.

[0052] The subpixel detail extraction branch operates on subpixel details and can be used to recover line details.

[0053] For example, the subpixel detail extraction branch can include subpixel convolution (to improve feature map resolution and restore the details of ultra-fine structures such as wires), and alternating directional convolutions of 1×3 (to enhance the response of horizontal linear structures) and 3×1 (to enhance the response of vertical linear structures). Small linear targets are represented by only a few pixels and may be "invisible" to the model itself. Subpixel convolution can amplify features and restore finer structures, while directional convolution can better identify slender shapes.

[0054] In this embodiment, the step of using a multi-scale linear feature extraction network to extract features from the line enhancement map to obtain an intermediate feature map includes: The long line segment morphology extraction branch is used to capture the overall direction of the long line segment in the line enhancement map to obtain a large receptive field feature map; The local edge gradient in the line enhancement map is extracted using the local texture extraction branch to obtain a mesoscale texture feature map; The subpixel detail extraction branch is used to extract detail features from the line enhancement map to obtain a subpixel detail feature map; The large receptive field feature map, the medium-scale texture feature map, and the sub-pixel detail feature map are fused to obtain the intermediate feature map.

[0055] Before extracting features from the line enhancement image using a multi-scale linear feature extraction network, the line enhancement image needs to be expanded in channels to match the number of channels in subsequent convolutional layers. For example, if the line enhancement image is a single-channel grayscale image, it can be copied to a 3-channel image or expanded to a 64-channel feature image through a 1×1 convolution; if the line enhancement image is a multi-channel image, it can be directly input.

[0056] Among them, the three-branch features can be fused by channel splicing or weighted summation, so that the fused intermediate feature map contains three types of information: global direction, local gradient and sub-pixel details, providing multi-dimensional linear features for subsequent Transformer modeling.

[0057] It should be noted that the above branch structure parameters are the preferred engineering configurations. For example, 7×7 and dilation=4 can expand the receptive field without significantly increasing the downsampling loss, which is beneficial for capturing long straight line trends; 3×3×4 layers are used to stably extract local edge textures and have a low number of parameters; 1×3 and 3×1 directional convolutions match the anisotropic morphology of linear targets, which can enhance slender structures and reduce background noise response.

[0058] In actual engineering implementation, the above parameters can be replaced within a reasonable range according to camera resolution, line width and pixel count, onboard computing power and real-time requirements.

[0059] S13, the intermediate feature map is subjected to global correlation enhancement processing using the Transformer network to obtain the fused feature map.

[0060] In this embodiment, the preferred parameter configuration of the Transformer network is a 4-layer encoder with a multi-head attention head=8. This parameter configuration can balance the ability to associate long-distance line segments with the overhead of onboard real-time inference (too few layers result in insufficient long-distance continuity, while too many layers increase computation and latency).

[0061] In actual engineering implementation, the above parameters can also be replaced with ranges such as 2-6 floors or 4-12 heads.

[0062] Because convolutional neural networks only consider local areas, they struggle to understand that "pixels on the left and pixels on the right belong to the same line." Furthermore, since Transformer networks excel at modeling long-distance dependencies, they can identify that "points A and B are hundreds of pixels apart but have the same direction and brightness, and are likely to belong to the same line." Therefore, this embodiment uses a Transformer network to model cross-regional continuity of linear feature tokens to enhance "cross-regional line segment continuity" and allow the model to understand that "the lines are connected."

[0063] S14, the fused feature map is input to the detection head to obtain a heat map.

[0064] In this embodiment, the detection head may include two parallel branches: a classification head and a regression head.

[0065] The classification head can be a 1×1 convolution with a sigmoid activation function, used to output the heatmap.

[0066] The heatmap value range is [0,1], which represents the probability that each pixel belongs to the center of a line segment. The larger the value, the more likely it is to be the location of a line segment.

[0067] The regression head can be a 1×1 convolution + hyperbolic tangent function Tanh / linear normalization, used to output sub-pixel offsets.

[0068] The subpixel offset value range is dx,dy∈[-0.5,0.5], which represents the subpixel offset of the line segment center relative to the current pixel center, that is, the possible offset of the line segment center within the pixel (because the line is too thin, it will not fall completely in the pixel center).

[0069] During training, the classification head can use binary cross-entropy or focus loss, while the regression head can use L1 or Smooth L1 loss.

[0070] Through the above processing, the positioning accuracy of line segments can be improved to the level of 0.1–0.5 pixels.

[0071] S15, a multimodal fusion localization mechanism is adopted to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map.

[0072] Because linear targets such as power lines are too thin, lidar is prone to missing its target, while visual positioning is easily affected by background interference. Therefore, a "visual-guided depth sensor" is needed to achieve high-precision 3D positioning.

[0073] Specifically, the multimodal fusion localization mechanism, which identifies line segment endpoints and corresponding fusion confidence levels based on the line enhancement map and the heatmap, includes: A first candidate point set is constructed by obtaining the corresponding pixel points whose output probability of the detection head is greater than the probability threshold from the heat map, and the depth value corresponding to each first candidate point in the first candidate point set is extracted from the depth map corresponding to the image to be processed. Calculate the absolute difference in depth values ​​between adjacent first candidate points, and remove first candidate points from the first candidate point set whose absolute difference is greater than or equal to the depth difference threshold to obtain a second candidate point set. Along the visual direction, the second candidate point set is expanded outwards and backwards according to a preset step size, and a quadratic curve equation is obtained by fitting a quadratic curve based on all the endpoints of the line segments obtained after the expansion. A preset number of discrete parameter points are sampled within a preset parameter range, and the discrete parameter points are substituted into the quadratic curve equation to calculate dense interpolation points. The dense interpolation point increments are added to the second candidate point set to obtain the third candidate point set; Construct a multimodal feature vector for each third candidate point in the set of third candidate points; wherein, the multimodal feature vector includes the heatmap of the corresponding pixel, the gradient of the corresponding pixel in the line enhancement map, the depth change, and the point cloud density; The graph convolutional network (GCN) is used to learn the relationship between various multimodal feature vectors, and the endpoints of the line segment and their corresponding fusion confidence scores are obtained.

[0074] For example, a first set of candidate points can be constructed by obtaining high-confidence points with a detection head output probability greater than 0.3 from the heat map.

[0075] The depth difference threshold can be configured to [0.05m, 0.20m]. Removing first candidate points from the first candidate point set whose absolute difference is greater than or equal to the depth difference threshold can eliminate abnormal points with abrupt depth changes and filter out background noise and pseudo-line segments. For example, a power line cannot exhibit abrupt depth changes; its depth should be approximately constant. If the depth change is abnormal, it indicates that the point may not be a power line (e.g., sky noise, leaves, etc.). The aforementioned depth consistency processing can filter out a large number of false lines.

[0076] Visual positioning can provide direction, but it has limited depth data. Therefore, interpolation is needed to increase the amount of data and make subsequent obstacle avoidance calculations more reliable.

[0077] For example, the line segment can be expanded outwards by 5–20 cm at both ends, based on the visual direction (i.e., the camera's optical axis), to supplement the point cloud at the endpoints. Furthermore, based on the points obtained after expansion, a quadratic polynomial is used for curve fitting (when the point cloud is insufficient for modeling, fitting yields a smoother and more stable curve): p(t) = at 2 +bt+c. Where a, b, and c are the fitting coefficients of the quadratic curve, and t is the normalization parameter, t∈[-0.3,0.3], used to control the interpolation interval. Within the parameter t∈[-0.3,0.3] interval, 50–200 discrete parameter points ti are uniformly sampled (50–200 interpolation points are the preferred range, which can be adjusted according to the line segment length and accuracy requirements; the longer the line segment and the higher the accuracy requirement, the more interpolation points are needed). Each ti is substituted into the fitted quadratic curve equation to calculate the corresponding three-dimensional coordinates, which are then used as dense interpolation points to improve three-dimensional continuity.

[0078] The multimodal feature vector can be represented as: F = [H, gradient(R), depth_var, point_density]; where F represents the multimodal feature vector; H represents the heatmap of the corresponding pixel, i.e., the output probability of the detector head; gradient(R) represents the gradient of the corresponding pixel in the line augmentation map, which is the edge or response change feature obtained by calculating the spatial gradient of the line augmentation map, used to assist GCN in determining whether candidate points belong to real continuous linear targets; depth_var represents the depth change; and point_density represents the point cloud density. The feature vector of each point integrates visual, depth, and 3D structural information, providing multi-dimensional judgment criteria for subsequent graph convolution.

[0079] Each third candidate point can be used as a node in the graph, and an adjacency relationship is constructed for each node (for each node, its nearest neighbor is found; if the distance between nodes is less than a set threshold, an edge is established between them), thus establishing a topological graph structure. Further, the constructed topological graph structure is input into a 3-layer graph convolutional network: the first layer aggregates the features of each node and its neighboring nodes, extracts local feature patterns, and initially distinguishes between wire points and noise points; the second layer further aggregates information from a wider neighborhood, models connectivity over longer distances, and strengthens the recognition of continuous line segments; the third layer performs a nonlinear transformation on the fused features, outputting the final feature vector for each node. Furthermore, the node features output by the 3-layer graph convolutional network can be mapped to a final confidence score through a fully connected layer and a sigmoid activation function, serving as the fusion confidence score C∈[0,1]. A larger C indicates a higher likelihood of a real wire, allowing points with high fusion confidence (e.g., greater than a certain threshold) to be used as line segment endpoints, and their fusion confidence scores are recorded simultaneously.

[0080] Graph convolutional networks can learn the relationships between features and understand the connectivity between points, making them suitable for handling linear structures.

[0081] In the above embodiments, since depth sensors are not good at detecting fine lines, effective 3D reconstruction is achieved by using visual guidance to guide depth.

[0082] S16, perform sub-pixel level continuity restoration and three-dimensional line segment reconstruction based on the endpoints of the line segments and the fusion confidence level to obtain a linear target.

[0083] In this embodiment, due to the discontinuous and abrupt nature of visual detection, stable line segments that can be used for obstacle avoidance cannot be formed. Therefore, it is necessary to ensure that the identified line segments form complete and continuous curves to avoid discontinuous detection, which is meaningless for obstacle avoidance.

[0084] Specifically, the step of performing sub-pixel-level continuity restoration and 3D line segment reconstruction based on the line segment endpoints and the fusion confidence to obtain the linear target includes: A line segment topology connection graph is constructed using the endpoints of the line segments as graph nodes; wherein, the endpoint distance between the two endpoints of each edge in the line segment topology connection graph is less than a preset pixel, and the direction difference is less than a preset degree; The continuity score of each pair of edges is calculated based on the endpoint distance and direction difference between each pair of endpoints in the line segment topology connection diagram. Edges with continuity scores greater than a score threshold are obtained from the line segment topology graph and are considered as edges with connectivity relationships. Using the fusion confidence as weight, weighted least squares fitting is performed on the graph nodes corresponding to the edges with connectivity to obtain the linear target.

[0085] For example, wires don't suddenly turn 90°; the change in direction should be smooth. Therefore, when the distance between the endpoints of two line segments is less than 5 pixels and the direction difference is less than 15°, it means that the endpoints of the two line segments meet the candidate edge conditions, and candidate edges can be established in the topology graph. Using the topology graph as the connection rule is the most crucial step in avoiding breaks.

[0086] For example, the continuity score for each pair of edges can be calculated using the following formula: S = α·cos(Δθ) + β·exp(-d / σ); where S represents the continuity score; α and β represent adjustable weights, α = β = 0.5; θ represents the principal orientation angle of the line segment in the image plane or local coordinate system; Δθ represents the difference in orientation angles between two candidate line segments (i.e., two edges), used to measure orientation consistency; d represents the spatial distance or image distance between the connecting endpoints of two candidate line segments, used to measure the breakpoint interval; σ = 3px, which is a constant.

[0087] cos(Δθ) is used to constrain that the more consistent the directions of two line segments, the more likely they are to be connected; exp(-d / σ) is used to constrain that the closer the endpoints are, the more likely they are to be connected.

[0088] The more consistent the directions and the closer the endpoints, the higher the continuity score. Therefore, when the continuity score of two edges is greater than 0.65, the line segments are considered connected, and the line segments corresponding to the two edges belong to the same line, which can effectively solve the visually caused discontinuity.

[0089] For example, the fusion confidence score represents the confidence level of a true linear target after comprehensively judging multimodal features such as visual heatmap, line enhancement response, depth variation, and point cloud density. If used for curve fitting, the fusion confidence score can be used as the weight in weighted least squares; if used for the entire line, the mean, maximum, or weighted mean of the fusion confidence scores of multiple points on the line segment can be taken as the line-level confidence score. Points with high confidence scores have a greater impact on the curve, which can prevent noise from being mistakenly identified as line segments.

[0090] After fitting, a continuous curve is output, with a length of 300–1000px and high smoothness.

[0091] Through the above embodiments, the final generated curve is smooth and continuous, and can be used for flight control obstacle avoidance.

[0092] S17, calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

[0093] In this embodiment, calculating the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and generating an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority, includes: The product of the speed coefficient and the current speed of the target UAV is used as the first value; the product of the wind disturbance coefficient and the current wind disturbance is used as the second value; and the sum of the basic safety distance, the first value, and the second value is used as the dynamic safety distance. The target confidence of the linear target is calculated based on the fusion confidence of each line segment endpoint corresponding to the linear target. The reciprocal of the shortest distance between the current position of the target UAV and the linear target is calculated, and the product of the target confidence and the reciprocal is used as the obstacle avoidance priority. When the obstacle avoidance priority is greater than a preset threshold, or the shortest distance is less than the dynamic safety distance, the line direction vector and vertical direction vector of the linear target are subjected to cross product normalization to obtain the lateral movement direction vector perpendicular to the linear target. The lateral displacement distance is determined based on the dynamic safety distance; Starting from the current position, move the lateral displacement distance based on the lateral displacement direction vector to obtain the lateral displacement point; Obtain the configured route recovery points, and connect the starting point, the lateral shift point and the route recovery points in sequence using cubic spline curves to obtain the obstacle avoidance path; The target UAV is controlled to avoid the linear target according to the obstacle avoidance path.

[0094] The speed coefficient is used to reflect the impact of the UAV speed on the required safe distance. It can be understood as a speed safety margin coefficient, and its value range can be configured to be 0.3–0.6.

[0095] The wind disturbance term coefficient is used to reflect the impact of wind disturbance on the increase in safety distance, and its value range can be configured to be 0.2–0.5.

[0096] The range of values ​​for the velocity term coefficient and the wind disturbance term coefficient can be determined by flight braking distance, attitude disturbance experiments and safety margin calibration, or can be adjusted comprehensively according to the aircraft type, load and controller response capability.

[0097] The basic safety distance can be configured to range from 1.0m to 1.8m.

[0098] The faster the drone travels, the longer the braking distance, and wind disturbances affect flight attitude, requiring a larger margin. Therefore, this embodiment calculates the dynamic safety distance by combining drone speed and wind disturbances, enabling more intelligent obstacle avoidance.

[0099] The target confidence of the linear target can be the mean, maximum or median of the fused confidence of each line segment endpoint.

[0100] In practice, the shortest distance can be calculated by adding the reciprocal of a preset value, or the reciprocal of the distance can be normalized to avoid division by zero and to ensure that the priority score falls within a range that is easy to determine the threshold.

[0101] In this context, a higher target confidence level indicates a more reliable line segment detection; a closer distance indicates a greater danger. Therefore, when the obstacle avoidance priority exceeds the set threshold of 0.8, obstacle avoidance must be performed. This is equivalent to an obstacle avoidance action being executed immediately if the detection is reliable and the distance is dangerous.

[0102] After performing cross product normalization on the line direction vector and vertical direction vector of the linear target, the side that is farthest from the line and deviates the least from the original route can be selected as the lateral displacement direction vector perpendicular to the linear target (because power lines are usually very long, moving along the line direction is not very meaningful, while going around the line segment in the vertical direction is the shortest and safest path).

[0103] The lateral displacement distance (which can be 0.5m–1.2m) can also be determined by combining dynamic safety distance, shortest distance, speed and risk level.

[0104] The system uses the current position, lateral shift point, and route recovery point as path control points. After generating a smooth, continuous flight path with continuous velocity and acceleration using cubic splines (to avoid flight jitter), it can also perform collision checks on the generated path. If the path still intersects with the safety corridor, the lateral shift distance is increased or the lateral shift point is reselected to improve the safety of the final obstacle avoidance path.

[0105] The above embodiments enable drones to perform real-time, dynamic, and safe obstacle avoidance based on 3D linear targets, allowing drones to safely avoid identified linear obstacles and prevent entanglement.

[0106] As can be seen from the above technical solutions, this invention can enhance the image to be processed through a directional ridge enhancement filter, making the ridges more obvious; it can extract features from the line enhancement map using a multi-scale linear feature extraction network, which can simultaneously capture the global structure of long lines and ultra-fine local details; it can perform global correlation enhancement processing on the intermediate feature map using a Transformer network, which can improve the continuity of line segments and reduce discontinuities and jitter; it adopts a multi-modal fusion localization mechanism, which identifies the endpoints of line segments and their corresponding fusion confidence based on the line enhancement map and heat map, and can effectively eliminate false targets and improve localization accuracy through the fusion of vision and depth; it performs sub-pixel level continuity restoration and 3D line segment reconstruction based on the endpoints of line segments and fusion confidence, which can solve the problem of discontinuous and abrupt visual detection, which cannot form stable line segments that can be used for obstacle avoidance; it generates an obstacle avoidance strategy based on dynamic safety distance and obstacle avoidance priority, enabling the UAV to safely avoid the identified linear obstacles and avoid entanglement.

[0107] like Figure 2 The diagram shown is a functional block diagram of a preferred embodiment of the UAV obstacle avoidance device based on linear target perception according to the present invention. The UAV obstacle avoidance device 11 based on linear target perception includes an acquisition unit 110, an enhancement unit 111, an extraction unit 112, an input unit 113, a recognition unit 114, a reconstruction unit 115, and an obstacle avoidance unit 116. The module / unit referred to in this invention is a series of computer program segments that can be executed by a processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0108] The acquisition unit 110 is used to acquire the image to be processed in real time collected by the target drone in response to the obstacle avoidance command triggered by the target drone. The enhancement unit 111 is used to enhance the image to be processed through a directional ridge enhancement filter to obtain a line-enhanced image; The extraction unit 112 is used to extract features from the line enhancement map using a multi-scale linear feature extraction network to obtain an intermediate feature map. The enhancement unit 111 is further configured to perform global association enhancement processing on the intermediate feature map using a Transformer network to obtain a fused feature map; The input unit 113 is used to input the fused feature map to the detection head to obtain a heat map; The identification unit 114 is used to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map using a multimodal fusion localization mechanism. The reconstruction unit 115 is used to perform sub-pixel level continuity restoration and three-dimensional line segment reconstruction based on the line segment endpoints and the fusion confidence level to obtain a linear target; The obstacle avoidance unit 116 is used to calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and to generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

[0109] As can be seen from the above technical solutions, this invention can enhance the image to be processed through a directional ridge enhancement filter, making the ridges more obvious; it can extract features from the line enhancement map using a multi-scale linear feature extraction network, which can simultaneously capture the global structure of long lines and ultra-fine local details; it can perform global correlation enhancement processing on the intermediate feature map using a Transformer network, which can improve the continuity of line segments and reduce discontinuities and jitter; it adopts a multi-modal fusion localization mechanism, which identifies the endpoints of line segments and their corresponding fusion confidence based on the line enhancement map and heat map, and can effectively eliminate false targets and improve localization accuracy through the fusion of vision and depth; it performs sub-pixel level continuity restoration and 3D line segment reconstruction based on the endpoints of line segments and fusion confidence, which can solve the problem of discontinuous and abrupt visual detection, which cannot form stable line segments that can be used for obstacle avoidance; it generates an obstacle avoidance strategy based on dynamic safety distance and obstacle avoidance priority, enabling the UAV to safely avoid the identified linear obstacles and avoid entanglement.

[0110] like Figure 3 The diagram shown is a schematic representation of the computer device used to implement a preferred embodiment of the UAV obstacle avoidance method based on linear target perception according to the present invention.

[0111] The computer device 1 may include a memory 12, a processor 13, and a bus (the arrow in the figure represents the bus), and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a drone obstacle avoidance program based on linear target perception.

[0112] Those skilled in the art will understand that the schematic diagram is merely an example of computer device 1 and does not constitute a limitation on computer device 1. Computer device 1 can be either a bus topology or a star topology. Computer device 1 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, computer device 1 may also include input / output devices, network access devices, etc.

[0113] It should be noted that the computer device 1 described is merely an example. Other existing or future electronic products that are adaptable to this invention should also be included within the scope of protection of this invention and are incorporated herein by reference.

[0114] The memory 12 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the computer device 1, such as a portable hard drive of the computer device 1. In other embodiments, the memory 12 can be an external storage device of the computer device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the computer device 1. Furthermore, the memory 12 can include both internal and external storage units of the computer device 1. The memory 12 can be used not only to store application software and various types of data installed on the computer device 1, such as code for a drone obstacle avoidance program based on linear target perception, but also to temporarily store data that has been output or will be output.

[0115] In some embodiments, the processor 13 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 13 is the control unit of the computer device 1, connecting various components of the computer device 1 via various interfaces and lines. It executes programs or modules stored in the memory 12 (e.g., executing a drone obstacle avoidance program based on linear target perception) and calls data stored in the memory 12 to perform various functions of the computer device 1 and process data.

[0116] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes these applications to implement the steps in the various embodiments of the UAV obstacle avoidance method based on linear target perception described above, for example... Figure 1 The steps are shown.

[0117] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, which describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into an acquisition unit 110, an enhancement unit 111, an extraction unit 112, an input unit 113, a recognition unit 114, a reconstruction unit 115, and an obstacle avoidance unit 116.

[0118] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute portions of the UAV obstacle avoidance method based on linear target perception described in various embodiments of the present invention.

[0119] If the modules / units integrated in the computer device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware devices. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above.

[0120] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.

[0121] Furthermore, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.

[0122] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0123] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, in... Figure 3 The bus is represented by only one straight line, but this does not mean that there is only one bus or one type of bus. The bus is configured to enable communication between the memory 12 and at least one processor 13, etc.

[0124] Although not shown, the computer device 1 may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to the at least one processor 13 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The computer device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0125] Furthermore, the computer device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the computer device 1 and other computer devices.

[0126] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the computer device 1 and to display a visual user interface.

[0127] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0128] It will be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0129] Combination Figure 1 The memory 12 in the computer device 1 stores multiple instructions to implement a UAV obstacle avoidance method based on linear target perception, and the processor 13 can execute the multiple instructions to achieve the following: In response to an obstacle avoidance command triggered by the target drone, the system acquires the image to be processed, which is collected in real time by the target drone. The image to be processed is enhanced by a directional ridge enhancement filter to obtain a line-enhanced image; A multi-scale linear feature extraction network is used to extract features from the line enhancement map to obtain an intermediate feature map; The intermediate feature map is subjected to global correlation enhancement processing using a Transformer network to obtain a fused feature map. The fused feature map is input into the detection head to obtain a heat map; A multimodal fusion localization mechanism is adopted to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map; Based on the endpoints of the line segments and the fusion confidence level, subpixel-level continuity restoration and 3D line segment reconstruction are performed to obtain a linear target; Calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

[0130] Specifically, the processor 13's implementation method for the above instructions can be found in [reference needed]. Figure 1The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0131] It should be noted that all the data involved in this case was legally obtained.

[0132] If any AI models, software tools, or components not belonging to this company appear in the embodiments of this invention, they are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this invention has been obtained by an entity authorized (with the knowledge and consent) or fully authorized by all parties through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0133] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0134] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0135] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0136] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0137] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0138] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0139] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in this invention can also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A UAV obstacle avoidance method based on linear target perception, characterized in that, The UAV obstacle avoidance method based on linear target perception includes: In response to an obstacle avoidance command triggered by the target drone, the system acquires the image to be processed, which is collected in real time by the target drone. The image to be processed is enhanced by a directional ridge enhancement filter to obtain a line-enhanced image; A multi-scale linear feature extraction network is used to extract features from the line enhancement map to obtain an intermediate feature map; The intermediate feature map is subjected to global correlation enhancement processing using a Transformer network to obtain a fused feature map. The fused feature map is input into the detection head to obtain a heat map; A multimodal fusion localization mechanism is adopted to identify the endpoints of line segments and their corresponding fusion confidence levels based on the line enhancement map and the heat map; Based on the endpoints of the line segments and the fusion confidence level, subpixel-level continuity restoration and 3D line segment reconstruction are performed to obtain a linear target; Calculate the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and generate an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority.

2. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, After acquiring the image to be processed in real time collected by the target UAV, the method further includes: The image to be processed is subjected to brightness normalization processing to obtain a brightness normalized image; Calculate the mean brightness of the brightness-normalized image; Adaptive gamma correction is performed on the pixel values ​​of the brightness-normalized image based on the mean brightness. Wherein, when the average brightness value is greater than the high brightness threshold, the gamma value is adjusted to be less than 1; or When the average brightness value is greater than or equal to the low brightness threshold and less than or equal to the high brightness threshold, the gamma value is adjusted to 1; or When the average brightness value is less than the low brightness threshold, the gamma value is adjusted to be greater than 1.

3. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, The enhancement process of the image to be processed using a directional ridge enhancement filter to obtain a line-enhanced image includes: Obtain the configured sampling angle and filter kernel; For each sampling angle, the filter kernel is projected onto a two-dimensional image space to generate a directional filter aligned with each sampling angle; The image to be processed is convolved using a directional filter aligned with each sampling angle to obtain a response map for each direction; For each pixel in the image to be processed, the maximum pixel value corresponding to that pixel is obtained from the response map in each direction as the strongest ridge response corresponding to that pixel; The line enhancement map is obtained by integrating the strongest ridge responses of all pixels in the image to be processed.

4. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, The multi-scale linear feature extraction network includes a long line segment shape extraction branch, a local texture extraction branch, and a sub-pixel detail extraction branch; the long line segment shape extraction branch is composed of convolutional layers and dilated convolutional layers, the local texture extraction branch is composed of stacked convolutional layers, and the sub-pixel detail extraction branch is composed of sub-pixel convolutional layers and directional convolutional layers. The step of using a multi-scale linear feature extraction network to extract features from the line enhancement map to obtain an intermediate feature map includes: The long line segment morphology extraction branch is used to capture the overall direction of the long line segment in the line enhancement map to obtain a large receptive field feature map; The local edge gradient in the line enhancement map is extracted using the local texture extraction branch to obtain a mesoscale texture feature map; The subpixel detail extraction branch is used to extract detail features from the line enhancement map to obtain a subpixel detail feature map; The large receptive field feature map, the medium-scale texture feature map, and the sub-pixel detail feature map are fused to obtain the intermediate feature map.

5. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, The multimodal fusion localization mechanism, which identifies line segment endpoints and corresponding fusion confidence levels based on the line enhancement map and the heat map, includes: A first candidate point set is constructed by obtaining the corresponding pixel points whose output probability of the detection head is greater than the probability threshold from the heat map, and the depth value corresponding to each first candidate point in the first candidate point set is extracted from the depth map corresponding to the image to be processed. Calculate the absolute difference in depth values ​​between adjacent first candidate points, and remove first candidate points from the first candidate point set whose absolute difference is greater than or equal to the depth difference threshold to obtain a second candidate point set. Along the visual direction, the second candidate point set is expanded outwards and backwards according to a preset step size, and a quadratic curve equation is obtained by fitting a quadratic curve based on all the endpoints of the line segments obtained after the expansion. A preset number of discrete parameter points are sampled within a preset parameter range, and the discrete parameter points are substituted into the quadratic curve equation to calculate dense interpolation points. The dense interpolation point increments are added to the second candidate point set to obtain the third candidate point set; Construct a multimodal feature vector for each third candidate point in the set of third candidate points; wherein, the multimodal feature vector includes the heatmap of the corresponding pixel, the gradient of the corresponding pixel in the line enhancement map, the depth change, and the point cloud density; By using a graph convolutional network to learn the relationship between various multimodal feature vectors, the endpoints of the line segment and their corresponding fusion confidence scores are obtained.

6. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, The step of performing sub-pixel-level continuity restoration and 3D line segment reconstruction based on the line segment endpoints and the fusion confidence level to obtain a linear target includes: A line segment topology connection graph is constructed using the endpoints of the line segments as graph nodes; wherein, the endpoint distance between the two endpoints of each edge in the line segment topology connection graph is less than a preset pixel, and the direction difference is less than a preset degree; The continuity score of each pair of edges is calculated based on the endpoint distance and direction difference between each pair of endpoints in the line segment topology connection diagram. Edges with continuity scores greater than a score threshold are obtained from the line segment topology graph and are considered as edges with connectivity relationships. Using the fusion confidence as weight, weighted least squares fitting is performed on the graph nodes corresponding to the edges with connectivity to obtain the linear target.

7. The UAV obstacle avoidance method based on linear target perception as described in claim 1, characterized in that, The calculation of the dynamic safe distance and obstacle avoidance priority between the target UAV and the linear target, and the generation of an obstacle avoidance strategy based on the dynamic safe distance and the obstacle avoidance priority, includes: The product of the speed coefficient and the current speed of the target UAV is used as the first value; the product of the wind disturbance coefficient and the current wind disturbance is used as the second value; and the sum of the basic safety distance, the first value, and the second value is used as the dynamic safety distance. The target confidence of the linear target is calculated based on the fusion confidence of each line segment endpoint corresponding to the linear target. The reciprocal of the shortest distance between the current position of the target UAV and the linear target is calculated, and the product of the target confidence and the reciprocal is used as the obstacle avoidance priority. When the obstacle avoidance priority is greater than a preset threshold, or the shortest distance is less than the dynamic safety distance, the line direction vector and vertical direction vector of the linear target are subjected to cross product normalization to obtain the lateral movement direction vector perpendicular to the linear target. The lateral displacement distance is determined based on the dynamic safety distance; Starting from the current position, move the lateral displacement distance based on the lateral displacement direction vector to obtain the lateral displacement point; Obtain the configured route recovery points, and connect the starting point, the lateral shift point and the route recovery points in sequence using cubic spline curves to obtain the obstacle avoidance path; The target UAV is controlled to avoid the linear target according to the obstacle avoidance path.

8. A drone obstacle avoidance device based on linear target perception, characterized in that, The method is applied to the UAV obstacle avoidance method based on linear target perception as described in any one of claims 1 to 7.

9. A computer device, characterized in that, The computer device includes: A memory for storing at least one instruction; and a processor for executing the instructions stored in the memory to implement the UAV obstacle avoidance method based on linear target perception as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, which is executed by a processor in a computer device to implement the UAV obstacle avoidance method based on linear target perception as described in any one of claims 1 to 7.