Unmanned aerial vehicle positioning method and system based on multidirectional optical flow

By combining multi-directional optical flow sensors and TOF sensors, and utilizing tilted layout and pipeline column coordinate system transformation, a spiral trajectory model was established and time-varying weighted fusion and hierarchical correction were performed. This solved the problem of positioning error accumulation in underground vertical pipelines and improved the positioning accuracy and reliability of UAVs in complex environments.

CN121323637APending Publication Date: 2026-01-13WUHAN DAOXIAOFEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511481028.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing UAV positioning methods cannot effectively integrate kinematic constraints and pipeline geometric features in underground vertical pipes, leading to the accumulation of positioning errors and making it difficult to achieve highly reliable position state estimation, especially with insufficient accuracy during long-distance ascents.

Method used

By employing multi-directional optical flow sensors and Time-of-Flight (TOF) sensors, combined with tilted layout and pipeline column coordinate system transformation, a spiral trajectory model is established. Optical flow data is fused by weighting with time-varying weight coefficients, and layered correction is performed using an error propagation model to improve positioning accuracy and reliability.

Benefits of technology

It improves the positioning accuracy and trajectory tracking reliability of UAVs during long-distance climbing flights in narrow pipe spaces, meeting the requirements of high-precision real-time positioning for complex pipeline inspection tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121323637A_ABST
    Figure CN121323637A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of unmanned aerial vehicle positioning and navigation, and provides an unmanned aerial vehicle positioning method and system based on multidirectional optical flow, and the method comprises the steps: collecting data through a four-directional optical flow sensor and a TOF sensor, and enabling a left front sensor to be installed in an inclined manner; converting data of the inclination sensor into a pipeline column coordinate system; establishing a spiral trajectory model prediction position and performing quality evaluation; distributing a time-varying weight in combination with prediction and quality data; carrying out weighted fusion based on the weight and carrying out constraint positioning in combination with distance data; and calculating a correction threshold value through an error propagation model, and performing layered correction when the threshold value is exceeded. According to the invention, the positioning precision and trajectory tracking reliability of long-distance climbing flight of the unmanned aerial vehicle in a narrow pipeline space are improved, and meanwhile, the strict requirement of a complex pipeline inspection task on high-precision real-time positioning is met through a complete quality evaluation and error correction strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned aerial vehicle (UAV) positioning and navigation technology, and in particular to a UAV positioning method and system based on multi-directional optical flow. Background Technology

[0002] Underground pipeline systems, as a crucial component of urban infrastructure, are widely used in key public works projects such as water supply and drainage, gas transmission, and power and telecommunications. Over long-term use, underground pipelines are susceptible to various defects, including cracks, deformation, and blockages, due to factors such as geological subsidence, corrosion, and external damage. Unmanned aerial vehicle (UAV) inspection technology, as an emerging method for monitoring the condition of underground pipelines, uses various sensors to autonomously fly deep into the pipelines for inspection, enabling the identification and assessment of pipeline defects. However, the unique confined spaces, complex geometries, and lack of GPS signals inherent in underground pipelines present numerous challenges to the accurate positioning of UAVs. The key lies in effectively utilizing multi-sensor information, accurately estimating flight trajectories, and achieving high-precision positioning during long-distance ascents.

[0003] In existing technologies, UAV positioning for underground pipelines mainly employs single-sensor ranging or basic visual positioning methods to achieve basic position estimation. However, existing methods do not adequately consider the inherent physical correlation mechanism between the complex spiral flight trajectory of underground vertical pipelines and multi-directional optical flow information. This makes it difficult to organically integrate objective kinematic constraints with the actual geometric characteristics of the pipeline, resulting in the inability to achieve highly reliable automatic position estimation for UAVs. Particularly during long-distance vertical ascents, the cumulative effect of positioning errors is significant. Traditional methods lack effective error prediction and hierarchical correction mechanisms, failing to meet the stringent requirements for positioning accuracy and system reliability in practical engineering applications. Summary of the Invention

[0004] In view of this, the present invention proposes a UAV positioning method and system based on multi-directional optical flow, which solves the problem that existing methods do not adequately consider the inherent physical correlation mechanism between the complex spiral flight trajectory of underground vertical pipelines and multi-directional optical flow information, making it difficult to organically integrate objective kinematic constraints with actual pipeline geometric features, thus failing to achieve highly reliable automatic estimation of UAV position and state.

[0005] The technical solution of this invention is implemented as follows: On one hand, this invention provides a UAV positioning method based on multi-directional optical flow, comprising the following steps: Optical flow data and distance data are collected by optical flow sensors and TOF sensors installed on the drone, and four-way optical flow data and four-way distance data are output. The TOF sensor and the optical flow sensor are respectively installed at the top, bottom, left and front positions of the drone, with the optical flow sensors at the left and front positions tilted downwards. Convert the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and output the converted optical flow data. A spiral trajectory model is established based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV. The quality of the optical flow data of the upper and lower positions and the converted optical flow data is evaluated, and the quality score data and the predicted trajectory data are output. By combining predicted trajectory data and quality score data, time-varying weight coefficients are assigned to optical flow data and converted optical flow data at the upper and lower positions, and weight coefficient data is output. Based on the weighted coefficient data, the optical flow data and transformed optical flow data at the upper and lower positions are weighted and fused, and constrained localization is performed by combining the four-way distance data, and the fused localization result is output. The correction threshold is calculated based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is corrected in layers using four-way distance data, and the final positioning result is output.

[0006] Based on the above technical solutions, preferably, the step of combining predicted trajectory data and quality score data to assign time-varying weight coefficients to the optical flow data and transformed optical flow data at the upper and lower positions, and outputting weight coefficient data, includes: Establish a forward-looking weight allocation mechanism based on trajectory prediction. By analyzing the future motion trends in the predicted trajectory data, identify the degree of dependence of the UAV on optical flow data in each direction at different flight stages, and calculate the real-time reliability of optical flow data in each direction by combining the current quality score data. The weights of the trajectory prediction trend and the quality score data are adaptively fused to obtain time-varying weight coefficients that dynamically respond to changes in flight status. These time-varying weight coefficients are adjusted in real time based on changes in spiral radius, climb speed, and flight attitude in the predicted trajectory data, and the weight coefficient data is output, including the upper weight coefficient, lower weight coefficient, left weight coefficient, and forward weight coefficient.

[0007] Based on the above technical solutions, preferably, the establishment of a forward-looking weight allocation mechanism based on trajectory prediction includes: The motion vector direction and amplitude information for future moments are extracted from the predicted trajectory data. The matching degree between the optical flow data in each direction and the predicted motion direction is calculated. A nonlinear mapping relationship between the matching degree and the weight coefficient is established. A time decay model for quality score is constructed, and historical quality scores are subjected to exponential decay processing to highlight the importance of current data quality. The trajectory matching weight and the attenuation quality weight are weighted and synthesized using an adjustable fusion coefficient. The geometric rationality of the weight allocation is verified based on the pipeline geometric constraint factor. When the weight allocation result is detected to violate the physical constraints of pipeline motion, the weight reallocation mechanism is triggered to reallocate the weights and output the weight coefficient data that satisfies the physical constraints of pipeline motion.

[0008] Based on the above technical solutions, preferably, the step of calculating the correction threshold based on the error propagation model, and when the error of the fused positioning result exceeds the correction threshold, using four-way distance data to perform layered correction on the fused positioning result, and outputting the final positioning result, includes: An error propagation model for vertical pipe climbing is established. An error accumulation prediction function is constructed based on the UAV's climbing height, spiral trajectory parameters, and historical optical flow fusion errors. A dynamic correction threshold is calculated by analyzing the error propagation law. When the position error or velocity error of the fused positioning result exceeds the dynamic correction threshold, a hierarchical correction mechanism based on four-way distance data is activated. The layered correction mechanism includes coarse radial error correction and fine axial error correction. The coarse radial error correction uses distance data in the left, front, up, and down directions to re-estimate the radial position of the UAV relative to the central axis of the pipeline. The fine axial error correction calculates the UAV's climb position based on the rate of change of the up and down distance data, and outputs the final positioning result after layered correction.

[0009] Based on the above technical solutions, preferably, the establishment of the error propagation model for vertical pipe climbing includes: Based on the cylindrical geometric characteristics of the vertical pipe, a spatial propagation equation for optical flow positioning error is established. The error propagation is decomposed into three components: radial error diffusion, tangential error accumulation, and axial error increase. Based on the spiral motion parameters during the UAV's ascent, an error amplification coefficient model is established. By statistically analyzing the distribution patterns of historical positioning errors, the random characteristic parameters of error propagation are determined. Kalman filtering is used to predict the error accumulation trend in future time moments, and the value of the dynamic correction threshold is adaptively adjusted according to the magnitude of the prediction error. When the prediction error grows rapidly, the dynamic correction threshold is reduced to increase the correction frequency, and when the prediction error tends to stabilize, the dynamic correction threshold is increased to reduce unnecessary correction operations.

[0010] Based on the above technical solutions, preferably, the formula for calculating the dynamic correction threshold is: ; in, For a moment The dynamic correction threshold; Based on the reference value for the correction threshold; To predict future moments using Kalman filtering The error value; This is the error reference standard value; For threshold adjustment index; This is the influence coefficient of the error growth rate; This is the second-order time derivative of the total error; Based on pipe geometry parameters The correction frequency adjustment function.

[0011] Based on the above technical solutions, preferably, the step of converting the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and outputting the converted optical flow data includes: Based on the tilt angles of the left and front optical flow sensors and the geometric relationship of the pipe column coordinate system, the pipe radius and central axis position are calculated by combining the four-way distance data. A three-dimensional transformation matrix from the tilt sensor coordinate system to the pipe column coordinate system is established, and the three-dimensional transformation matrix is ​​calibrated in real time to adapt to changes in pipe geometry. The optical flow data collected by the left and front optical flow sensors is input into the three-dimensional transformation matrix. The optical flow data in the tilted coordinate system is decomposed into radial, tangential and axial components in the pipe column coordinate system through matrix operations. The transformation results are then checked for data validity and outlier filtering is performed to output transformed optical flow data that conforms to the definition of the pipe column coordinate system.

[0012] Based on the above technical solutions, preferably, the step of establishing a spiral trajectory model based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV, and performing quality assessment on the optical flow data of the upper and lower positions and the converted optical flow data, outputting quality score data and predicted trajectory data, includes: The three-dimensional motion vector of the UAV is calculated based on the optical flow data and converted optical flow data of the upper and lower positions. A spiral trajectory model suitable for climbing the pipeline is established by combining the vertical geometric features of the pipeline. The spiral parameters are fitted by historical trajectory data and the spatial position of the UAV at future moments is predicted. The predicted trajectory data is output, which includes position coordinates, velocity vector and trajectory confidence. Multi-dimensional quality analysis is performed on the optical flow data and transformed optical flow data at the upper and lower positions respectively. The multi-dimensional quality analysis includes the evaluation of spatial consistency, temporal continuity, amplitude rationality and directional stability of the optical flow vector. The evaluation results of each quality index are obtained. By weighted summing of the evaluation results of each quality index, the comprehensive quality score of the optical flow data in each direction is calculated, and the quality score data is output. The quality score data includes the upper quality score, lower quality score, left quality score and front quality score.

[0013] Based on the above technical solutions, preferably, the weighted fusion of optical flow data and transformed optical flow data at the upper and lower positions based on weighted coefficient data, combined with four-way distance data for constrained positioning, and outputting the fused positioning result includes: Based on the weighted coefficient data, time-varying weighted calculations are performed on the optical flow data and transformed optical flow data at the upper and lower positions. By constructing a multi-dimensional optical flow fusion matrix, the optical flow information in each direction is synthesized into a unified three-dimensional motion estimation result. The fusion process is monitored in real time and abnormal data is removed. The fused optical flow motion vector is output. The fused optical flow motion vector and four-way distance data are jointly optimized and calculated. The spatial position coordinates of the UAV are solved by establishing a set of optical flow-distance consistency constraint equations. The four-way distance data is used to perform geometric correction and improve the position accuracy of the optical flow fusion result. The inconsistency between optical flow estimation and distance measurement is eliminated by iterative optimization algorithm, and the fused positioning result after distance constraint correction is output.

[0014] On the other hand, the present invention also provides a UAV positioning system based on multi-directional optical flow, the system comprising: The data acquisition module is used to acquire optical flow data and distance data respectively through the optical flow sensor and the TOF sensor set on the UAV, and output four-way optical flow data and four-way distance data. The TOF sensor and the optical flow sensor are respectively set at the top, bottom, left and front of the UAV, wherein the optical flow sensors at the left and front positions are tilted downwards. The coordinate transformation module is used to convert the optical flow data of the left and front position optical flow sensors to the pipe cylinder coordinate system and output the converted optical flow data. The trajectory prediction and quality assessment module is used to build a spiral trajectory model based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV, and to perform quality assessment on the optical flow data of the upper and lower positions and the converted optical flow data, and output quality score data and predicted trajectory data. The time-varying weight allocation module is used to combine the predicted trajectory data and quality score data to allocate time-varying weight coefficients to the optical flow data and converted optical flow data at the upper and lower positions, and output the weight coefficient data. The weighted fusion and distance constraint module is used to perform weighted fusion of optical flow data and transformed optical flow data at the upper and lower positions based on weight coefficient data, and to perform constrained localization by combining four-way distance data, and output the fused localization result. The error detection and hierarchical correction module is used to calculate the correction threshold based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is hierarchically corrected using four-way distance data, and the final positioning result is output.

[0015] The UAV positioning method and system based on multi-directional optical flow of the present invention have the following advantages over the prior art: (1) By integrating four-way optical flow sensor and TOF sensor, multi-dimensional motion information is collected using tilt sensor layout and pipeline column coordinate system transformation technology. Combined with spiral trajectory model establishment and optical flow data quality assessment, time-varying weight coefficients are dynamically allocated. Based on the predicted trajectory trend and quality score, multi-way optical flow data is adaptively weighted and fused, which improves the positioning accuracy and trajectory tracking reliability of UAVs in long-distance climbing flight in narrow pipeline space. At the same time, the complete quality assessment and error correction strategy meets the strict requirements of high-precision real-time positioning for complex pipeline inspection tasks. (2) By establishing a forward-looking weight allocation mechanism based on trajectory prediction, the dependence of optical flow data in each direction is identified by future motion trend analysis and matching degree calculation. The real-time reliability of the weight coefficient is dynamically adjusted by combining the time decay quality scoring model. The time-varying weight coefficient is adjusted in real time according to the changes in spiral radius, climb speed and flight attitude, which improves the adaptability of multi-directional optical flow data fusion and the rationality of weight allocation. (3) By establishing an error propagation model for vertical pipe climbing, the spatial propagation equation of optical flow positioning error is constructed based on the cylindrical geometric features and spiral motion parameters. The correction threshold value is dynamically adjusted by combining Kalman filter prediction and historical error statistics. The radial coarse correction and axial fine correction are implemented in layers according to the error accumulation trend, which improves the long-term stability and error control accuracy of UAV positioning in underground pipeline environment. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of a UAV positioning method based on multi-directional optical flow according to the present invention. Detailed Implementation

[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1 This invention provides a UAV positioning method based on multi-directional optical flow, comprising the following steps: Optical flow data and distance data are collected by optical flow sensors and TOF sensors installed on the drone, and four-way optical flow data and four-way distance data are output. The TOF sensor and the optical flow sensor are respectively installed at the top, bottom, left and front positions of the drone, with the optical flow sensors at the left and front positions tilted downwards. Convert the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and output the converted optical flow data. A spiral trajectory model is established based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV. The quality of the optical flow data of the upper and lower positions and the converted optical flow data is evaluated, and the quality score data and the predicted trajectory data are output. By combining predicted trajectory data and quality score data, time-varying weight coefficients are assigned to optical flow data and converted optical flow data at the upper and lower positions, and weight coefficient data is output. Based on the weighted coefficient data, the optical flow data and transformed optical flow data at the upper and lower positions are weighted and fused, and constrained localization is performed by combining the four-way distance data, and the fused localization result is output. The correction threshold is calculated based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is corrected in layers using four-way distance data, and the final positioning result is output.

[0020] Specifically, this embodiment integrates a four-way optical flow sensor and a TOF sensor, utilizes tilt sensor layout and pipeline column coordinate system transformation technology to collect multi-dimensional motion information, combines spiral trajectory model establishment and dynamic allocation of time-varying weight coefficients based on optical flow data quality assessment, and adaptively weights and fuses multi-way optical flow data according to predicted trajectory trends and quality scores. Through error propagation prediction model and hierarchical correction mechanism, it solves the problems of error accumulation and accuracy attenuation in optical flow positioning in underground vertical pipeline environments, improves the positioning accuracy and trajectory tracking reliability of UAVs during long-distance climbing flight in narrow pipeline spaces, and meets the stringent requirements of high-precision real-time positioning for complex pipeline inspection tasks through a complete quality assessment and error correction strategy.

[0021] The process involves acquiring optical flow data and distance data via optical flow sensors and TOF sensors installed on the UAV, and outputting four-way optical flow data and four-way distance data, including: Optical flow sensors and Time-of-Flight (TOF) sensors are mounted on the UAV body in an asymmetrical tilted layout. The optical flow sensors at the top and bottom are mounted horizontally, while the optical flow sensors at the left and front are tilted downwards at an angle of 15-25 degrees. Each TOF sensor is coaxially configured with its corresponding optical flow sensor, resulting in a four-way sensor array.

[0022] In one specific embodiment, based on the cylindrical geometry of the vertical pipe, the tilt angles of the left and front optical flow sensors are set to the optimal viewing angles with respect to the tangent direction of the pipe wall surface. By pre-measuring or calculating the pipe radius in real time, the working distance and field of view of the left and front optical flow sensors are dynamically adjusted so that the observation area of ​​the tilted optical flow sensors always covers the textured area of ​​the pipe wall surface. At the same time, it is ensured that the detection ranges of each sensor do not overlap or interfere with each other. The tilt angle is finely adjusted by a mechanical adjustment mechanism to adapt to vertical pipe environments of different diameters.

[0023] Four optical flow sensors and four Time-of-Flight (TOF) sensors are synchronously triggered by a preset acquisition frequency to acquire data. The optical flow sensors acquire motion information of image feature points in the corresponding direction, and the TOF sensors measure the straight-line distance value to the pipe wall surface. The acquired data is identified and packaged according to the up, down, left, and front directions, and the four-directional optical flow data and four-directional distance data with time stamp synchronization are output.

[0024] In one specific embodiment, a unified time reference is established, and hardware synchronization signals are used to ensure that the four optical flow sensors and four TOF sensors start data acquisition at the same time. The acquisition frequency is set to 20-50Hz to meet the real-time positioning requirements. For optical flow data acquisition, quality indicators such as the number of corner features, distribution uniformity, and illumination intensity in each frame of the image are extracted. For TOF distance data acquisition, reliability parameters such as ranging accuracy, reflected signal strength, and environmental noise level are recorded. All sensor data are synchronized with GPS timestamps and encapsulated and cached in real time according to a predetermined data format to ensure that subsequent processing steps can obtain multi-directional sensor data with consistent time.

[0025] Specifically, this embodiment establishes an asymmetric, tilted four-directional sensor array. It utilizes the 15-25 degree tilted installation of optical flow sensors at the left and front positions and the optimal viewing angle design along the tangent direction of the pipe wall surface to cover textured areas. Combined with dynamic adjustment of working distance and field of view, it adapts to pipe environments of different diameters. Data from multiple sensors is synchronously acquired at a frequency of 20-50Hz based on a unified time reference and hardware synchronization signal. Through quality index extraction and reliability parameter recording mechanisms, it solves the problems of traditional sensor layouts failing to effectively acquire pipe environment feature information and the time inconsistency of multi-sensor data. This improves the effectiveness of optical flow feature extraction and the synchronization accuracy of multi-directional sensor data fusion in underground vertical pipe environments. Furthermore, through comprehensive sensor configuration optimization and data quality assessment strategies, it meets the technical requirements for high-quality sensor information acquisition in complex pipe geometries.

[0026] The process of converting the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and outputting the converted optical flow data includes: Based on the tilt angles of the left and front optical flow sensors and the geometric relationship of the pipe column coordinate system, the pipe radius and central axis position are calculated by combining the four-way distance data. A three-dimensional transformation matrix from the tilt sensor coordinate system to the pipe column coordinate system is established, and the three-dimensional transformation matrix is ​​calibrated in real time to adapt to changes in pipe geometry.

[0027] In one specific embodiment, the spatial position of the pipe's central axis and the pipe's radius parameters are calculated by fitting the pipe cross-section circle with four-way distance data. An initial transformation matrix is ​​constructed based on the tilt angles of the left and front optical flow sensors. The initial transformation matrix is ​​geometrically corrected using the pipe's cylindrical geometric constraints. The transformation parameters are optimized using the least squares method to reduce geometric errors. At the same time, a dynamic update mechanism for the transformation matrix is ​​established. When a significant change in the pipe's geometric parameters is detected, the transformation matrix is ​​automatically recalculated and the coordinate transformation relationship is updated to ensure that the data from the tilted left and front optical flow sensors can be accurately mapped to the pipe's cylindrical coordinate system.

[0028] The optical flow data collected by the left and front optical flow sensors is input into the three-dimensional transformation matrix. The optical flow data in the tilted coordinate system is decomposed into radial, tangential and axial components in the pipe column coordinate system through matrix operations. The transformation results are then checked for data validity and outlier filtering is performed to output transformed optical flow data that conforms to the definition of the pipe column coordinate system.

[0029] In one specific embodiment, the optical flow data from the left and front position optical flow sensors are preprocessed, including noise filtering and data smoothing. The preprocessed optical flow data vector is multiplied by a three-dimensional transformation matrix to obtain the three-dimensional optical flow components in the pipe cylindrical coordinate system. The validity of the transformation results is judged by setting a reasonable numerical range threshold, and abnormal data points that exceed the physical possibility range are eliminated. The valid transformed optical flow data is subjected to time series consistency verification to ensure that the transformation results at adjacent time points are continuous. Finally, the quality-verified transformed optical flow data in the pipe cylindrical coordinate system is output.

[0030] Specifically, this embodiment establishes a three-dimensional transformation matrix from the tilt sensor coordinate system to the pipe cylinder coordinate system. Geometric errors are reduced by fitting the pipe cross-section circle using four-way distance data and optimizing transformation parameters using the least squares method. The transformation matrix is ​​calibrated in real-time to adapt to pipe geometric changes, incorporating pipe cylinder geometric constraints and a dynamic update mechanism. The quality of the transformed optical flow data is verified based on radial, tangential, and axial component decomposition and data validity checks. Outlier filtering and time series consistency checks address the limitations of traditional coordinate transformation methods in accurately processing tilt sensor data and lacking geometric constraint correction, thus improving the mapping accuracy of left and front tilt optical flow sensor data in the pipe cylinder coordinate system and the reliability of the transformation results.

[0031] The spiral trajectory model is established based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV. The quality of the optical flow data of the upper and lower positions and the converted optical flow data is evaluated, and quality score data and predicted trajectory data are output, including: The three-dimensional motion vector of the UAV is calculated based on the optical flow data of the upper and lower positions and the converted optical flow data. A spiral trajectory model suitable for climbing the pipeline is established by combining the vertical geometric features of the pipeline. The spiral parameters are fitted by historical trajectory data and the spatial position of the UAV at future moments is predicted. The predicted trajectory data is output, which includes position coordinates, velocity vector and trajectory confidence.

[0032] In one specific embodiment, the vertical velocity of the UAV is calculated using upper and lower position optical flow data, and the radial and tangential motion components of the UAV in the horizontal plane are calculated using transformed optical flow data. The equations of a parameterized spiral trajectory model are established by combining the geometric constraints of the pipe cylinder. The sliding window least squares method is used to fit historical trajectory data to determine key parameters such as spiral radius, spiral angle, and climb speed. Based on the fitted spiral trajectory model, the UAV position coordinates at multiple future moments are predicted, and the uncertainty range of the predicted position is estimated by the Monte Carlo method. The predicted trajectory data is output, which includes the predicted position, predicted velocity, and position confidence interval.

[0033] Multi-dimensional quality analysis is performed on the optical flow data and transformed optical flow data at the upper and lower positions respectively. The multi-dimensional quality analysis includes the evaluation of spatial consistency, temporal continuity, amplitude rationality and directional stability of the optical flow vector. The evaluation results of each quality index are obtained. By weighted summing of the evaluation results of each quality index, the comprehensive quality score of the optical flow data in each direction is calculated, and the quality score data is output. The quality score data includes the upper quality score, lower quality score, left quality score and front quality score.

[0034] In one specific embodiment, the uniformity index of the spatial gradient distribution of optical flow data in each direction is calculated to evaluate the consistency of the optical flow vector corresponding to the optical flow data within the image region. The rate of change of the optical flow vector is analyzed by temporal difference analysis to evaluate the continuity and stability of optical flow data between adjacent frames. A reasonable range threshold for the amplitude of the optical flow vector is set, and the proportion of outliers exceeding the range is statistically analyzed as a reasonableness evaluation index. The standard deviation of the optical flow vector direction is calculated to evaluate the stability of the motion direction. The evaluation results of the four dimensions of space, time, amplitude, and direction are weighted and summed through preset weights to obtain the comprehensive quality score of the optical flow data in each direction. The quality score is then normalized to output standardized quality score data in the range of 0-1.

[0035] Specifically, this embodiment establishes a spiral trajectory model suitable for pipeline ascent, calculates three-dimensional motion vectors using upper and lower optical flow data and transformed optical flow data, and fits spiral parameters using the sliding window least squares method to predict future positions. It then combines Monte Carlo methods to estimate position uncertainty and multi-dimensional quality analysis to evaluate the reliability of optical flow data. A comprehensive quality score is calculated based on four dimensions: spatial consistency, temporal continuity, amplitude reasonableness, and directional stability. Through parametric trajectory modeling and a multi-dimensional quality assessment mechanism, it solves the problems of traditional methods' inability to accurately predict pipeline spiral flight trajectories and the lack of quantitative evaluation of optical flow data quality. This improves the accuracy of UAV trajectory prediction and the precision of multi-directional optical flow data quality assessment in underground vertical pipeline environments. Furthermore, the complete uncertainty estimation and standardized quality scoring strategy meet the technical requirements of complex pipeline inspection tasks for high-reliability trajectory prediction and data quality control.

[0036] The process involves combining predicted trajectory data and quality score data to assign time-varying weight coefficients to the optical flow data and transformed optical flow data at the upper and lower positions, and outputting weight coefficient data, including: Establish a forward-looking weight allocation mechanism based on trajectory prediction. By analyzing the future motion trends in the predicted trajectory data, identify the degree of dependence of the UAV on optical flow data in each direction at different flight stages, and calculate the real-time reliability of optical flow data in each direction by combining the current quality score data. The weights of the trajectory prediction trend and the quality score data are adaptively fused to obtain time-varying weight coefficients that dynamically respond to changes in flight status. These time-varying weight coefficients are adjusted in real time based on changes in spiral radius, climb speed, and flight attitude in the predicted trajectory data, and the weight coefficient data is output, including the upper weight coefficient, lower weight coefficient, left weight coefficient, and forward weight coefficient.

[0037] The establishment of a forward-looking weight allocation mechanism based on trajectory prediction includes: The motion vector direction and amplitude information for future moments are extracted from the predicted trajectory data. The matching degree between the optical flow data in each direction and the predicted motion direction is calculated. A nonlinear mapping relationship between the matching degree and the weight coefficient is established. A time decay model for quality score is constructed, and historical quality scores are subjected to exponential decay processing to highlight the importance of current data quality. The trajectory matching weight and the attenuation quality weight are weighted and synthesized using an adjustable fusion coefficient. The geometric rationality of the weight allocation is verified based on the pipeline geometric constraint factor. When the weight allocation result is detected to violate the physical constraints of pipeline motion, the weight redistribution mechanism is triggered to redistribute the weights, ensuring that the output time-varying weight coefficients conform to both the predicted trajectory trend and the physical feasibility requirements, and outputting weight coefficient data that meets the physical constraints of pipeline motion.

[0038] In one specific embodiment, the calculation formula for the forward-looking weight allocation mechanism is: ; in, For the first Direction at any moment The time-varying weighting coefficients, ; This is an adjustable fusion coefficient for trajectory matching weights and quality score weights, with a value range of [value range missing]. ; For the first Direction at any moment The degree of matching between optical flow data and predicted motion direction; This is the directional deviation attenuation factor; For the first The angular deviation between the directional optical flow vector and the predicted motion direction, in radians; For the first Directional optical flow data at time Quality rating; This is the time decay coefficient, used for exponential decay processing of historical quality scores; This represents the time difference between the current moment and the historical scoring moment. Here, is the pipeline geometric constraint factor, where, For the geometric parameters of the pipe cylinder; It is an exponential function.

[0039] The formula for calculating the matching degree is: ; in, For the first Direction at any moment The degree of matching between optical flow data and predicted motion direction; For predicting trajectory data The motion vector at any given moment; For the first Directional optical flow data vector; This is the sensitivity coefficient for changes in the helix radius; This refers to the radius parameter of the spiral trajectory. This is the sensitivity coefficient to changes in the rate of ascent; For the drone's climb speed; Here, is the flight attitude change correction function, where, These are attitude angle parameters.

[0040] Specifically, this embodiment establishes a forward-looking weight allocation mechanism based on trajectory prediction, uses future motion trend analysis and matching degree calculation to identify the dependence of optical flow data in each direction, combines a time decay quality scoring model to dynamically adjust the real-time reliability of weight coefficients, and adjusts time-varying weight coefficients in real time according to changes in spiral radius, climb speed, and flight attitude. Through adjustable fusion coefficient weighted synthesis and pipeline geometric constraint verification mechanism, it solves the problems of traditional weight allocation methods being unable to predict flight state changes and lacking physical constraint verification, improves the adaptability of multi-directional optical flow data fusion and the rationality of weight allocation, and meets the accuracy requirements of UAV flight trajectory prediction for dynamic weight adjustment in complex pipeline environments through complete geometric rationality verification and weight redistribution strategy.

[0041] The optical flow data and transformed optical flow data at the upper and lower positions are weighted and fused based on weighted coefficient data, and constrained localization is performed by combining four-way distance data. The fused localization result is output, including: Based on the weighted coefficient data, time-varying weighted calculations are performed on the optical flow data and transformed optical flow data at the upper and lower positions. By constructing a multi-dimensional optical flow fusion matrix, the optical flow information in each direction is synthesized into a unified three-dimensional motion estimation result. The fusion process is monitored in real time and abnormal data is removed, and the fused optical flow motion vector is output.

[0042] In one specific embodiment, a four-dimensional weight matrix is ​​constructed, with the upper, lower, left, and front weight coefficients as diagonal elements. A linear weighted combination equation for optical flow data in each direction is established. The fusion coefficient is optimized by the minimum variance unbiased estimation criterion to reduce fusion error. Numerical instability phenomena occurring during the weighted fusion process are detected and processed. When an excessive bias of the weight coefficient in a certain direction is detected, a weight balancing mechanism is activated to prevent distortion of the fusion result. At the same time, a fusion quality evaluation index is established to monitor the rationality and consistency of the fused optical flow vector in real time. Fusion results that do not meet the quality requirements are marked and recalculated to ensure that the output fused optical flow motion vector has high precision and high reliability.

[0043] The fused optical flow motion vector and four-way distance data are jointly optimized and calculated. The spatial position coordinates of the UAV are solved by establishing a set of optical flow-distance consistency constraint equations. The four-way distance data is used to perform geometric correction and improve the position accuracy of the optical flow fusion result. The inconsistency between optical flow estimation and distance measurement is eliminated by iterative optimization algorithm, and the fused positioning result after distance constraint correction is output.

[0044] In one specific embodiment, a geometric consistency equation for optical flow motion estimation and distance measurement is established. Geometric constraints on the pipeline space are constructed using four-way distance data. The fused optical flow motion vector is converted into a position change and compared with the distance change for verification. The optimal position coordinates that satisfy the dual constraints of optical flow and distance are solved by weighted least squares method. A cylindrical geometric model of the pipeline is introduced as an additional constraint to improve positioning accuracy. An iterative convergence algorithm is used to gradually eliminate the influence of optical flow estimation bias and distance measurement noise. A convergence criterion and a maximum number of iterations are set to prevent the algorithm from diverging. When the constraint equation set has no solution or the uncertainty of the solution is too large, a degraded positioning mode is activated to prioritize the continuity and stability of the positioning results. A high-precision fused positioning result that satisfies multiple geometric constraints is output.

[0045] Specifically, this embodiment constructs a multi-dimensional optical flow fusion matrix and a four-dimensional weight matrix, utilizes time-varying weighted calculation and the minimum variance unbiased estimation criterion to uniformly synthesize optical flow information from all directions, combines a weight balancing mechanism and fusion quality evaluation indicators to prevent distortion of the fusion results, and performs geometric correction on the fused positioning results based on the optical flow-distance consistency constraint equations and iterative optimization algorithms. By using the weighted least squares method and the pipe-cylinder geometric constraint mechanism, it solves the problems of traditional optical flow fusion methods failing to effectively balance multi-directional information weights and lacking geometric correction of distance data, thus improving the accuracy of multi-directional optical flow data fusion and the geometric precision of the fused positioning results.

[0046] The error propagation model is used to calculate the correction threshold. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is corrected hierarchically using four-way distance data, and the final positioning result is output, including: An error propagation model for vertical pipe climbing is established. An error accumulation prediction function is constructed based on the UAV's climbing height, spiral trajectory parameters, and historical optical flow fusion errors. A dynamic correction threshold is calculated by analyzing the error propagation law. When the position error or velocity error of the fused positioning result exceeds the dynamic correction threshold, a hierarchical correction mechanism based on four-way distance data is activated. The layered correction mechanism includes coarse radial error correction and fine axial error correction. The coarse radial error correction uses distance data in the left, front, up, and down directions to re-estimate the radial position of the UAV relative to the central axis of the pipeline. The fine axial error correction calculates the UAV's climb position based on the rate of change of the up and down distance data, and outputs the final positioning result after layered correction.

[0047] The establishment of the error propagation model for vertical pipe climbing includes: Based on the cylindrical geometric characteristics of the vertical pipe, a spatial propagation equation for optical flow positioning error is established. The error propagation is decomposed into three components: radial error diffusion, tangential error accumulation, and axial error increase. Based on the spiral motion parameters during the UAV's ascent, an error amplification coefficient model is established. By statistically analyzing the distribution patterns of historical positioning errors, the random characteristic parameters of error propagation are determined. Kalman filtering is used to predict the error accumulation trend in future time moments, and the value of the dynamic correction threshold is adaptively adjusted according to the magnitude of the prediction error. When the prediction error grows rapidly, the dynamic correction threshold is reduced to increase the correction frequency. When the prediction error tends to stabilize, the dynamic correction threshold is increased to reduce unnecessary correction operations, ensuring that the hierarchical correction mechanism can provide the optimal correction strategy at different stages of error accumulation.

[0048] In one specific embodiment, the formula for calculating the error cumulative prediction function is: ; in, For the future moment The total cumulative predicted error; , , Each represents the current time. Radial error diffusion, tangential error accumulation, and axial error increasing components; , , These are the radial, tangential, and axial error amplification factors, respectively. Based on the altitude and helical motion parameters The error amplification factor model; These are random characteristic parameters based on historical error distribution statistics.

[0049] The formula for calculating the dynamic correction threshold is: ; in, For a moment The dynamic correction threshold; Based on the reference value for the correction threshold; To predict future moments using Kalman filtering The error value; This is the error reference standard value; This is the threshold adjustment index, used to control the sensitivity of the threshold to changes in prediction error; This is the influence coefficient of the error growth rate; The second time derivative of the total error is used to characterize the error growth trend; Based on pipe geometry parameters The correction frequency adjustment function.

[0050] Specifically, by establishing an error propagation model for vertical pipeline climbing, a spatial propagation equation for optical flow positioning error is constructed based on the cylindrical geometric features and helical motion parameters. The correction threshold value is dynamically adjusted by combining Kalman filter prediction and historical error statistics. Radial coarse correction and axial fine correction are implemented in layers according to the error accumulation trend. The problem of rapid error accumulation and lack of predictive correction in traditional positioning methods during long-distance vertical climbing is solved by the three-component decomposition of error propagation and adaptive threshold adjustment mechanism. This improves the long-term stability and error control accuracy of UAV positioning in underground pipeline environments. At the same time, the complete error prediction and layered correction strategy meets the strict technical requirements of continuous high-precision positioning for complex vertical pipeline inspection tasks.

[0051] The present invention also provides a UAV positioning system based on multi-directional optical flow, the system comprising: The data acquisition module is used to acquire optical flow data and distance data respectively through the optical flow sensor and the TOF sensor set on the UAV, and output four-way optical flow data and four-way distance data. The TOF sensor and the optical flow sensor are respectively set at the top, bottom, left and front of the UAV, wherein the optical flow sensors at the left and front positions are tilted downwards. The coordinate transformation module is used to convert the optical flow data of the left and front position optical flow sensors to the pipe cylinder coordinate system and output the converted optical flow data. The trajectory prediction and quality assessment module is used to build a spiral trajectory model based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV, and to perform quality assessment on the optical flow data of the upper and lower positions and the converted optical flow data, and output quality score data and predicted trajectory data. The time-varying weight allocation module is used to combine the predicted trajectory data and quality score data to allocate time-varying weight coefficients to the optical flow data and converted optical flow data at the upper and lower positions, and output the weight coefficient data. The weighted fusion and distance constraint module is used to perform weighted fusion of optical flow data and transformed optical flow data at the upper and lower positions based on weight coefficient data, and to perform constrained localization by combining four-way distance data, and output the fused localization result. The error detection and hierarchical correction module is used to calculate the correction threshold based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is hierarchically corrected using four-way distance data, and the final positioning result is output.

[0052] Specifically, this embodiment of a UAV positioning system based on multi-directional optical flow constructs six functional modules: data acquisition, coordinate transformation, trajectory prediction and quality assessment, time-varying weight allocation, weighted fusion and distance constraint, and error detection and hierarchical correction. It utilizes a four-directional sensor array and tilted layout design to synchronously acquire multi-dimensional optical flow and distance data. Combined with the establishment of a spiral trajectory model and a forward-looking weight allocation mechanism, it achieves adaptive multi-directional data fusion. Furthermore, it dynamically controls the positioning accuracy based on error propagation prediction and hierarchical correction strategies, thereby improving the system integration and positioning accuracy stability for complex vertical pipeline inspection tasks.

[0053] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A UAV positioning method based on multi-directional optical flow, characterized in that, Includes the following steps: Optical flow data and distance data are collected by optical flow sensors and TOF sensors installed on the drone, and four-way optical flow data and four-way distance data are output. The TOF sensor and the optical flow sensor are respectively installed at the top, bottom, left and front positions of the drone, with the optical flow sensors at the left and front positions tilted downwards. Convert the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and output the converted optical flow data. A spiral trajectory model is established based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV. The quality of the optical flow data of the upper and lower positions and the converted optical flow data is evaluated, and the quality score data and the predicted trajectory data are output. By combining predicted trajectory data and quality score data, time-varying weight coefficients are assigned to optical flow data and converted optical flow data at the upper and lower positions, and weight coefficient data is output. Based on the weighted coefficient data, the optical flow data and transformed optical flow data at the upper and lower positions are weighted and fused, and constrained localization is performed by combining the four-way distance data, and the fused localization result is output. The correction threshold is calculated based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is corrected in layers using four-way distance data, and the final positioning result is output.

2. The UAV positioning method based on multi-directional optical flow as described in claim 1, characterized in that, The process involves combining predicted trajectory data and quality score data to assign time-varying weight coefficients to the optical flow data and transformed optical flow data at the upper and lower positions, and outputting weight coefficient data, including: Establish a forward-looking weight allocation mechanism based on trajectory prediction. By analyzing the future motion trends in the predicted trajectory data, identify the degree of dependence of the UAV on optical flow data in each direction at different flight stages, and calculate the real-time reliability of optical flow data in each direction by combining the current quality score data. The weights of the trajectory prediction trend and the quality score data are adaptively fused to obtain time-varying weight coefficients that dynamically respond to changes in flight status. These time-varying weight coefficients are adjusted in real time based on changes in spiral radius, climb speed, and flight attitude in the predicted trajectory data, and the weight coefficient data is output, including the weight coefficients above, below, left, and forward.

3. The UAV positioning method based on multi-directional optical flow as described in claim 2, characterized in that, The establishment of a forward-looking weight allocation mechanism based on trajectory prediction includes: The motion vector direction and amplitude information for future moments are extracted from the predicted trajectory data. The matching degree between the optical flow data in each direction and the predicted motion direction is calculated. A nonlinear mapping relationship between the matching degree and the weight coefficient is established. A time decay model for quality score is constructed, and historical quality scores are subjected to exponential decay processing to highlight the importance of current data quality. The trajectory matching weight and the attenuation quality weight are weighted and synthesized using an adjustable fusion coefficient. The geometric rationality of the weight allocation is verified based on the pipeline geometric constraint factor. When the weight allocation result is detected to violate the physical constraints of pipeline motion, the weight reallocation mechanism is triggered to reallocate the weights and output the weight coefficient data that satisfies the physical constraints of pipeline motion.

4. The UAV positioning method based on multi-directional optical flow as described in claim 1, characterized in that, The error propagation model is used to calculate the correction threshold. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is corrected hierarchically using four-way distance data, and the final positioning result is output, including: An error propagation model for vertical pipe climbing is established. An error accumulation prediction function is constructed based on the UAV's climbing height, spiral trajectory parameters, and historical optical flow fusion errors. A dynamic correction threshold is calculated by analyzing the error propagation law. When the position error or velocity error of the fused positioning result exceeds the dynamic correction threshold, a hierarchical correction mechanism based on four-way distance data is activated. The layered correction mechanism includes coarse radial error correction and fine axial error correction. The coarse radial error correction uses distance data in the left, front, up, and down directions to re-estimate the radial position of the UAV relative to the central axis of the pipeline. The fine axial error correction calculates the UAV's climb position based on the rate of change of the up and down distance data, and outputs the final positioning result after layered correction.

5. The UAV positioning method based on multi-directional optical flow as described in claim 4, characterized in that, The establishment of the error propagation model for vertical pipe climbing includes: Based on the cylindrical geometric characteristics of the vertical pipe, a spatial propagation equation for optical flow positioning error is established. The error propagation is decomposed into three components: radial error diffusion, tangential error accumulation, and axial error increase. Based on the spiral motion parameters during the UAV's ascent, an error amplification coefficient model is established. By statistically analyzing the distribution patterns of historical positioning errors, the random characteristic parameters of error propagation are determined. Kalman filtering is used to predict the error accumulation trend in future time moments, and the value of the dynamic correction threshold is adaptively adjusted according to the magnitude of the prediction error. When the prediction error grows rapidly, the dynamic correction threshold is reduced to increase the correction frequency, and when the prediction error tends to stabilize, the dynamic correction threshold is increased to reduce unnecessary correction operations.

6. The UAV positioning method based on multi-directional optical flow as described in claim 5, characterized in that, The formula for calculating the dynamic correction threshold is: ; in, For a moment The dynamic correction threshold; Based on the reference value for the correction threshold; To predict future moments using Kalman filtering The error value; This is the error reference standard value; For threshold adjustment index; This is the influence coefficient of the error growth rate; This is the second-order time derivative of the total error; Based on pipe geometry parameters The correction frequency adjustment function.

7. The UAV positioning method based on multi-directional optical flow as described in claim 1, characterized in that, The process of converting the optical flow data from the left and front position optical flow sensors to the pipe cylindrical coordinate system and outputting the converted optical flow data includes: Based on the tilt angles of the left and front optical flow sensors and the geometric relationship of the pipe column coordinate system, the pipe radius and central axis position are calculated by combining the four-way distance data. A three-dimensional transformation matrix from the tilt sensor coordinate system to the pipe column coordinate system is established, and the three-dimensional transformation matrix is ​​calibrated in real time to adapt to changes in pipe geometry. The optical flow data collected by the left and front optical flow sensors is input into the three-dimensional transformation matrix. The optical flow data in the tilted coordinate system is decomposed into radial, tangential and axial components in the pipe column coordinate system through matrix operations. The transformation results are then checked for data validity and outlier filtering is performed to output transformed optical flow data that conforms to the definition of the pipe column coordinate system.

8. The UAV positioning method based on multi-directional optical flow as described in claim 1, characterized in that, The spiral trajectory model is established based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV. The quality of the optical flow data of the upper and lower positions and the converted optical flow data is evaluated, and quality score data and predicted trajectory data are output, including: The three-dimensional motion vector of the UAV is calculated based on the optical flow data and converted optical flow data of the upper and lower positions. A spiral trajectory model suitable for climbing the pipeline is established by combining the vertical geometric features of the pipeline. The spiral parameters are fitted by historical trajectory data and the spatial position of the UAV at future moments is predicted. The predicted trajectory data is output, which includes position coordinates, velocity vector and trajectory confidence. Multi-dimensional quality analysis is performed on the optical flow data and transformed optical flow data at the upper and lower positions respectively. The multi-dimensional quality analysis includes the evaluation of spatial consistency, temporal continuity, amplitude rationality and directional stability of the optical flow vector. The evaluation results of each quality index are obtained. By weighted summing of the evaluation results of each quality index, the comprehensive quality score of the optical flow data in each direction is calculated, and the quality score data is output. The quality score data includes the upper quality score, lower quality score, left quality score and front quality score.

9. The UAV positioning method based on multi-directional optical flow as described in claim 1, characterized in that, The optical flow data and transformed optical flow data at the upper and lower positions are weighted and fused based on weighted coefficient data, and constrained localization is performed by combining four-way distance data. The fused localization result is output, including: Based on the weighted coefficient data, time-varying weighted calculations are performed on the optical flow data and transformed optical flow data at the upper and lower positions. By constructing a multi-dimensional optical flow fusion matrix, the optical flow information in each direction is synthesized into a unified three-dimensional motion estimation result. The fusion process is monitored in real time and abnormal data is removed. The fused optical flow motion vector is output. The fused optical flow motion vector and four-way distance data are jointly optimized and calculated. The spatial position coordinates of the UAV are solved by establishing a set of optical flow-distance consistency constraint equations. The four-way distance data is used to perform geometric correction and improve the position accuracy of the optical flow fusion result. The inconsistency between optical flow estimation and distance measurement is eliminated by iterative optimization algorithm, and the fused positioning result after distance constraint correction is output.

10. A UAV positioning system based on multi-directional optical flow, used to execute a UAV positioning method based on multi-directional optical flow as described in any one of claims 1-9, characterized in that, The system includes: The data acquisition module is used to acquire optical flow data and distance data respectively through the optical flow sensor and the TOF sensor set on the UAV, and output four-way optical flow data and four-way distance data. The TOF sensor and the optical flow sensor are respectively set at the top, bottom, left and front of the UAV, wherein the optical flow sensors at the left and front positions are tilted downwards. The coordinate transformation module is used to convert the optical flow data of the left and front position optical flow sensors to the pipe cylinder coordinate system and output the converted optical flow data. The trajectory prediction and quality assessment module is used to build a spiral trajectory model based on the optical flow data of the upper and lower positions and the converted optical flow data to predict the position of the UAV, and to perform quality assessment on the optical flow data of the upper and lower positions and the converted optical flow data, and output quality score data and predicted trajectory data. The time-varying weight allocation module is used to combine the predicted trajectory data and quality score data to allocate time-varying weight coefficients to the optical flow data and converted optical flow data at the upper and lower positions, and output the weight coefficient data. The weighted fusion and distance constraint module is used to perform weighted fusion of optical flow data and transformed optical flow data at the upper and lower positions based on weight coefficient data, and to perform constrained localization by combining four-way distance data, and output the fused localization result. The error detection and hierarchical correction module is used to calculate the correction threshold based on the error propagation model. When the error of the fused positioning result exceeds the correction threshold, the fused positioning result is hierarchically corrected using four-way distance data, and the final positioning result is output.