A UAV visual target tracking method and system
By performing multiple scans at different sun incident angles, the gradient direction distribution matrix is constructed and the total variance parameters are calculated, and the threshold is adjusted in combination with historical data, the misjudgment problem of bridge crack detection in traditional methods is solved, and high-precision crack identification and health assessment are achieved.
Patent Information
- Application Number
- CN202510819748.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Traditional drone bridge crack detection methods are difficult to distinguish between real cracks and bridge surface stains under dynamic lighting conditions, resulting in a high misjudgment rate, affecting the accuracy and safety of bridge health assessment.
By performing multiple scans at different sun incident angles, the gradient direction distribution matrix is constructed and the total variance parameters are calculated, and the consistency threshold is adjusted in combination with historical data to achieve effective distinction between cracks and stains.
It significantly reduces the misjudgment rate, improves the accuracy and reliability of bridge crack detection, and enhances the timeliness and safety of bridge health monitoring.
Smart Images

Figure CN120339282B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image acquisition and processing, and in particular to a method and system for unmanned aerial vehicle (UAV) visual target tracking. Background Art
[0002] With the widespread application of drone technology in infrastructure inspections, vision-based target tracking has become an important tool for bridge crack detection. Traditional methods primarily rely on edge detection and feature matching in single aerial images to identify cracks, but these methods face the following technical bottlenecks in practical applications:
[0003] Traditional methods rely on artificial light sources or single natural light scans, making it difficult to overcome the overlap in grayscale features between bridge surface stains (such as leaking asphalt or moss) and actual cracks under similar lighting conditions. The visual characteristics of bridge surface cracks are easily affected by variations in the angle of incidence of the sun, and images collected over a single timeframe struggle to distinguish between actual cracks and transient shadows. The reflective characteristics of stained areas under strong midday sunlight are highly similar to the gradient of crack edges, leading to a high rate of misjudgment. Summary of the Invention
[0004] In view of the shortcomings of the existing technology, the present invention provides a method and system for unmanned aerial vehicle visual target tracking.
[0005] In order to achieve the above object, the technical solution of the present invention is as follows:
[0006] In a first aspect, the present invention discloses a method for tracking a target using a UAV visual system, comprising the following steps:
[0007] Obtain an optical image dataset containing grayscale values obtained by a drone performing a directional scan of a target bridge area within a preset time period; the preset time periods are at least three groups, and the difference in solar incidence angles between adjacent preset time periods is no less than 30°;
[0008] Performing edge detection processing on the optical image data set, extracting continuous edge regions whose length exceeds a preset threshold as candidate regions, and merging the extraction results to form a candidate region set;
[0009] For each candidate area in the candidate area set, the gradient direction angle of each pixel point in the optical image data set of each scan is calculated respectively, and a gradient direction distribution matrix corresponding to the time dimension is constructed; the gradient direction distribution matrix includes at least six direction groups and the proportion of the number of pixels in each group;
[0010] Compare the gradient direction distribution matrix obtained from each scan, calculate the variance of the pixel number ratio of each direction group one by one, and accumulate them to obtain the total variance parameter;
[0011] When the total variance parameter is less than the preset consistency threshold, the candidate area is determined to be a real crack;
[0012] Record the total variance parameter values of the areas judged as real cracks in historical detection tasks to form a variance parameter sample library;
[0013] Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is:
[0014] New threshold = original threshold × (1 + deviation rate × configurable weight coefficient);
[0015] The deviation rate is: (moving average - latest variance parameter) / moving average.
[0016] In a second aspect, the present invention further discloses a UAV visual target tracking system, which is applied with the above-mentioned UAV visual target tracking method, comprising:
[0017] A flight control module is configured to obtain an optical image dataset containing grayscale values obtained by the UAV performing a directional scan of the target bridge area within a preset time period; the preset time periods are set to at least three groups, and the difference in solar incidence angle between adjacent preset time periods is not less than 30°;
[0018] a candidate region generation module, configured to perform edge detection processing on the optical image data set, extract continuous edge regions whose length exceeds a preset threshold as candidate regions, and merge the extracted results to form a candidate region set;
[0019] a gradient modeling module, configured to calculate, for each candidate region in the candidate region set, the gradient direction angle of each pixel point in the optical image data set for each scan, and construct a gradient direction distribution matrix corresponding to the time dimension; the gradient direction distribution matrix comprising at least six direction groups and a percentage of the number of pixels in each group;
[0020] The variance calculation module is used to compare the gradient direction distribution matrix obtained in each scan, calculate the variance value of the pixel number ratio of each direction group one by one, and accumulate the total variance parameter;
[0021] A crack verification module is used to determine that the candidate area is a real crack when the total variance parameter is less than a preset consistency threshold;
[0022] Feedback calibration module, used to perform the following actions:
[0023] Record the total variance parameter values of the areas judged as real cracks in historical detection tasks to form a variance parameter sample library;
[0024] Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is:
[0025] New threshold = original threshold × (1 + deviation rate × configurable weight coefficient);
[0026] The deviation rate is: (moving average - latest variance parameter) / moving average.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] Using three scanned image data at different solar incident angles (interval ≥ 30°), the natural light source is converted into a controllable variable, and the stain interference is eliminated by comparing the gradient direction distribution in the time dimension;
[0029] Construct a gradient direction distribution matrix to quantify the directional stability characteristics of the cracks, replace single morphological parameters with variance accumulation values, and improve the interpretability of physical characteristics;
[0030] A variance parameter sample library is established, and the consistency threshold is dynamically adjusted in combination with the moving average deviation rate to achieve algorithm adaptability and solve the misjudgment problems caused by material aging and environmental fluctuations. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The disclosure of the present invention is described with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. In the drawings, the same reference numerals are used to refer to the same components. Among them:
[0032] Figure 1 is a flow chart of the method of the present invention;
[0033] Figure 2 A flowchart of the present invention for adjusting a preset consistency threshold according to changes in light intensity;
[0034] Figure 3 This is a flow chart of subsequent processing of crack detection according to the present invention;
[0035] Figure 4 This is a flowchart of priority scanning during subsequent processing of crack detection according to the present invention;
[0036] Figure 5 Flowchart of the drone of the present invention when performing directional scanning;
[0037] Figure 6 A flow chart for generating a candidate region set according to the present invention;
[0038] Figure 7 The flowchart of constructing the gradient direction distribution matrix of the present invention is as follows;
[0039] Figure 8 Graph showing the calculation process of the total variance parameter of the present invention;
[0040] Figure 9 This is a material degradation early warning flow chart of the present invention;
[0041] Figure 10 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0042] It is easy to understand that according to the technical solution of the present invention, without changing the essential spirit of the present invention, a person skilled in the art can propose a variety of interchangeable structural modes and implementation modes. Therefore, the following specific embodiments and drawings are only exemplary descriptions of the technical solution of the present invention and should not be regarded as the entire invention or as a limitation or restriction of the technical solution of the present invention.
[0043] Application Overview
[0044] Traditional bridge crack detection methods rely on optical images captured by a single natural light scan for edge detection and feature matching. This makes it difficult to overcome the problem of feature confusion between bridge surface stains and actual cracks under dynamic lighting conditions. Due to variations in solar incidence angle, the gradient directional distribution of crack edges exhibits temporal correlation. The optical properties of the stained area exhibit varying light sensitivity due to the influence of the surface material. A single scan cannot capture the gradient directional distribution characteristics under multi-angle lighting conditions, resulting in a significant increase in the false positive rate. This issue directly impacts the crack detection system's ability to suppress false alarms, reducing the credibility of maintenance decisions.
[0045] For example, during periodic inspections of the cable-stayed anchorage area of a cross-sea bridge, high-angle incident light images captured by drones at noon revealed continuous edge features in a certain area, with gradient directions concentrated between 120° and 130°. In the same area, under low-angle incident light conditions at dusk, the gradient direction of stains caused by asphalt leakage shifted to the 80° to 90° range due to specular reflection, while the gradient direction of actual concrete cracks remained in the 120° to 130° range due to geometric stability. Because traditional methods only use data from a single noon scan, they are unable to identify the gradient direction differences in the dusk scan data and incorrectly classify the stained areas as cracks.
[0046] If these issues are not addressed, differences in gradient orientation distribution under dynamic lighting conditions cannot be effectively captured and analyzed, leading to persistent false positives in the crack detection system. This not only wastes maintenance resources but also potentially obscures the true growth trend of cracks. The long-term accumulation of erroneous detection data interferes with the feature learning process of the bridge health assessment model, reducing the timeliness of structural safety warnings and increasing the risk of sudden structural failure.
[0047] When faced with the above problems, the present application first realized that there is an essential difference in the time dimension between the gradient direction distribution of real cracks and surface stains under dynamic lighting conditions. Based on the influence of changes in the angle of incidence of the sun on the stability of the geometric characteristics of the cracks, the present application proposes to establish a time series model of the gradient direction distribution through multi-period scanning, and use the directional consistency characteristics of the crack edge under different lighting conditions as a basis for distinction. In view of the defect that traditional single scanning cannot capture the time dimension characteristics, the present application establishes a variance calculation model for the gradient direction distribution matrix, constructs a discrimination index by quantifying the consistency of the multi-period directional distribution, and introduces a threshold adaptive mechanism driven by historical detection data to solve the risk of misjudgment caused by long-term changes in environmental factors.
[0048] In this regard, this application proposes:
[0049] like Figure 1 As shown, a UAV visual target tracking method includes the following steps:
[0050] An optical image dataset containing grayscale values is obtained when the drone performs a directional scan of the target bridge area within a preset time period; wherein, at least three groups of preset time periods are set, and the difference in solar incidence angles between adjacent preset time periods is not less than 30°; setting at least three groups of preset time periods and the difference in adjacent solar incidence angles is not less than 30° means that data is collected through at least three different time points, and the difference in solar incidence angles at adjacent time points is large enough. Specifically, this can be achieved by using a drone mission planning system combined with an astronomical calculation module to ensure that bridge surface image data under different lighting conditions are collected to avoid shadow interference caused by single-angle lighting.
[0051] Edge detection is performed on the optical image data set to extract continuous edge regions whose length exceeds a preset threshold as candidate regions. The extracted results are then merged to form a candidate region set.
[0052] For each candidate area in the candidate area set, the gradient direction angle of each pixel point in the optical image data set of each scan is calculated respectively, and the gradient direction distribution matrix of the corresponding time dimension is constructed; the gradient direction distribution matrix includes at least six direction groups and the proportion of the number of pixels in each group; the gradient direction distribution matrix includes at least six direction groups and the proportion of the number of pixels in each group, which means that the gradient directions of the edge pixels are grouped and statistically proportioned at fixed angle intervals. Specifically, the Sobel operator can be used to calculate the gradient direction and divide the direction into groups with a 10° interval. By quantifying the gradient distribution characteristics of different directions, the directional consistency of the crack structure is captured.
[0053] By comparing the gradient direction distribution matrix obtained from each scan, the variance value of the pixel ratio of each direction group is calculated group by group, and the total variance parameter is accumulated. The total variance parameter refers to the cumulative variance value of the pixel ratio of each direction group in multiple scans. Specifically, it can be achieved by calculating the total variance formula group by group and then summing it up. It is used to measure the fluctuation degree of the gradient direction distribution at different time points and reflect the stability of the crack edge.
[0054] When the total variance parameter is less than the preset consistency threshold, the candidate area is determined to be a real crack;
[0055] Record the total variance parameter values of the areas judged as real cracks in historical detection tasks to form a variance parameter sample library;
[0056] Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is:
[0057] New threshold = original threshold × (1 + deviation rate × configurable weight coefficient);
[0058] The deviation rate is: (moving average - latest variance parameter) / moving average.
[0059] The moving average of the variance parameter sample library refers to the dynamic calculation of the mean based on historical detection results. It can be implemented using the sliding window method or exponential smoothing method. By continuously updating the statistical benchmark, it can adapt to parameter drift caused by aging of bridge materials or environmental changes.
[0060] The core innovation of this application lies in the analysis of the stability of gradient direction distribution under different solar incidence angles in multiple time periods, combined with a dynamic threshold adjustment mechanism based on historical data feedback, which effectively overcomes the defect of traditional methods that cannot distinguish between cracks and stains or instantaneous shadows under single lighting conditions, and significantly reduces the misjudgment rate.
[0061] The working process and principle of this application are as follows:
[0062] Obtain an optical image dataset from a drone performing directional scanning of the target bridge area within a preset time period. Set at least three preset time periods, with the difference in solar incidence angle between adjacent preset time periods being no less than 30° to capture image features under varying lighting conditions. Edge detection is performed on the optical image dataset, extracting continuous edge regions with a length exceeding a preset threshold as candidate regions and merging them into a set of candidate regions. For each candidate region, the gradient direction angle of each pixel is calculated for each scan, and a gradient direction distribution matrix corresponding to the time dimension is constructed. The gradient direction distribution matrix contains at least six direction groups and the pixel count percentages for each group, representing the directional distribution of edge features. Comparing the gradient direction distribution matrices for each scan, the variance of the pixel count percentages for each direction group is calculated group by group, and the total variance parameter is accumulated to obtain a cumulative variance parameter. When the total variance parameter is less than a preset consistency threshold, the candidate region is identified as a true crack. The total variance parameter values for regions identified as true cracks in previous inspection tasks are recorded to form a sample library of variance parameters. Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is:
[0063] The new threshold = the original threshold × (1 + deviation rate × a configurable weight coefficient), where the deviation rate is (moving average - latest variance parameter) / moving average. By combining multi-period scanning and gradient direction distribution analysis with a historical data-driven threshold adaptation mechanism, we can effectively distinguish between real cracks and surface stains.
[0064] As a preferred embodiment, the solution of the present application is specifically implemented as follows: the drone performs directional scanning in the target bridge area, performing three scans at 9 am, 12 noon and 3 pm respectively, to obtain an optical image data set containing grayscale values.
[0065] The Canny edge detection algorithm is applied to the optical image dataset to extract continuous edge regions with a length of more than 5 cm as candidate regions.
[0066] For each candidate region, the Sobel operator is used to calculate the gradient direction angle of the pixel point and divide the gradient direction angle into nine direction groups at 10° intervals. A 9×3 gradient direction distribution matrix is constructed, where each column represents a scan and each row represents the percentage of pixels in a direction group.
[0067] Calculate the variance of the pixel number proportion of each direction group in the three scans and accumulate them to obtain the total variance parameter.
[0068] The preset consistency threshold is set to 0.05. When the total variance parameter is less than 0.05, the candidate area is determined to be a real crack.
[0069] The total variance parameter values of real cracks in historical detection tasks are recorded, and the moving average of the most recent 100 detections is calculated.
[0070] When the variance parameter of the latest detection task deviates from the moving average by more than 20%, the preset consistency threshold is adjusted. The weight coefficient is set to 0.5, and the new consistency threshold is calculated according to the adjustment formula.
[0071] Through the above scheme, this application realizes the effective distinction between real cracks and stains on the bridge surface under dynamic lighting conditions. By capturing the time dimension characteristics of the gradient direction distribution through multi-period scanning, the problem that a single scan is difficult to distinguish between cracks and instantaneous shadows is overcome. By utilizing the consistency characteristics of the gradient direction of real cracks under different lighting conditions, a discrimination model based on variance analysis is established, which effectively reduces the misjudgment rate of the stain area. The introduction of a threshold adaptive mechanism driven by historical data improves the system's adaptability to long-term changes in environmental factors. This method significantly improves the accuracy and reliability of bridge crack detection, providing more accurate data support for bridge structure health monitoring.
[0072] In some of the aforementioned solutions of this application, during the adjustment of the preset consistency threshold, drastic fluctuations in ambient light intensity may cause the moving average of the variance parameter sample library to not match the current detection conditions, thereby causing threshold adjustment errors. For example, when light intensity changes rapidly over a short period of time, the moving average based on historical data cannot accurately reflect the impact of the current environment on the distribution of crack gradient directions, causing the consistency threshold to be incorrectly adjusted, affecting the accuracy of crack detection.
[0073] like Figure 2 FIG. 1 is a flow chart showing how to adjust the preset consistency threshold according to changes in light intensity. The present application further proposes that adjusting the preset consistency threshold also includes:
[0074] Synchronously collect current ambient light intensity data and calculate the light intensity change rate for multiple scanning periods;
[0075] When the light intensity change rate exceeds the preset light fluctuation threshold, the threshold adjustment process is frozen and the backup consistency threshold set is enabled;
[0076] The spare consistency threshold set includes multiple sets of preset consistency thresholds bound to different light intensity intervals.
[0077] Ambient light intensity data is collected in real time by a light sensor, and the rate of change of light intensity is calculated in units of the time interval between two scans. The rate of change of light intensity is calculated as the ratio of the difference in light intensity between adjacent scanning periods to the time interval. The preset light fluctuation threshold is determined by experimental data and is used to distinguish normal light fluctuations from abnormal mutations. Each set of thresholds in the set of standby consistency thresholds is associated with a specific light intensity range. For example, the light intensity is divided into three intervals: 0-20,000 lux, 20,000-50,000 lux, and 50,000-100,000 lux, and each interval corresponds to a different preset consistency threshold. The trigger condition for the freezing threshold adjustment process is that the rate of change of light intensity for three consecutive scans exceeds the preset light fluctuation threshold.
[0078] Specifically, when a drone performs a bridge crack inspection mission, the system monitors ambient light intensity in real time. If it detects dramatic light intensity fluctuations between consecutive scans—for example, a sudden drop from 50,000 lux to 15,000 lux within 10 seconds, with a rate of change reaching 3,500 lux / s, exceeding the preset light fluctuation threshold of 2,000 lux / s—the system immediately disables the threshold adaptive adjustment mechanism based on the variance parameter sample library. At this point, the system automatically invokes a backup consistency threshold based on the current light intensity range (e.g., 15,000 lux falls within the 0-20,000 lux range). This backup threshold, trained offline by simulating crack samples under various lighting conditions, effectively avoids threshold overshoot caused by sudden environmental changes. Once the light intensity stabilizes and the rate of change falls below the preset fluctuation threshold, the system reactivates the threshold adaptive adjustment function and continues to update the moving average of the variance parameter sample library.
[0079] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0080] Synchronously collect current ambient light intensity data and calculate the rate of change of light intensity over multiple scan periods. Specifically, a light sensor can be installed on the drone to record the light intensity values at the beginning and end of each scan. The percentage change in light intensity between two consecutive scans is then calculated as the rate of change of light intensity.
[0081] When the light intensity change rate exceeds a preset light fluctuation threshold, the threshold adjustment process is frozen and the backup consistency threshold set is activated. For example, the light fluctuation threshold can be set to 20%. If the light intensity change rate exceeds 20%, the original threshold adaptive adjustment mechanism is suspended and the pre-configured backup threshold set is used instead.
[0082] The set of alternate consistency thresholds contains multiple sets of preset consistency thresholds tied to different light intensity ranges. Furthermore, light intensity can be divided into three ranges: low, medium, and high, corresponding to 0-500 lux, 500-2000 lux, and above 2000 lux, respectively. Each range is assigned a dedicated set of consistency thresholds to ensure detection stability even under drastic changes in light intensity.
[0083] Through the above-mentioned technical solution, this application can effectively address the impact of drastic changes in lighting conditions on crack detection accuracy. As a result, the results of multiple scans conducted at different times and weather conditions are more consistent and comparable. Specifically, by monitoring lighting changes in real time and activating a backup threshold mechanism, false detections and missed detections caused by sudden changes in lighting can be reduced, improving the robustness of crack identification. Furthermore, multiple pre-configured thresholds can be optimized for different light intensities, further enhancing the adaptability of detection.
[0084] In some of the above-mentioned schemes of this application, when the candidate area is determined to be a real crack, if the extension direction of the crack cannot be effectively identified, it may lead to unreasonable scanning range planning in subsequent inspection tasks, making it difficult to track the crack expansion trend, resulting in reduced inspection efficiency and potential risk of missed detection.
[0085] like Figure 3 FIG. 1 is a flowchart of subsequent processing for crack detection. The present application further proposes that after determining that a candidate area is a real crack, the following steps are also included:
[0086] Extract the direction group with the largest proportion in the gradient direction distribution matrix as the main gradient direction;
[0087] In subsequent inspection tasks, priority is given to scanning adjacent areas extending along the main gradient direction, and the scanning range is adjusted to 1.2 to 1.4 times the length of the original area;
[0088] The condition for determining whether the main gradient direction extends is that the difference between the gradient direction angles of at least two consecutive pixels detected in the adjacent area and the main gradient direction is less than 5°.
[0089] The statistical results of the gradient direction distribution matrix provide the basis for categorizing direction groups. The direction group with the largest proportion reflects the main extension trend of the crack edge. The scanning range is adjusted based on the physical characteristics of crack length expansion. The expansion factor has been experimentally verified to cover the typical increment of crack extension. The direction difference is set based on the image resolution and crack morphological characteristics to ensure the consistency of the gradient direction of adjacent pixels.
[0090] Specifically, after the crack verification module confirms the real crack, the gradient modeling module selects the direction group with the largest number of pixels from the gradient direction distribution matrix of the corresponding area. The angle range corresponding to this direction group is input into the flight control module as the main gradient direction. In subsequent inspection tasks, the flight path planning module uses the main gradient direction as a reference to generate an expanded scanning area along this direction in the spatial coordinate system. The extended length is 1.3 times the median value of the original area. During the image acquisition process, the edge detection algorithm monitors the gradient direction angles of adjacent areas in real time. When it is detected that the measured direction angles of two consecutive pixel points deviate from the main direction angle by less than 5°, the crack extension judgment is triggered. The judgment result will update the candidate area set and start a new round of gradient direction distribution matrix construction and variance calculation process to form a closed-loop control of crack tracking.
[0091] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0092] After a candidate area is determined to be a true crack, the direction group with the largest proportion in the gradient direction distribution matrix is extracted as the main gradient direction. In subsequent inspections, adjacent areas extending along the main gradient direction are prioritized, and the scanning range is adjusted to 1.3 times the length of the original area. The main gradient direction extension is determined when the gradient direction angles of at least two consecutive pixels detected in the adjacent area differ by less than 5° from the main gradient direction.
[0093] Specifically, the primary crack orientation is determined through gradient direction distribution matrix analysis. For example, if a crack's primary gradient direction is detected to be 45°, the drone will prioritize extending its scan along the 45° direction during the next inspection. The scanning range has been extended from 100 meters to 130 meters to cover the possible crack extension area.
[0094] During the scanning process, the system analyzes the gradient direction of pixels in adjacent areas in real time. If the gradient direction of at least two pixels is detected to be less than 5° from 45°, it is identified as a potential crack extension area and scanned and analyzed in detail.
[0095] Through the above-mentioned technical solution, this application can effectively improve the accuracy and efficiency of crack detection. By prioritizing scanning areas extending along the main gradient direction, the scanning time of irrelevant areas is significantly reduced. At the same time, by expanding the scanning range and setting strict judgment criteria, the ability to capture crack extension trends is improved. This method not only enables the timely detection of new cracks, but also tracks the development of existing cracks, providing important evidence for bridge maintenance.
[0096] In some of the above-mentioned schemes of the present application, the adjacent area scanning strategy extending in the main gradient direction may result in insufficient detection sensitivity when the direction of the newly added cracks deviates from the original crack direction, especially under the interference of complex surface stains, and it is impossible to accurately identify crack branches or cross cracks with different directions.
[0097] like Figure 4 The figure shows a flow chart of priority scanning during subsequent processing of crack detection. The present application further proposes that the priority scanning of adjacent areas extending along the main gradient direction includes:
[0098] Real-time monitoring of new crack detection results in the area extending along the main gradient direction;
[0099] When it is detected that the angle between the main gradient direction of the newly added crack and the original crack exceeds the preset angle tolerance, the angle interval of the direction group division is adjusted to half of the original one, and a refined gradient direction distribution matrix containing twice the number of current direction groups is generated.
[0100] The real-time monitoring process is achieved by continuously scanning the gradient direction angle data of adjacent areas. The preset angle tolerance is set to a range of 5° to 15°, and the angle interval of the direction group division is compressed from 10° to 5°, forming a refined gradient direction distribution matrix with twice the number of direction groups. The adjusted refined matrix can capture subtle directional differences. For example, when a newly detected crack direction forms a 20° angle with the original crack, the original 10° interval direction group cannot effectively distinguish the difference between the two. However, the 5° interval direction group can map the angle difference to four adjacent direction groups, improving directional resolution.
[0101] Specifically, when the direction of a newly added crack deviates from the original crack's main direction by more than a preset angular tolerance, the system automatically triggers an update mechanism for the direction grouping rules. Using the original crack's main gradient direction as a 0° reference, if a newly detected crack in an adjacent area has a main gradient direction of 22°, while the preset angular tolerance is 10°, the system adjusts the direction grouping interval from 10° to 5°, generating a refined gradient direction group with twice the number of direction groups at 5° intervals.
[0102] By increasing the number of orientation groups, the adjusted orientation matrix can classify the gradient orientation angles of newly added fractures into orientation groups ranging from 4° to 6°. This effectively distinguishes the gradient orientation characteristics of existing and newly added fractures, avoiding misidentifications due to insufficient orientation resolution. This process dynamically optimizes the orientation grouping strategy by combining historical fracture orientation data with real-time detection results, improving the accuracy of multi-angle fracture identification.
[0103] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0104] Prioritizing scanning adjacent areas along the main gradient direction includes real-time monitoring of newly detected cracks in the area along the main gradient direction. If the angle between the main gradient direction of a newly detected crack and the original crack exceeds a preset angle tolerance, the angle interval between the direction groups is adjusted to half of the original value, generating a refined gradient direction distribution matrix containing twice the number of direction groups currently in use.
[0105] Specifically, in practical applications, a preset angle tolerance can be set to 30°. When the angle between the main gradient direction of a newly added fracture and the original fracture exceeds 30°, the system automatically adjusts the original 10° direction group division angle interval to 5°. For example, the original gradient direction distribution matrix contains 18 direction groups (0°-10°, 10°-20°, ..., 170°-180°). After adjustment, a refined gradient direction distribution matrix with 36 direction groups (0°-5°, 5°-10°, 10°-15°, ..., 175°-180°) will be generated.
[0106] The system then analyzes the newly generated refined gradient direction distribution matrix and recalculates the pixel count ratios for each direction group. This allows for more precise capture of subtle changes in the crack extension direction, improving crack detection accuracy.
[0107] Through the above technical solution, the present application can dynamically adjust the accuracy of the gradient direction distribution matrix to adapt to possible directional changes during crack extension. This adaptive and refined processing mechanism improves the system's ability to identify complex crack morphologies and reduces the risk of missed detections due to sudden changes in crack direction. Furthermore, by increasing the number of direction groups only when necessary, unnecessary waste of computing resources is avoided, maintaining efficient system operation.
[0108] In some of the above-mentioned solutions of the present application, spatial positioning deviations may occur in the drone during multiple scanning processes, resulting in spatial coordinate offsets in the optical image data sets collected at different times, affecting the accuracy of constructing the gradient direction distribution matrix, and thereby reducing the reliability of crack identification.
[0109] like Figure 5 As shown, it is a flow chart of the UAV performing directional scanning; the present application further proposes that the UAV performs directional scanning of the target bridge area within a preset time period, including:
[0110] The three-dimensional spatial coordinates of the first scan are recorded by the GPS positioning device to generate reference positioning data including height values and plane coordinates;
[0111] The flight path for subsequent scans is planned based on the baseline positioning data, so that the spatial coordinate deviation of the drone during each scan is less than the preset positioning tolerance value.
[0112] The three-dimensional coordinates of the initial scan are acquired in real time using a GPS positioning device. The altitude value includes the vertical distance of the drone relative to the ground, and the plane coordinates are the latitude and longitude values converted to a Cartesian coordinate system. The baseline positioning data is stored in the drone's flight control module and serves as a reference point for subsequent path planning. The preset positioning tolerance is set based on the accuracy requirements for bridge crack detection, with a typical value of 5 cm. Deviation control is achieved by comparing the Euclidean distance between the drone's actual flight coordinates and the baseline positioning data.
[0113] Specifically, when the scanning mission is performed for the first time, the GPS positioning device synchronously collects the latitude and longitude coordinates of the drone and the altitude data measured by the barometer, and generates three-dimensional reference positioning data through coordinate conversion. Before the subsequent scanning mission is started, the flight control module reads the reference positioning data and generates a rectangular inspection path with the coordinates as the origin. The path covers the preset detection range of the target bridge area. During the flight, the current spatial coordinates of the drone are obtained in real time, and the spatial deviation value from the reference positioning data is calculated. If the deviation exceeds the positioning tolerance value, the dynamic correction mechanism of the flight path is triggered. This mechanism adjusts the flight attitude of the drone and the output power of the thrusters to return the spatial coordinate deviation to within the tolerance range. In this way, it ensures that the drone is in the same spatial position during multiple scans, eliminates the difference in image acquisition angle caused by flight path offset, and thus improves the cross-temporal consistency of the gradient direction distribution matrix.
[0114] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0115] The drone performs directional scanning of the target bridge area within a preset time period, including:
[0116] The three-dimensional spatial coordinates of the first scan are recorded by the GPS positioning device to generate reference positioning data including height values and plane coordinates;
[0117] The flight path for subsequent scans is planned based on the baseline positioning data, so that the spatial coordinate deviation of the drone during each scan is less than the preset positioning tolerance value.
[0118] Specifically, the drone first performs an initial scan of the target bridge area. During the scan, the GPS positioning device records the drone's three-dimensional spatial coordinates, including longitude, latitude, and altitude, in real time. After the scan is complete, the system processes the recorded coordinate data into baseline positioning data, which includes altitude and plane coordinate information.
[0119] The system then plans subsequent scanning flight paths based on this baseline positioning data. During each subsequent scan, the drone will closely follow the planned path and compare the deviation between its current position and the baseline position in real time. If the detected spatial coordinate deviation exceeds the preset positioning tolerance, the system will immediately perform a position correction to ensure consistent scanning positions.
[0120] Therefore, by precisely controlling the spatial position of each scan, it is possible to ensure that the image data obtained by multiple scans have a good spatial correspondence, providing a reliable data basis for subsequent image analysis and crack detection.
[0121] Through the above technical solution, this application can effectively improve the position consistency of multiple scans and reduce image deviations caused by changes in the drone's position, thereby improving the accuracy of crack detection. At the same time, flight path planning based on GPS positioning can achieve automated repeated scanning, reduce manual operation errors, and improve detection efficiency. In addition, precise position control can ensure good comparability of image data acquired at different time periods, facilitating long-term monitoring and analysis of crack changes.
[0122] In some of the above-mentioned schemes of this application, the generation of candidate areas depends on the edge detection results of a single scan, but stains and instantaneous shadows on the bridge surface may cause edge breaks, resulting in a large number of broken edges of insufficient length in the initial edge set. Directly merging the results of multiple scans is likely to introduce noise, affecting the integrity and accuracy of the candidate area set.
[0123] like Figure 6 FIG. 1 is a flowchart for generating a candidate region set. This application further proposes that the generation process of the candidate region set is as follows:
[0124] Perform Canny edge detection on the optical image data set of a single scan to generate an initial edge set;
[0125] Perform morphological closing operation on the broken edges with a length less than 20 cm in the initial edge set to form a revised edge set;
[0126] A logical OR operation is performed on the corrected edge sets of multiple scans to generate a candidate region set.
[0127] Canny edge detection uses a dual-threshold hysteresis process to retain strong edges and suppress weak ones, prioritizing edge location accuracy when generating the initial edge set. A morphological closing operation uses a rectangular structuring element with a width set to 1.5 times the minimum expected crack width. Dilation and erosion operations connect fracture edges, eliminating isolated fracture segments less than 20 cm in length. A logical OR operation overlays the corrected edge sets from multiple scans at the pixel level to ensure that valid edges detected under different lighting conditions are retained.
[0128] Specifically, due to changes in illumination or interference from stains in a single scan, local fractures may occur at the edges of cracks. While retaining the high-gradient edges of the true cracks, Canny edge detection may misjudge some fracture segments shorter than 20 cm as noise. Through morphological closing operations, the crack fracture area is pixel-expanded in the horizontal and vertical directions to fill the gaps and smooth the edge morphology, so that continuous cracks meet the merging conditions. After the corrected edge sets of multiple scans are logically ORed, the crack features of different time periods are superimposed to eliminate the missing edges caused by changes in the angle of a single scan. For example, a scan may cause local reflections on the cracks due to excessive solar incidence angles. After the closing operation connects the broken parts, the logical OR operation will retain the complete edges that are not affected by the reflections in other scans. In this way, the candidate region set takes into account both the accuracy of a single scan and the integrity of multiple time dimensions, reducing the risk of misjudgment caused by stains or shadows.
[0129] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0130] The process of generating a candidate region set includes the following steps:
[0131] First, Canny edge detection is performed on the single-scan optical image dataset. Specifically, the Canny operator is used to perform edge detection on the grayscale image to generate a binary edge image and form an initial edge set.
[0132] Secondly, the broken edges in the initial edge set with a length less than 20 cm are connected by morphological closing operations. Specifically, dilation and erosion operations are performed using the structuring element to fill the small gaps between the edges and form a revised edge set.
[0133] Finally, a logical OR operation is performed on the corrected edge sets obtained from multiple scans. Specifically, a pixel-level logical OR operation is performed on the corrected edge sets obtained in different time periods, and all detected edge information is merged to generate a candidate region set.
[0134] Through the above technical solution, this application can effectively improve the accuracy and completeness of edge detection. By connecting broken edges, the problem of edge breakage caused by image noise or lighting changes is reduced. The merging of multiple scan results further enhances the robustness of detection and reduces the potential for false detection and missed detection in a single scan. This method is particularly suitable for bridge crack detection in complex environments, and can more accurately identify potential crack areas.
[0135] In some of the above-mentioned schemes of the present application, when constructing the gradient direction distribution matrix, if the quantization accuracy of the gradient direction angle is insufficient or the grouping interval is too large, the gradient features of different surface textures will be confused, and the microscopic direction differences between real cracks and stain areas cannot be accurately distinguished, affecting the accuracy of crack discrimination.
[0136] like Figure 7 As shown in FIG, it is a flow chart for constructing a gradient direction distribution matrix; this application further proposes that the construction of a gradient direction distribution matrix corresponding to the time dimension includes:
[0137] The Sobel operator is used to calculate the gradient components of the pixel in the horizontal and vertical directions;
[0138] The gradient direction angle of each pixel is calculated based on the inverse tangent function, and the calculation result is quantized into a discrete value with an accuracy of 1°;
[0139] The gradient direction angles are divided into several direction groups at intervals of 10°, and the percentage of the number of pixels in each direction group to the total number of edge pixels is counted.
[0140] The gradient component is applied to the pixel neighborhood using the horizontal and vertical convolution kernels of the Sobel operator. The coefficient weights of the convolution kernels follow the optimal parameter configuration for edge detection. The gradient direction angle is calculated using a two-parameter inverse tangent function. The resulting floating-point value is amplified 100 times, rounded, and then reduced to an integer angle value to achieve a quantization accuracy of 1°. Direction groups are divided using a fixed angle interval mechanism, generating a direction interval every 10°. Each interval covers 10 consecutive discrete angle values. The total number of direction groups is calculated by dividing 360° by 10°.
[0141] Specifically, after the horizontal gradient component and the vertical gradient component are accurately calculated, the mathematical calculation of the gradient direction angle adopts the arctan (Gy / Gx) formula, where Gy is the vertical gradient component and Gx is the horizontal gradient component. The calculation result retains two decimal places and is converted into an integer value with 1° accuracy by rounding. The quantized angle values are assigned to the corresponding direction groups. For example, the angles of 5° to 14° are classified into the 10° direction group, and the angles of 15° to 24° are classified into the 20° direction group. The proportion of the number of pixels in each direction group is obtained by counting the ratio of the number of pixels in the group to the total number of edge pixels in the candidate area. Therefore, high-precision gradient direction quantization can effectively capture the microscopic directional characteristics of the crack edge, and the 10° interval grouping method reduces the computational complexity while retaining the directional distribution trend, avoiding statistical noise interference caused by overly fine grouping.
[0142] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0143] Constructing the gradient direction distribution matrix corresponding to the time dimension includes the following steps:
[0144] First, the Sobel operator is used to calculate the horizontal and vertical gradient components of the pixel. Specifically, for each pixel (x, y) in the image, its gradient Gx and Gy in the x and y directions are calculated respectively.
[0145] Next, the gradient angle of each pixel is calculated using the inverse tangent function and quantized into discrete values with 1° accuracy. The gradient angle θ is calculated using the formula θ = arctan(Gy / Gx), and then rounded to the nearest integer angle.
[0146] Finally, divide the gradient direction angles into several direction groups at 10° intervals and calculate the percentage of pixels in each direction group compared to the total number of edge pixels. For example, 360° can be divided into 36 direction groups, each covering a 10° angle range. For each direction group, calculate the number of pixels that fall into that group and divide it by the total number of edge pixels to obtain the percentage.
[0147] Through the above technical solution, this application can effectively extract the directional characteristics of cracks in images and quantitatively represent their distribution in different directions. This method can capture the main direction and branching of cracks, providing an important basis for subsequent crack identification and analysis. By constructing a gradient direction distribution matrix in the time dimension, it is possible to compare the changes in crack characteristics at different time points, helping to identify real cracks and eliminate false positive results caused by changes in illumination.
[0148] In some of the above-mentioned solutions of this application, the traditional method relies on a single natural light scan, resulting in the lack of accurate modeling of dynamic changes in multiple time periods in the variance calculation of the gradient direction distribution matrix, and is unable to effectively distinguish the directional distribution differences between real cracks and instantaneous shadows or moss areas in multiple scans.
[0149] like Figure 8 As shown in FIG, it is a diagram of the calculation process of the total variance parameter; the present application further proposes to calculate the variance value of the proportion of the number of pixels in each direction group by group, and the total variance parameter obtained by accumulation includes:
[0150] In a multi-scan optical image dataset, pixel number percentage data is obtained for each gradient direction group, the average of multiple percentages is calculated, and the variance value is calculated based on the average value. Finally, the variance values of each direction group are accumulated to generate a total variance parameter.
[0151] The gradient direction distribution matrix is divided into at least six direction groups, and the pixel count percentage data for each direction group is collected from three or more scans. The variance of the direction groups is calculated using the unbiased variance formula in statistics: the variance is equal to the sum of the squared differences between the percentages of each scan and the mean, divided by the number of scans minus one. The total variance parameter is obtained by linearly superimposing the variance values of all direction groups, ensuring that the variation characteristics of different direction groups are fully quantified.
[0152] Specifically, after obtaining the gradient direction distribution data of three scans, the proportion of the number of pixels corresponding to the three scans is extracted for each 10° interval direction group. For example, for the 30°-40° direction group, the proportion of this group in the three scans was 18%, 22%, and 20%, respectively. The calculated average value was 20%, and the variance value was [(18-20)²+(22-20)²+(20-20)²] / (3-1)=4. Similarly, the variance values of all direction groups were calculated item by item and superimposed to form a total variance parameter. This calculation method strengthens the judgment of the consistency of the direction distribution of data in multiple time periods by eliminating the random errors of a single scan. When the gradient direction distribution of the real crack area remains stable under different lighting conditions, its total variance parameter is significantly lower than that of the instantaneous shadow or stain area, thereby improving the discrimination accuracy of the crack verification module.
[0153] As a preferred embodiment, the solution of the present application is specifically implemented as follows: for the gradient direction distribution matrix generated for each candidate area in the candidate area set, first divide the direction groups according to 10° intervals, and each group contains scanning data of six different time periods. Perform data extraction operations on each direction group, and obtain the pixel number percentage data of the direction group from the six scanning results. Establish a two-dimensional array to store the percentage value of each group of scans, and calculate the average percentage of the six scanning data of the direction group by the arithmetic mean method. The sample variance is calculated based on the average value using an unbiased estimation formula, and the variance value of each direction group is obtained by dividing the sum of the square differences between the six scanning data and the average value by the degree of freedom. Finally, the variance values of the six direction groups are algebraically superimposed to generate a total variance parameter that characterizes the stability of the direction distribution.
[0154] Through the above technical solution, this application effectively overcomes the problem of misjudgment caused by transient shadows and reflections on bridge surfaces. By superimposing the variance of multi-period scanning data, the stability characteristics of the gradient directional distribution in the crack area can be quantified. This ensures that the gradient distribution of real cracks remains consistent even when the solar incidence angle changes, while the directional distribution of stain areas fluctuates due to light sensitivity, thereby improving the accuracy of crack detection and anti-interference capabilities.
[0155] In some of the above-mentioned schemes of the present application, when calculating the total variance parameter by the gradient direction distribution matrix, if the variance calculation is performed only based on a single scan data, the variance parameter may be unstable due to instantaneous changes in illumination or image noise, affecting the accuracy of crack judgment.
[0156] like Figure 9 As shown, it is a material degradation early warning flow chart; this application further proposes to include:
[0157] In multiple consecutive inspection tasks, the trend analysis of the total variance parameters of the same crack area is performed;
[0158] When it is detected that the growth rate of the total variance parameter exceeds a preset growth threshold, it is determined that material degradation occurs in the crack area, and a material degradation warning signal is generated.
[0159] Among them, the total variance parameter in multiple consecutive inspection tasks is obtained by periodically collecting the gradient direction distribution matrix of the same crack area and repeatedly calculating it; the preset growth threshold is set according to the variation pattern of the variance parameter before material degradation in historical data; trend analysis uses linear regression or sliding window statistical methods to calculate the rate of change of the variance parameter over time.
[0160] Specifically, in each inspection task, the total variance parameters of the identified real crack areas are recorded and stored in the historical database; by comparing the current total variance parameters with the parameter values of several past inspection tasks, the change trend curve is fitted. If the slope of the curve exceeds the preset growth threshold, it indicates that the gradient direction distribution of the crack area has shown non-uniform expansion over time, and it is inferred that the internal structure of the material has deteriorated. For example, when using the linear regression method, the growth threshold is set to 0.15 / time. When the average growth rate of the total variance parameters in three consecutive inspections reaches 0.2 / time, an early warning signal is triggered. Therefore, by dynamically monitoring the changing trend of the variance parameters, potential safety hazards of bridge materials can be identified in advance, providing a quantitative basis for maintenance decisions.
[0161] As a preferred embodiment, the solution of the present application is specifically implemented as follows: in three consecutive quarterly inspection tasks of the bridge, the total variance parameters of the crack area numbered B-12 are recorded in time series, and the moving average method is used to calculate its trend growth rate. Specifically, the total variance parameter obtained in the first inspection was 0.024, 0.031 in the second, and 0.041 in the third. Through linear regression analysis, it was found that the quarterly growth rate of the crack area reached 19.7%, exceeding the preset quarterly growth threshold of 15%. At this time, the system automatically triggers the material degradation early warning signal and marks the crack area as a red warning state in the three-dimensional bridge model. After the early warning signal is generated, the maintenance work order generation mechanism is triggered, and it is mandatory to perform special inspections before the next routine inspection.
[0162] Through the above-mentioned technical solution, this application effectively solves the problem that traditional crack detection methods are unable to dynamically monitor material performance degradation. By continuously tracking the optical characteristic stability parameters of the crack area, it is possible to promptly identify the chaotic gradient direction of the crack edge caused by the decline in material strength. This technical solution provides early warning of material degradation in bridge structural health monitoring, avoiding structural safety hazards caused by accelerated crack expansion, and reducing the probability of misinterpreting image feature changes caused by material aging as environmental interference.
[0163] In some of the aforementioned solutions, traditional methods rely on artificial light sources or single natural light scans, resulting in overlapping grayscale features between bridge surface stains and actual cracks under similar lighting conditions, leading to a high rate of misjudgment. Images collected over a single time period struggle to distinguish between actual cracks and transient shadows, and fixed consistency thresholds cannot adapt to dynamic changes in ambient light intensity, resulting in reduced crack detection accuracy.
[0164] like Figure 10 As shown, the present application further proposes a UAV visual target tracking system, including a flight control module, a candidate region generation module, a gradient modeling module, a variance calculation module, a crack verification module and a feedback calibration module.
[0165] The flight control module is used to obtain an optical image dataset of the target bridge area within at least three preset time periods, and the difference in solar incidence angle between adjacent time periods is not less than 30°.
[0166] The candidate region generation module extracts continuous edge regions through edge detection and merges them to form a set of candidate regions.
[0167] The gradient modeling module calculates the gradient direction angle of each candidate area and constructs a gradient direction distribution matrix, which contains more than six direction groups and their pixel number ratios.
[0168] The variance calculation module calculates the variance of the pixel ratios in each direction group by group, and accumulates them to obtain the total variance parameter.
[0169] The crack verification module determines the real cracks based on the comparison results of the total variance parameter and the consistency threshold.
[0170] The feedback calibration module records historical variance parameters and calculates a moving average. When the deviation of the latest detection result exceeds the preset feedback threshold, the consistency threshold is dynamically adjusted using the formula: new threshold = original threshold × (1 + deviation rate × weight coefficient). The deviation rate is calculated from the difference between the moving average and the latest variance parameter.
[0171] Specifically, the flight control module ensures image data coverage under different solar incidence angles by planning scanning tasks for multiple time periods. The candidate region generation module uses morphological closing operations to connect broken edges and reduce interference from short edges. The gradient modeling module quantifies the gradient direction angle using the Sobel operator, divides the direction groups into 10° intervals, and counts the pixel proportions of each group. The variance calculation module accumulates the variances of multiple scanning results to reflect the stability of the gradient direction distribution. The crack verification module eliminates stain interference by comparing the variance parameters with the threshold, and the feedback calibration module dynamically optimizes the threshold based on the moving average of historical data. For example, when a sudden change in ambient light intensity causes the latest variance parameters to deviate from the historical trend, the system automatically adjusts the threshold to avoid misjudgments due to light fluctuations. By continuously updating the variance parameter sample library, the system can adapt to the long-term degradation process of bridge surface materials and improve the robustness of crack detection.
[0172] As a preferred embodiment, the solution of this application is implemented as follows: The flight control module is configured to control the drone to perform directional scans of the bridge surface under three different solar incidence angles, with the solar incidence angle difference between adjacent scan periods being 35°. The scan data includes grayscale images and corresponding GPS 3D coordinates. The candidate region generation module uses the Canny edge detection algorithm to process the single scan image, extracting continuous edges longer than 50 pixels. After connecting broken edges using a morphological closing operation, the results of multiple scans are merged to generate a set of candidate regions. The gradient modeling module calculates the gradient component of each pixel in the candidate region using the Sobel operator, quantizes the gradient direction angle to 1° precision, and then divides the gradient into direction groups at 10° intervals. The pixel proportions of each group are calculated and a distribution matrix in the time dimension is constructed. The variance calculation module calculates the variance of the pixel proportions in the three scans for each direction group, and accumulates the variance values of the six direction groups to generate a total variance parameter. The crack verification module compares the total variance parameter with a dynamically adjusted consistency threshold. If the total variance parameter is below the threshold, the crack is identified as a real crack. The feedback calibration module records the variance parameters of real cracks in historical detections and calculates their 30-day moving average. When the deviation of the latest detection value exceeds 10%, the consistency threshold is adjusted based on the product of the deviation rate and the preset weight coefficient.
[0173] Through the above-mentioned technical solution, this application effectively overcomes the problem of feature confusion between stains and cracks on bridge surfaces under dynamic lighting conditions. Through variance analysis of the multi-period gradient direction distribution matrix, the stable edge characteristics of cracks are significantly distinguished from the random gradient characteristics of stains that vary with illumination, reducing the false positive rate. A dynamic threshold adjustment mechanism based on a moving average further enhances the system's adaptability to ambient lighting fluctuations and material degradation, ensuring stable detection accuracy under complex working conditions.
[0174] The technical scope of the present invention is not limited to the contents of the above description. Those skilled in the art can make various deformations and modifications to the above embodiments without departing from the technical idea of the present invention, and these deformations and modifications should all fall within the protection scope of the present invention.
Claims
1. A method for tracking a target using a UAV visual system, characterized by: The steps include: Obtain an optical image dataset containing grayscale values obtained by a drone performing a directional scan of a target bridge area within a preset time period; the preset time periods are at least three groups, and the difference in solar incidence angles between adjacent preset time periods is no less than 30°; Performing edge detection processing on the optical image data set, extracting continuous edge regions whose length exceeds a preset threshold as candidate regions, and merging the extraction results to form a candidate region set; For each candidate area in the candidate area set, the gradient direction angle of each pixel point in the optical image data set of each scan is calculated respectively, and a gradient direction distribution matrix corresponding to the time dimension is constructed; the gradient direction distribution matrix includes at least six direction groups and the proportion of the number of pixels in each group; Compare the gradient direction distribution matrix obtained from each scan, calculate the variance of the pixel number ratio of each direction group one by one, and accumulate them to obtain the total variance parameter; When the total variance parameter is less than the preset consistency threshold, the candidate area is determined to be a real crack; Record the total variance parameter values of the areas judged as real cracks in historical detection tasks to form a variance parameter sample library; Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is: New threshold = original threshold × (1 + deviation rate × configurable weight coefficient); The deviation rate is: (moving average - latest variance parameter) / moving average.
2. The method for tracking a target using a UAV visual system according to claim 1, wherein: The adjusting the preset consistency threshold further includes: Synchronously collect current ambient light intensity data and calculate the light intensity change rate for multiple scanning periods; When the light intensity change rate exceeds the preset light fluctuation threshold, the threshold adjustment process is frozen and the backup consistency threshold set is enabled; The standby consistency threshold set includes multiple groups of preset consistency thresholds bound to different illumination intensity intervals.
3. The method for tracking a target using a UAV visual system according to claim 1, wherein: After determining that the candidate region is a real crack, the method further includes: Extract the direction group with the largest proportion in the gradient direction distribution matrix as the main gradient direction; In subsequent inspection tasks, priority is given to scanning adjacent areas extending along the main gradient direction, and the scanning range is adjusted to 1.2 to 1.4 times the length of the original area; The condition for determining whether the main gradient direction extends is that the difference between the gradient direction angles of at least two consecutive pixels detected in the adjacent area and the main gradient direction is less than 5°.
4. The method for tracking a target using a UAV visual system according to claim 3, wherein: The preferential scanning of adjacent areas extending along the main gradient direction includes: Real-time monitoring of new crack detection results in the area extending along the main gradient direction; When it is detected that the angle between the main gradient direction of the newly added crack and the original crack exceeds the preset angle tolerance, the angle interval of the direction group division is adjusted to half of the original one, and a refined gradient direction distribution matrix containing twice the number of current direction groups is generated.
5. The method for tracking a target using a UAV visual system according to claim 1, wherein: The UAV performs directional scanning of the target bridge area within a preset time period, including: The three-dimensional spatial coordinates of the first scan are recorded by the GPS positioning device to generate reference positioning data including height values and plane coordinates; The flight path for subsequent scans is planned based on the reference positioning data, so that the spatial coordinate deviation of the drone during each scan is less than a preset positioning tolerance value.
6. The method for tracking a target using a UAV visual system according to claim 1, wherein: The generation process of the candidate region set is as follows: Perform Canny edge detection on the optical image data set of a single scan to generate an initial edge set; Perform morphological closing operation on the broken edges with a length less than 20 cm in the initial edge set to form a revised edge set; A logical OR operation is performed on the modified edge sets obtained through multiple scans to generate the candidate region set.
7. The method for tracking a target using a UAV visual system according to claim 1, wherein: The construction of the gradient direction distribution matrix corresponding to the time dimension includes: The Sobel operator is used to calculate the gradient components of the pixel in the horizontal and vertical directions; The gradient direction angle of each pixel is calculated based on the inverse tangent function, and the calculation result is quantized into a discrete value with an accuracy of 1°; The gradient direction angles are divided into several direction groups at intervals of 10°, and the percentage of the number of pixels in each direction group to the total number of edge pixels is counted.
8. The method for tracking a target using a UAV visual system according to claim 1, wherein: The variance values of the proportions of the number of pixels in each direction group are calculated group by group, and the total variance parameters are accumulated to obtain the following parameters: For each direction group, the percentage of pixels in multiple scans is obtained; Calculate the average value of the pixel number ratio of multiple scans, and calculate the variance value of each direction group based on the average value; The variance values in each direction are summed to obtain the total variance parameter.
9. The method for tracking a target using a UAV visual system according to claim 1, wherein: Also includes: In multiple consecutive inspection tasks, the trend analysis of the total variance parameters of the same crack area is performed; When it is detected that the growth rate of the total variance parameter exceeds a preset growth threshold, it is determined that material degradation occurs in the crack area, and a material degradation warning signal is generated.
10. A UAV visual target tracking system, characterized by: The method for tracking a target using a visual drone as claimed in any one of claims 1 to 9 is applied, comprising: A flight control module is configured to obtain an optical image dataset containing grayscale values obtained by the UAV performing a directional scan of the target bridge area within a preset time period; the preset time periods are set to at least three groups, and the difference in solar incidence angle between adjacent preset time periods is not less than 30°; a candidate region generation module, configured to perform edge detection processing on the optical image data set, extract continuous edge regions whose length exceeds a preset threshold as candidate regions, and merge the extracted results to form a candidate region set; a gradient modeling module, configured to calculate, for each candidate region in the candidate region set, the gradient direction angle of each pixel point in the optical image data set for each scan, and construct a gradient direction distribution matrix corresponding to the time dimension; the gradient direction distribution matrix comprising at least six direction groups and a percentage of the number of pixels in each group; The variance calculation module is used to compare the gradient direction distribution matrix obtained in each scan, calculate the variance value of the pixel number ratio of each direction group one by one, and accumulate the total variance parameter; A crack verification module is used to determine that the candidate area is a real crack when the total variance parameter is less than a preset consistency threshold; Feedback calibration module, used to perform the following actions: Record the total variance parameter values of the areas judged as real cracks in historical detection tasks to form a variance parameter sample library; Calculate the moving average of the variance parameter in the variance parameter sample library. When the deviation between the variance parameter of the latest detection task and the moving average exceeds the preset feedback threshold, adjust the preset consistency threshold. The adjustment formula is: New threshold = original threshold × (1 + deviation rate × configurable weight coefficient); The deviation rate is: (moving average - latest variance parameter) / moving average.
Citation Information
Patent Citations
Bridge bottom surface crack detection method based on unmanned aerial vehicle vision
CN109521019A
Novel bridge inspection method
CN117853403A