CN118210329A - Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud - Google Patents
Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud Download PDFInfo
- Publication number
- CN118210329A CN118210329A CN202410312332.7A CN202410312332A CN118210329A CN 118210329 A CN118210329 A CN 118210329A CN 202410312332 A CN202410312332 A CN 202410312332A CN 118210329 A CN118210329 A CN 118210329A
- Authority
- CN
- China
- Prior art keywords
- point cloud
- follows
- target
- uav
- binocular
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000001514 detection method Methods 0.000 claims abstract description 46
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 16
- 239000011159 matrix material Substances 0.000 claims description 24
- 238000004364 calculation method Methods 0.000 claims description 15
- 230000003044 adaptive effect Effects 0.000 claims description 12
- 230000008859 change Effects 0.000 claims description 9
- 238000003032 molecular docking Methods 0.000 claims description 9
- 238000012937 correction Methods 0.000 claims description 8
- 238000001914 filtration Methods 0.000 claims description 8
- 230000009466 transformation Effects 0.000 claims description 7
- 238000003702 image correction Methods 0.000 claims description 6
- 238000013519 translation Methods 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 4
- 230000004913 activation Effects 0.000 claims description 3
- 230000003287 optical effect Effects 0.000 claims description 3
- 238000013138 pruning Methods 0.000 claims description 3
- 230000000007 visual effect Effects 0.000 abstract description 3
- 230000004927 fusion Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 30
- 238000005516 engineering process Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- RZVHIXYEVGDQDX-UHFFFAOYSA-N 9,10-anthraquinone Chemical compound C1=CC=C2C(=O)C3=CC=CC=C3C(=O)C2=C1 RZVHIXYEVGDQDX-UHFFFAOYSA-N 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000009918 complex formation Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 235000012736 patent blue V Nutrition 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/60—Intended control result
- G05D1/69—Coordinated control of the position or course of two or more vehicles
- G05D1/695—Coordinated control of the position or course of two or more vehicles for maintaining a fixed relative position of the vehicles, e.g. for convoy travelling or formation flight
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D2109/00—Types of controlled vehicles
- G05D2109/20—Aircraft, e.g. drones
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Aviation & Aerospace Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Automation & Control Theory (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及传感器信息融合技术领域,尤其涉及一种基于双目深度点云的无人机高精度相对定位方法。The present invention relates to the field of sensor information fusion technology, and in particular to a high-precision relative positioning method for an unmanned aerial vehicle based on binocular depth point cloud.
背景技术Background technique
无人机(UAV)之间的相对定位技术是在多学科交叉的基础上发展起来的复杂领域,主要受到军事需求的推动。起初,这项技术被设计用于执行复杂的编队飞行和战术任务,以提高军事作战的效率和安全性。随着时间的推移,无人机在民用领域的应用日益增多,如灾害监控、交通管理、农业监测等,这进一步促进了相对定位技术的发展。相对定位技术使无人机能够在没有外部参考点的情况下,准确地掌握彼此的位置和运动状态,这对于执行精确的团队任务至关重要。Relative positioning technology between unmanned aerial vehicles (UAVs) is a complex field developed on the basis of multidisciplinary intersection, mainly driven by military needs. Initially, this technology was designed to perform complex formation flying and tactical missions to improve the efficiency and safety of military operations. Over time, the increasing application of UAVs in civilian fields, such as disaster monitoring, traffic management, agricultural monitoring, etc., has further promoted the development of relative positioning technology. Relative positioning technology enables UAVs to accurately grasp each other's position and motion status without external reference points, which is crucial for performing precise team missions.
在现代战争场景中,无人机在执行超长时间侦察和超长距离打击任务中扮演着越来越重要的角色。然而,这些任务的执行受到无人机载荷和燃油容量的限制,为了克服这些限制,空中加油技术被使用,其目的是在不对无人机结构做重大修改的情况下,显著提升无人机的飞行范围、空中停留时间以及有效载荷。这一技术的应用,显著增强了无人机在长距离飞行、目标侦测和武器携带等任务中的性能。而在空中加油过程中,精确的相对定位技术显得尤为重要,因为加油机和无人机必须在飞行中保持严格的相对位置,以确保加油操作的安全和效率。这种技术的挑战在于,两架无人机需要在高速飞行中实现极高的定位精度和稳定性,同时还要考虑到空气动力学效应和潜在的环境干扰。总的来说,以无人机高精度相对定位为基础的空中加油技术的发展不仅提高了无人机在现代战争中的作战能力,也推动了无人机技术在自动导航和精确控制领域的进步。通过不断的技术创新,无人机的应用范围和效率将持续扩大,为现代军事行动提供更大的灵活性和更强的战略优势。In modern warfare scenarios, drones play an increasingly important role in performing ultra-long-term reconnaissance and ultra-long-range strike missions. However, the execution of these missions is limited by the payload and fuel capacity of drones. In order to overcome these limitations, aerial refueling technology is used, the purpose of which is to significantly improve the flight range, air stay time and payload of drones without making major modifications to the drone structure. The application of this technology has significantly enhanced the performance of drones in tasks such as long-distance flight, target detection and weapon carrying. In the process of aerial refueling, accurate relative positioning technology is particularly important, because the tanker and drone must maintain a strict relative position during flight to ensure the safety and efficiency of the refueling operation. The challenge of this technology is that the two drones need to achieve extremely high positioning accuracy and stability in high-speed flight, while taking into account aerodynamic effects and potential environmental interference. In general, the development of aerial refueling technology based on high-precision relative positioning of drones has not only improved the combat capability of drones in modern warfare, but also promoted the advancement of drone technology in the field of automatic navigation and precision control. Through continuous technological innovation, the application scope and efficiency of drones will continue to expand, providing greater flexibility and stronger strategic advantages for modern military operations.
空中加油的对接阶段要求受油无人机在有限的自主操作权限内,能够自动解析传感器数据并生成相应的控制指令,以实现精确、高效和安全的加油操作。这不仅是一个飞行技术的挑战,也是对无人机自主导航和自动控制系统的考验。The docking phase of aerial refueling requires the receiving drone to automatically analyze sensor data and generate corresponding control instructions within limited autonomous operation permissions to achieve accurate, efficient and safe refueling operations. This is not only a challenge to flight technology, but also a test of the drone's autonomous navigation and automatic control system.
首先,从受油机的姿态控制角度来看,确保对接的安全和稳定性至关重要。这需要无人机具备高度精准的飞行路径控制和速度匹配能力。受油无人机必须能够与加油机高度协调,并且能够实时反馈和调整,以应对动态环境中的任何变化。这不仅要求无人机具备高级的飞行控制系统,还需要它能实时处理大量的传感器数据,以实现精准的飞行动态调整。First, from the perspective of attitude control of the receiving aircraft, it is crucial to ensure the safety and stability of docking. This requires the UAV to have highly accurate flight path control and speed matching capabilities. The receiving UAV must be able to coordinate with the tanker and be able to provide real-time feedback and adjustments to cope with any changes in the dynamic environment. This requires not only that the UAV has an advanced flight control system, but also that it can process a large amount of sensor data in real time to achieve precise flight dynamic adjustments.
同时,加油机锥套的精准检测与定位对于成功的空中加油至关重要。这需要无人机的传感器和导航系统能够精确识别加油机的位置和状态,并据此进行精确的飞行调整。无人机需要能够在多变的气象条件和可能的电子干扰下,准确地与加油机对接。此外,加油过程中可能发生的任何微小误差都必须被实时检测并纠正,以避免碰撞或其他危险情况的发生。At the same time, accurate detection and positioning of the tanker drogue is crucial for successful aerial refueling. This requires the drone's sensors and navigation system to accurately identify the tanker's location and status and make precise flight adjustments accordingly. The drone needs to be able to accurately dock with the tanker under changing weather conditions and possible electronic interference. In addition, any minor errors that may occur during the refueling process must be detected and corrected in real time to avoid collisions or other dangerous situations.
关于锥套的检测和定位,这是空中加油技术中的一个关键环节,但现有技术尚存在一定的局限性。虽然有多种方法被使用来解决这一挑战,但各自都有其限制。例如,惯性测量单元(IMU)和全球定位系统(GPS)导航系统在大部分情况下表现良好,但在某些复杂的飞行环境中,它们可能无法提供足够精确的导航信息。这主要是因为在高速飞行和复杂气象条件下,GPS信号可能会受到干扰,而IMU可能积累较大的误差。依赖于红外和激光雷达(LIDAR)的传感技术虽然能提供精确的距离和速度数据,但它们对环境光线的变化非常敏感,这可能导致在某些特定光照条件下性能不稳定,例如,在强烈的阳光或云层变化下,红外和激光传感器的效果可能会受到影响。并且为满足这些传感器在相对定位方面的特殊要求,可能需要对加油管和锥套进行显著的设计改进。这不仅增加了系统的实施难度,还提高了整个加油系统的复杂性和成本。Regarding the detection and positioning of the drogue, which is a key link in aerial refueling technology, the existing technology still has certain limitations. Although a variety of methods have been used to address this challenge, each has its limitations. For example, the inertial measurement unit (IMU) and global positioning system (GPS) navigation systems perform well in most cases, but in some complex flight environments, they may not provide sufficiently accurate navigation information. This is mainly because GPS signals may be interfered with in high-speed flight and complex meteorological conditions, and IMUs may accumulate large errors. Although sensing technologies that rely on infrared and laser radar (LIDAR) can provide accurate distance and speed data, they are very sensitive to changes in ambient light, which may lead to unstable performance under certain specific lighting conditions. For example, the effectiveness of infrared and laser sensors may be affected under strong sunlight or cloud changes. And in order to meet the special requirements of these sensors in relative positioning, significant design improvements may be required for the refueling pipe and drogue. This not only increases the difficulty of implementing the system, but also increases the complexity and cost of the entire refueling system.
因此,为应对这些挑战,本专利采用基于模型预测控制(MPC)的方法作为一种创新且高效的解决方案。Therefore, to address these challenges, this patent adopts a model predictive control (MPC)-based approach as an innovative and efficient solution.
发明内容Summary of the invention
本发明的目的是提供一种基于双目深度点云的无人机高精度相对定位方法,使无人机在进行空中相对定位,快速且准确地识别目标物,以及实现精确的姿态控制。The purpose of the present invention is to provide a high-precision relative positioning method for UAVs based on binocular depth point clouds, so that the UAVs can perform relative positioning in the air, quickly and accurately identify targets, and achieve precise attitude control.
为实现上述目的,本发明提供了一种基于双目深度点云的无人机高精度相对定位方法,包括以下步骤:To achieve the above object, the present invention provides a high-precision relative positioning method for a UAV based on binocular depth point cloud, comprising the following steps:
S1、使用双目相机捕捉目标物图像;S1, use a binocular camera to capture the target image;
S2、基于步骤S1双目相机捕获的图像数据,利用双目立体视觉算法实时生成整个视野内的深度点云;S2, based on the image data captured by the binocular camera in step S1, using the binocular stereo vision algorithm to generate a depth point cloud within the entire field of view in real time;
S3、对YOLOv7检测模型的主干网络进行优化;S3. Optimize the backbone network of the YOLOv7 detection model;
S4、使用经过优化的YOLOv7模型对从双目相机获取的图像进行精确检测,并生成对应的2D检测框;S4. Use the optimized YOLOv7 model to accurately detect the images obtained from the binocular camera and generate the corresponding 2D detection box;
S5、根据2D检测框在深度点云中定位锥套目标的三维空间位置,生成相应的3D点云检测区域,优化点云稠密区域的计算,并应用均值滤波来提高点云数据的质量和准确性;S5. Locate the 3D spatial position of the cone sleeve target in the depth point cloud according to the 2D detection frame, generate the corresponding 3D point cloud detection area, optimize the calculation of the dense area of the point cloud, and apply mean filtering to improve the quality and accuracy of the point cloud data;
S6、对所确定的目标点进行持续追踪,并在连续图像中存储目标点的位置信息;S6, continuously tracking the determined target point and storing the position information of the target point in continuous images;
S7、通过计算位置信息,得出目标点的平均相对速度;S7, by calculating the position information, the average relative speed of the target point is obtained;
S8、基于模型预测控制算法,准确调整无人机的姿态,对无人机进行控制。S8. Based on the model predictive control algorithm, the attitude of the UAV is accurately adjusted to control the UAV.
优选的,步骤S2实时生成整个视野内深度点云,包括图像的校正、匹配及深度计算,以获得空间中各点的三维坐标,具体如下所示:Preferably, step S2 generates a depth point cloud in the entire field of view in real time, including image correction, matching and depth calculation, to obtain the three-dimensional coordinates of each point in space, as shown below:
S21、图像的校正,具体步骤如下:S21, image correction, the specific steps are as follows:
S211、使用张氏标定法获得摄像头的畸变系数,结合摄像头厂家给出的内参,标定两个摄像头之间的相对位置和姿态,即外参包括旋转和平移;S211, using Zhang's calibration method to obtain the distortion coefficient of the camera, and combining the internal parameters provided by the camera manufacturer to calibrate the relative position and posture between the two cameras, that is, the external parameters include rotation and translation;
S212、根据上述步骤S211获得的参数,计算立体校正所需的变换矩阵;这包括两个旋转矩阵,分别用于左右摄像头图像的校正,以及两个新的投影矩阵。S212. Calculate the transformation matrix required for stereo correction according to the parameters obtained in the above step S211; this includes two rotation matrices, which are used for correcting the left and right camera images respectively, and two new projection matrices.
S213、利用上述旋转矩阵和投影矩阵,对原始图像进行重映射,如下所示:S213, using the above rotation matrix and projection matrix, remap the original image as shown below:
p1'=K1'R1R-1K1 -1p1 p 1 '=K 1 'R 1 R -1 K 1 -1 p 1
p2'=K2'R2(R-1K2 -1p2+T)p 2 '=K 2 'R 2 (R -1 K 2 -1 p 2 +T)
其中,K1和K2分别为左右摄像头的内参矩阵,R和T分别为两个摄像头之间的旋转矩阵和平移向量,K1'、K2'以及R1和R2为需要重新计算的内参矩阵和旋转矩阵,p1'和p2'为校正后的像素位置,使用上述变换,可以将两个摄像头的图像转换到共同的视平面内,并使得同一物体点在两幅图像中的投影具有相同的y坐标;Among them, K 1 and K 2 are the intrinsic parameter matrices of the left and right cameras respectively, R and T are the rotation matrix and translation vector between the two cameras respectively, K 1 ', K 2 ', R 1 and R 2 are the intrinsic parameter matrices and rotation matrices that need to be recalculated, p 1 ' and p 2 ' are the corrected pixel positions. Using the above transformation, the images of the two cameras can be transformed into a common viewing plane, and the projections of the same object point in the two images have the same y coordinate;
S22、基于改进的代价函数,通过引入自适应高斯权重矩阵和归一化,对图像进行匹配,公式如下:S22. Based on the improved cost function, the image is matched by introducing an adaptive Gaussian weight matrix and normalization. The formula is as follows:
其中,W为窗口区域,用于定义在每个像素周围考虑的区域大小;IL,IR为两个待比较的图像;p,q分别为图像IL,IR中的对应像素点,i,j为窗口区域内相对位置偏移量;W(i,j,p)为自适应高斯权重,(p+i,p+j)为偏移后的像素点;Where W is the window area, which is used to define the size of the area considered around each pixel; IL and IR are two images to be compared; p and q are the corresponding pixels in images IL and IR , respectively; i and j are the relative position offsets in the window area; W(i,j,p) is the adaptive Gaussian weight, and (p+i,p+j) is the pixel after offset;
S23、深度计算公式如下:S23, depth calculation formula is as follows:
其中,Z是像素的深度,f为摄像头焦距;B是两个摄像头之间的基线距离,即两个摄像头的水平距离;D是视差值,即同一场景点在两个摄像头成像上的水平位置差;Where Z is the depth of the pixel, f is the focal length of the camera; B is the baseline distance between the two cameras, that is, the horizontal distance between the two cameras; D is the disparity value, that is, the horizontal position difference of the same scene point in the two camera images;
S24、将2D图像坐标和深度值统一转换为3D空间坐标,公式如下:S24, convert the 2D image coordinates and depth values into 3D space coordinates uniformly, the formula is as follows:
其中,(x,y)为图像平面中像素点的坐标,(X,Y,Z)为世界坐标系中像素点的坐标,(cx,cy)为图像的光心坐标。Among them, (x, y) is the coordinate of the pixel point in the image plane, (X, Y, Z) is the coordinate of the pixel point in the world coordinate system, and (c x , c y ) is the coordinate of the optical center of the image.
优选的,在步骤S3对YOLOv7检测模型的主干网络进行优化中,具体步骤如下:Preferably, in step S3, in optimizing the backbone network of the YOLOv7 detection model, the specific steps are as follows:
S31、设置卷积层权重阈值,并移除小于该阈值的权重,公式如下:S31. Set the convolution layer weight threshold and remove weights less than the threshold. The formula is as follows:
其中,ωi,j'为剪枝后的权重矩阵,θ为预设的阈值,ωi,j为权重矩阵中第i行第j列的元素;Wherein, ω i,j ' is the weight matrix after pruning, θ is the preset threshold, and ω i,j is the element in the i-th row and j-th column of the weight matrix;
S32、使用CBAM模块进行空间注意力加权,并调整CBAM的权重分配方式,如下所示:S32. Use the CBAM module to perform spatial attention weighting and adjust the weight distribution method of CBAM as follows:
Scone(x,y)=σ(fcentre(I(x,y))+fdark(I(x,y)))S cone (x,y)=σ(f centre (I(x,y))+f dark (I(x,y)))
其中,σ为激活函数,fcentre和fdark分别对应加油锥套中心区域和深色色块的注意力权重;Where σ is the activation function, f centre and f dark correspond to the attention weights of the center area of the refueling drogue and the dark block respectively;
S33、将空间注意力图Scone使用逐元素乘法应用于原始特征图F,如下所示:S33. Apply the spatial attention map S cone to the original feature map F using element-wise multiplication as follows:
S34、采用深度可分离卷积来更加高效地提取加油锥套的特征,使用中等尺度的特征图来进行检测,公式如下:S34. Use deep separable convolution to more efficiently extract the features of the refueling drogue, and use medium-scale feature maps for detection. The formula is as follows:
Pcone=Fmid P cone = F mid
其中,Pcone是用于检测加油锥套的特征图,Fmid是网络中尺度适中的特征图。Among them, P cone is the feature map used to detect the refueling cone sleeve, and F mid is the feature map with moderate scale in the network.
优选的,在步骤S5中,具体步骤如下:Preferably, in step S5, the specific steps are as follows:
S51、根据2D检测框在深度点云中定位锥套目标的三维空间位置,并生成相应的3D点云检测区域,剔除远离摄像机的物体或过于接近的物体,如下所示:S51, locate the three-dimensional spatial position of the cone sleeve target in the depth point cloud according to the 2D detection frame, and generate a corresponding 3D point cloud detection area, and remove objects far away from the camera or objects that are too close, as shown below:
其中,Droi(x,y)表示检测区域的点云深度值;Wherein, D roi (x, y) represents the point cloud depth value of the detection area;
S52、优化点云稠密区域的计算,公式如下:S52. Optimize the calculation of dense area of point cloud. The formula is as follows:
其中,l为指示函数,为给定的条件生成一个二进制输出,如果条件为真,它返回1,否则返回0;Where l is an indicator function that generates a binary output for a given condition. If the condition is true, it returns 1, otherwise it returns 0.
S53、对有效点云进行均值滤波,公式如下:S53, perform mean filtering on the valid point cloud, the formula is as follows:
优选的,在步骤S6存储目标点的位置信息中,计算稠密点云质心位置作为目标点,公式如下:Preferably, in step S6, in storing the position information of the target point, the centroid position of the dense point cloud is calculated as the target point, and the formula is as follows:
其中,(Xcenter,Ycenter,Zcenter)是3D空间中的相对目标点。Among them, (X center ,Y center ,Z center ) is the relative target point in 3D space.
优选的,在步骤S7计算目标点的平均速度,如下所示:Preferably, the average speed of the target point is calculated in step S7 as follows:
其中,pi=(xi,yi,zi)为第i帧图像中目标点的位置坐标。Wherein, p i =(x i ,y i , zi ) is the position coordinate of the target point in the i-th frame image.
优选的,在步骤S8构建无人机的状态和控制输入建模中,基于模型预测控制算法,无人机的状态标量包括位置(x,y,z)、偏航角θ、俯仰角ψ;Preferably, in step S8, in constructing the state and control input modeling of the UAV, based on the model predictive control algorithm, the state scalars of the UAV include position (x, y, z), yaw angle θ, and pitch angle ψ;
控制标量包括:速度v、偏航速率yaw、和滚转速率pitch;则无人机的动力学模型可以表示为:The control scalars include: velocity v, yaw rate yaw, and roll rate pitch; the dynamic model of the drone can be expressed as:
优选的,基于无人机的动力学模型,针对空中对接加油场景,目标函数如下所示:Preferably, based on the dynamic model of the UAV, for the aerial docking and refueling scenario, the objective function is as follows:
S811、首先,计算最小化无人机与目标点之间的距离,公式如下:S811. First, calculate and minimize the distance between the drone and the target point. The formula is as follows:
其中,(Xcenter,k,Ycenter,k,Zcenter,k)为当前目标点相对于无人机的位置,ωpos是位置误差的权重;Among them, (X center,k ,Y center,k ,Z center,k ) is the position of the current target point relative to the drone, and ω pos is the weight of the position error;
S812、其次,最小化无人机的飞行速度变化率,公式如下:S812. Secondly, minimize the change rate of the UAV's flight speed. The formula is as follows:
其中ωctrl是控制输入变化的权重;Where ω ctrl is the weight that controls the input change;
S813、最后,目标函数如下所示:S813. Finally, the objective function is as follows:
优选的,基于无人机的动力学模型,针对多无人机相对定位场景,目标函数如下所示:Preferably, based on the UAV dynamics model, for the multi-UAV relative positioning scenario, the objective function is as follows:
S821、通过计算无人机当前位置和目标位置之间的欧几里得距离来实现跟踪误差,如下所示:S821, the tracking error is achieved by calculating the Euclidean distance between the current position of the drone and the target position, as shown below:
其中,Xk是无人机第k个时间步的位置,ω1是权重因子;Where Xk is the position of the UAV at the kth time step, and ω1 is the weight factor;
S822、视场角修正,如下所示:S822, field of view correction, as follows:
其中,ω2是权重因子,ellipse是视场角和无人机位置的函数;此函数可以根据无人机的位置、方向以及视场角度来计算;Among them, ω 2 is the weight factor, and ellipse is a function of the field of view angle and the position of the drone; this function can be calculated based on the position, direction and field of view angle of the drone;
S823、在3D空间中,将视场范围视作一个椭圆体,目标位于该椭圆体内部,椭圆函数公式如下:S823. In 3D space, the field of view is regarded as an ellipsoid, and the target is located inside the ellipsoid. The elliptic function formula is as follows:
其中,(x,y,z)是无人机的位置,(xu,yu,zu)是目标点的位置。Among them, (x,y,z) is the position of the UAV, and ( xu , yu , zu ) is the position of the target point.
因此,本发明采用上述一种基于双目深度点云的无人机高精度相对定位方法,有益效果如下:Therefore, the present invention adopts the above-mentioned UAV high-precision relative positioning method based on binocular depth point cloud, and the beneficial effects are as follows:
1、使用检测框内的点云稠密区域的质心代替检测框的中心点作为目标点。在实际的三维空间中,物体的形状和姿态可能导致其表面的一部分更接近相机,并且目标不一定可以充满检测框,使用质心可以更准确地表示物体的实际位置,同时避免检测框抖动带来的检测抖动。1. Use the centroid of the dense point cloud area in the detection frame instead of the center point of the detection frame as the target point. In the actual three-dimensional space, the shape and posture of the object may cause part of its surface to be closer to the camera, and the target may not fill the detection frame. Using the centroid can more accurately represent the actual position of the object and avoid detection jitter caused by detection frame jitter.
2、在目标移动或旋转时,质心的位置变化比检测框中心的位置变化更平滑,从而提供更稳定的目标追踪。2. When the target moves or rotates, the position change of the center of mass is smoother than the position change of the detection box center, thus providing more stable target tracking.
3、通过考虑未来几个时间步(离散时间间隔)内的无人机状态和环境变化,实现先进的路径规划和无人机对接,通过不断更新目标位置,提出的MPC方案使无人机能够动态跟踪移动目标,适用于空中加油的场景,同时对搜索与救援、监视等应用也尤为重要。3. By considering the UAV state and environmental changes in the next few time steps (discrete time intervals), advanced path planning and UAV docking are achieved. By continuously updating the target position, the proposed MPC scheme enables the UAV to dynamically track moving targets, which is suitable for aerial refueling scenarios. It is also particularly important for search and rescue, surveillance and other applications.
4、特别考虑了有限视野的可见性约束。这确保了无人机在执行任务跟踪时,目标始终保持在相机视野内,MPC控制器能够以较高频率生成控制指令,这在多数嵌入式计算平台上是可行的,表明该方案适合实时应用。4. Special consideration is given to the visibility constraints of limited field of view. This ensures that the target always remains within the camera field of view when the UAV is performing mission tracking. The MPC controller can generate control instructions at a high frequency, which is feasible on most embedded computing platforms, indicating that the scheme is suitable for real-time applications.
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是一种基于双目深度点云的无人机高精度相对定位方法的无人机空中加油对接的流程图;FIG1 is a flow chart of a UAV aerial refueling docking method based on a binocular depth point cloud high-precision relative positioning method for UAVs;
图2是一种基于双目深度点云的无人机高精度相对定位方法的改进SAD算法对双目图像权重的视差图;Figure 2 is a disparity map of binocular image weights using an improved SAD algorithm for a high-precision relative positioning method for UAVs based on binocular depth point clouds;
图3是一种基于双目深度点云的无人机高精度相对定位方法的改进SAD算法对深色色块权重的分配示意图;FIG3 is a schematic diagram of the allocation of dark color block weights by an improved SAD algorithm of a high-precision relative positioning method for UAVs based on binocular depth point clouds;
图4是一种基于双目深度点云的无人机高精度相对定位方法的改进YOLOv7识别算法的框图;FIG4 is a block diagram of an improved YOLOv7 recognition algorithm for a high-precision relative positioning method of a UAV based on binocular depth point cloud;
图5是一种基于双目深度点云的无人机高精度相对定位方法的对无人机目标物的识别图;FIG5 is a diagram of identifying a target object of a UAV using a high-precision relative positioning method for a UAV based on binocular depth point cloud;
图6是一种基于双目深度点云的无人机高精度相对定位方法的MPC控制无人机追踪动态目标仿真轨迹。FIG6 is a simulation trajectory of an MPC-controlled UAV tracking a dynamic target using a high-precision relative positioning method for UAVs based on binocular depth point clouds.
具体实施方式Detailed ways
以下通过附图和实施例对本发明的技术方案作进一步说明。The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
如图1所示,一种基于双目深度点云的无人机高精度相对定位方法,包括以下步骤:As shown in FIG1 , a high-precision relative positioning method for a UAV based on binocular depth point cloud includes the following steps:
S1、使用双目相机捕捉加油机以及锥套图像;S1, use a binocular camera to capture the images of the refueling machine and the drogue;
S2、基于步骤S1双目相机捕获的图像数据,利用双目立体视觉算法实时生成整个视野内的深度点云;S2, based on the image data captured by the binocular camera in step S1, using the binocular stereo vision algorithm to generate a depth point cloud within the entire field of view in real time;
S3、对YOLOv7检测模型的主干网络进行优化;S3. Optimize the backbone network of the YOLOv7 detection model;
S4、使用经过优化的YOLOv7模型对从双目相机获取的图像进行精确检测,并生成对应的2D检测框;S4. Use the optimized YOLOv7 model to accurately detect the images obtained from the binocular camera and generate the corresponding 2D detection box;
S5、根据2D检测框在深度点云中定位锥套目标的三维空间位置,生成相应的3D点云检测区域,优化点云稠密区域的计算,并应用均值滤波来提高点云数据的质量和准确性;S5. Locate the 3D spatial position of the cone sleeve target in the depth point cloud according to the 2D detection frame, generate the corresponding 3D point cloud detection area, optimize the calculation of the dense area of the point cloud, and apply mean filtering to improve the quality and accuracy of the point cloud data;
S6、对所确定的目标点进行持续追踪,并在连续10帧图像中存储目标点的位置信息;S6, continuously tracking the determined target point, and storing the position information of the target point in 10 consecutive frames of images;
S7、通过计算位置信息,得出目标点在10帧间的平均相对速度;S7, by calculating the position information, the average relative speed of the target point between 10 frames is obtained;
S8、基于模型预测控制算法,准确调整无人机的姿态,对无人机进行控制。S8. Based on the model predictive control algorithm, the attitude of the UAV is accurately adjusted to control the UAV.
实施例Example
S1、使用双目相机在空中加油对接场景中捕捉加油机以及锥套图像。S1. Use a binocular camera to capture images of the tanker and drogue in an aerial refueling docking scenario.
在ROS框架下,双目相机分别创建节点usb_cam_node1,usb_c am_node2,其中1和2为双目相机节点编号,节点为ROS框架下描述不同部分功能的独立进程。双目相机具有图像捕捉功能的摄像头传感器,分别发布cam_image1和cam_image2的RGB图像消息。In the ROS framework, the binocular camera creates nodes usb_cam_node1 and usb_c am_node2 respectively, where 1 and 2 are the node numbers of the binocular camera, and the node is an independent process that describes different functions in the ROS framework. The binocular camera has a camera sensor with image capture function, and publishes RGB image messages of cam_image1 and cam_image2 respectively.
S2、基于双目相机捕获的图像数据,利用双目立体视觉算法实时生成整个视野内的深度点云。该步骤包括图像的校正、匹配及深度计算,以获得空间中各点的三维坐标。S2. Based on the image data captured by the binocular camera, the binocular stereo vision algorithm is used to generate the depth point cloud in the entire field of view in real time. This step includes image correction, matching and depth calculation to obtain the three-dimensional coordinates of each point in space.
S21、图像的校正具体步骤如下:S21. The specific steps of image correction are as follows:
S211、首先进行图像的校正,使用“张氏标定法”获得摄像头的畸变系数,结合摄像头厂家给出的内参,标定两个摄像头之间的相对位置和姿态,即外参包括旋转和平移。S211. First, the image is calibrated. The distortion coefficient of the camera is obtained using the Zhang calibration method. Combined with the internal parameters provided by the camera manufacturer, the relative position and posture between the two cameras are calibrated, that is, the external parameters include rotation and translation.
S212、根据上述步骤S211获得的参数,计算立体校正所需的变换矩阵。其中,变换矩阵包括两个旋转矩阵,分别用于左右摄像头图像的校正,以及两个新的投影矩阵。S212: Calculate the transformation matrix required for stereoscopic correction according to the parameters obtained in step S211, wherein the transformation matrix includes two rotation matrices, which are used for correcting the left and right camera images respectively, and two new projection matrices.
S213、最后利用上述旋转矩阵和投影矩阵,对原始图像进行重映射,如下所示:S213. Finally, the original image is remapped using the above rotation matrix and projection matrix, as shown below:
p1'=K1'R1R-1K1 -1p1 p 1 '=K 1 'R 1 R -1 K 1 -1 p 1
p2'=K2'R2(R-1K2 -1p2+T)p 2 '=K 2 'R 2 (R -1 K 2 -1 p 2 +T)
其中,K1和K2分别为左右摄像头的内参矩阵,R和T分别为两个摄像头之间的旋转矩阵和平移向量,K1'、K2'以及R1和R2为需要重新计算的内参矩阵和旋转矩阵,p1'和p2'为校正后的像素位置,使用上述变换,可以将两个摄像头的图像转换到共同的视平面内,并使得同一物体点在两幅图像中的投影具有相同的y坐标。Among them, K 1 and K 2 are the intrinsic parameter matrices of the left and right cameras respectively, R and T are the rotation matrix and translation vector between the two cameras respectively, K 1 ', K 2 ', R 1 and R 2 are the intrinsic parameter matrices and rotation matrices that need to be recalculated, p 1 ' and p 2 ' are the corrected pixel positions. Using the above transformation, the images of the two cameras can be transformed into a common viewing plane, and the projections of the same object point in the two images have the same y coordinate.
上面的步骤可以使用OpenCV库中的立体校正函数自动完成。The above steps can be automatically completed using the stereo correction function in the OpenCV library.
S22、基于改进的代价函数,通过引入自适应高斯权重矩阵和归一化,实现图像匹配。S22. Based on the improved cost function, image matching is achieved by introducing an adaptive Gaussian weight matrix and normalization.
如图2所示,视差图表示了两幅图像之间的像素偏移。对于左图中的每个像素,在右图中一定范围内搜索其对应的像素。这个搜索的过程涉及到特殊的空中加油视觉环境,使用改进的SAD(Sum of A bsolute Differences)代价函数来找到最佳匹配位置,以获取视差图中该像素的偏移量或视差值。As shown in Figure 2, the disparity map represents the pixel offset between the two images. For each pixel in the left image, the corresponding pixel is searched within a certain range in the right image. This search process involves a special aerial refueling visual environment, and an improved SAD (Sum of Absolute Differences) cost function is used to find the best matching position to obtain the offset or disparity value of the pixel in the disparity map.
以下是改进的代价函数的主要特点:The following are the main features of the improved cost function:
1、自适应高斯权重矩阵:代价函数引入了自适应高斯权重矩阵,在像素匹配的过程中,会考虑每个像素周围的环境,特别是,在匹配窗口内,深色像素区域将获得比蓝色或白色背景像素更高的权重,如图3所示,有助于在复杂光照条件下仍能够准确匹配像素。1. Adaptive Gaussian weight matrix: The cost function introduces an adaptive Gaussian weight matrix. During the pixel matching process, the environment around each pixel will be considered. In particular, within the matching window, the dark pixel area will receive a higher weight than the blue or white background pixel, as shown in Figure 3. This helps to accurately match pixels under complex lighting conditions.
2、归一化:通过对像素值进行归一化处理,有利于减小光照和对比度对于图像匹配的影响,代价函数可以更好地处理不同光照条件下的图像,确保匹配的稳定性和准确性。2. Normalization: Normalizing pixel values helps reduce the impact of illumination and contrast on image matching. The cost function can better handle images under different illumination conditions and ensure the stability and accuracy of matching.
改进后的代价函数,如下所示:The improved cost function is as follows:
其中,W为窗口区域,用于定义在每个像素周围用于对比的区域大小;IL,IR为两个待比较的图像;p,q分别为图像IL,IR中的对应像素点,i,j为窗口区域内相对位置偏移量;W(i,j,p)表示自适应高斯权重,如下所示:Where W is the window area, which is used to define the size of the area around each pixel for comparison; IL and IR are two images to be compared; p and q are the corresponding pixels in images IL and IR , respectively; i and j are the relative position offsets in the window area; W(i, j, p) represents the adaptive Gaussian weight, as shown below:
W(i,j,p)=G(i,j)×f(p+i,p+j)W(i,j,p)=G(i,j)×f(p+i,p+j)
其中,(p+i,p+j)为偏移后的像素点,G(i,j)为标准的高斯权重函数,如下所示:Among them, (p+i,p+j) is the pixel after offset, and G(i,j) is the standard Gaussian weight function, as shown below:
其中,σ为高斯函数的标准差,控制权重分布的范围;函数f(x)则是对高斯权重进行的像素值自适应调整,如下所示:Among them, σ is the standard deviation of the Gaussian function, which controls the range of weight distribution; the function f(x) is the pixel value adaptive adjustment of the Gaussian weight, as shown below:
其中,α,β为根据具体光照环境设定的自适应参数,L(p)为基于人眼对不同颜色的感知灵敏度,加权计算图像灰度值的函数,如下所示:Among them, α and β are adaptive parameters set according to the specific lighting environment, and L(p) is a function that weights and calculates the grayscale value of the image based on the human eye's perception sensitivity to different colors, as shown below:
L(p)=0.299Rp+0.587Gp+0.114BpL(p)=0.299Rp+0.587Gp+0.114Bp
其中,minL和maxL为设定的灰度值区间,可以简单的设置为0和255;当像素块颜色更深时,自适应参数更偏向β;当像素块为天蓝色或白色时,自适应参数更偏向α。Among them, minL and maxL are the set grayscale value intervals, which can be simply set to 0 and 255; when the pixel block is darker, the adaptive parameter is more biased towards β; when the pixel block is sky blue or white, the adaptive parameter is more biased towards α.
S23、在得到视差图后,每个像素的深度使用如下公式得出:S23. After obtaining the disparity map, the depth of each pixel is obtained using the following formula:
其中,Z为像素的深度,f为摄像头焦距,B为两个摄像头之间的基线距离,即两个摄像头的水平距离;D是视差值,即同一场景点在两个摄像头成像上的水平位置差。Among them, Z is the depth of the pixel, f is the focal length of the camera, B is the baseline distance between the two cameras, that is, the horizontal distance between the two cameras; D is the disparity value, that is, the horizontal position difference of the same scene point in the two camera images.
S24、将2D图像坐标和深度值统一转换为3D空间坐标,公式如下:S24, convert the 2D image coordinates and depth values into 3D space coordinates uniformly, the formula is as follows:
其中,(x,y)为图像平面中像素点的坐标,(X,Y,Z)是世界坐标系中像素点的坐标,(cx,cy)为图像的光心(主点)坐标,是相机的内参,这样为每个图像像素得到一个3D坐标,从而形成一个深度点云。Among them, (x, y) is the coordinate of the pixel point in the image plane, (X, Y, Z) is the coordinate of the pixel point in the world coordinate system, (c x , c y ) is the coordinate of the optical center (principal point) of the image, which is the intrinsic parameter of the camera. In this way, a 3D coordinate is obtained for each image pixel, thus forming a depth point cloud.
S3、对YOLOv7检测模型的主干网络进行优化。S3. Optimize the backbone network of the YOLOv7 detection model.
如图4所示,引入注意力机制以提高模型对锥套特征的识别能力;改进池化层,以增强模型在处理不同尺寸锥套时的鲁棒性;优化损失函数,以提高检测精度;改进后的YOLOv7检测模型适应无人机计算平台的实时性和轻量化需求。As shown in Figure 4, the attention mechanism is introduced to improve the model's ability to recognize cone sleeve features; the pooling layer is improved to enhance the robustness of the model when processing cone sleeves of different sizes; the loss function is optimized to improve the detection accuracy; the improved YOLOv7 detection model adapts to the real-time and lightweight requirements of the UAV computing platform.
S31、针对空中加油场景的特殊性,修改YOLOv7主干网络,在CSPDarkNet中添加新型卷积层,删除冗余的卷积层和全连接层,以精简模型结构;对模型进行剪枝,为每一层的权重设置阈值,如果权重的绝对值小于阈值,则将其删除或置零,公式如下:S31. In view of the particularity of the aerial refueling scenario, the YOLOv7 backbone network is modified, a new convolutional layer is added to CSPDarkNet, and redundant convolutional layers and fully connected layers are deleted to simplify the model structure; the model is pruned, and a threshold is set for the weight of each layer. If the absolute value of the weight is less than the threshold, it is deleted or set to zero. The formula is as follows:
其中,ωi,j'为剪枝后的权重矩阵,θ为预设的阈值,ωi,j为权重矩阵中第i行第j列的元素。Among them, ω i,j ' is the weight matrix after pruning, θ is the preset threshold, and ω i,j is the element in the i-th row and j-th column in the weight matrix.
通过上述操作,模型得以轻量化,更适用于实时空中飞行任务,这不仅提高了模型的计算效率,还有助于降低硬件资源需求,以满足无人机执行视觉任务的要求,例如锥套检测和相对位姿跟踪。Through the above operations, the model is lightweight and more suitable for real-time aerial flight missions, which not only improves the computational efficiency of the model, but also helps reduce the hardware resource requirements to meet the requirements of UAV visual tasks such as drogue detection and relative pose tracking.
S32、为了确保模型更加关注加油锥套的中心区域和深色色块,使用CBAM(Convolutional Block Attention Module)模块进行空间注意力加权,并且考虑到背景色大部分为蓝色天空,以此调整CBA M的权重分配方式:S32. In order to ensure that the model pays more attention to the central area and dark blocks of the refueling drogue, the Convolutional Block Attention Module (CBAM) module is used for spatial attention weighting. Considering that the background color is mostly blue sky, the weight distribution method of CBAM is adjusted as follows:
Scone(x,y)=σ(fcentre(I(x,y))+fdark(I(x,y)))S cone (x,y)=σ(f centre (I(x,y))+f dark (I(x,y)))
其中,σ是激活函数,fcentre和fdark分别对应加油锥套中心区域和深色色块的注意力权重。Among them, σ is the activation function, f centre and f dark correspond to the attention weights of the center area and dark block of the refueling cone sleeve respectively.
S33、将空间注意力图Scone使用逐元素乘法应用于原始特征图F,如下所示:S33. Apply the spatial attention map S cone to the original feature map F using element-wise multiplication as follows:
S34、由于检测目标和使用场景单一,使用深度可分离卷积来更加高效地提取加油锥套的特征。同时,考虑到加油锥套的大小相对固定,直接使用中等尺度的特征图来进行检测,而不需要完整的特征金字塔结构,公式如下:S34. Due to the single detection target and usage scenario, a depth-separable convolution is used to more efficiently extract the features of the refueling drogue. At the same time, considering that the size of the refueling drogue is relatively fixed, a medium-scale feature map is directly used for detection without the need for a complete feature pyramid structure. The formula is as follows:
Pcone=Fmid P cone = F mid
其中,Pcone是用于检测加油锥套的特征图,Fmid是网络中尺度适中的特征图。Among them, P cone is the feature map used to detect the refueling cone sleeve, and F mid is the feature map with moderate scale in the network.
S4、使用经过优化的YOLOv7模型对从双目相机获取的图像进行精确检测。该模型能够在双目图像中准确识别出目标,并生成对应的2D检测框,如图5所示;S4. Use the optimized YOLOv7 model to accurately detect the images obtained from the binocular camera. The model can accurately identify the target in the binocular image and generate the corresponding 2D detection box, as shown in Figure 5;
S5、根据2D检测框在深度点云中定位锥套目标的三维空间位置,并生成相应的3D点云检测区域,优化点云稠密区域的计算,并应用均值滤波来提高点云数据的质量和准确性。S5. Locate the 3D spatial position of the cone sleeve target in the depth point cloud according to the 2D detection frame, generate the corresponding 3D point cloud detection area, optimize the calculation of the dense area of the point cloud, and apply mean filtering to improve the quality and accuracy of the point cloud data.
S51、从完整的深度图中提取与2D检测框对应的区域,子区域外的值被置为0,减少后续处理的数据量,并确保专注于可能包含目标的区域。定义深度范围,用于剔除远离摄像机的物体或过于接近的物体,如下所示:S51. Extract the area corresponding to the 2D detection box from the complete depth map. The values outside the sub-area are set to 0 to reduce the amount of data for subsequent processing and ensure that the focus is on the area that may contain the target. Define the depth range to eliminate objects far away from the camera or objects that are too close, as shown below:
其中,Droi(x,y)表示检测区域的点云深度值。Among them, D roi (x, y) represents the point cloud depth value of the detection area.
S52、稠密区域是指点云中点较多的区域,这些区域通常代表物体的表面,而非物体的空间或噪声。通过在每个点周围的一个小窗口内计数非零点来估计该点的局部密度。窗口的大小由r决定,它表示窗口的半径,优化点云稠密区域的计算,公式如下S52, dense areas refer to areas with more points in the point cloud. These areas usually represent the surface of the object rather than the space or noise of the object. The local density of the point is estimated by counting non-zero points in a small window around each point. The size of the window is determined by r, which represents the radius of the window. The calculation of the dense area of the point cloud is optimized as follows:
其中,l为指示函数,作用是为给定的条件生成一个二进制输出;具体来说,如果条件为真,它返回1,否则返回0。Here, l is an indicator function that generates a binary output for a given condition; specifically, it returns 1 if the condition is true and 0 otherwise.
S53、为了减少噪声和异常值的影响,对有效点云进行均值滤波,公式如下:S53. In order to reduce the influence of noise and outliers, the effective point cloud is filtered by mean, and the formula is as follows:
S6、对所确定的目标点进行持续追踪,并在连续图像中存储目标点的位置信息,以稠密点云质心位置作为目标点,如下所示:S6. Continuously track the determined target point and store the position information of the target point in the continuous image, taking the centroid position of the dense point cloud as the target point, as shown below:
其中,(Xcenter,Ycenter,Zcenter)是3D空间中的相对目标点。Among them, (X center ,Y center ,Z center ) is the relative target point in 3D space.
S7、通过计算位置信息,得出目标点的平均速度;S7, by calculating the position information, the average speed of the target point is obtained;
针对单目标识别场景,使用卡尔曼滤波对检测算法中的噪声进行平滑处理,降低噪声对目标识别的干扰。此外,卡尔曼滤波在暂时丢失目标时,也能预测目标点的帧间位置,在无法直接观测到目标时,仍能提供一个连续且一致的目标位置估计。For single target recognition scenarios, Kalman filtering is used to smooth the noise in the detection algorithm to reduce the interference of noise on target recognition. In addition, Kalman filtering can also predict the inter-frame position of the target point when the target is temporarily lost, and can still provide a continuous and consistent target position estimate when the target cannot be directly observed.
为了进一步减少目标点抖动带来的影响,该步骤还包括存储连续10帧的估计位置数据。目标点在10帧图像中的平均速度计算如下:In order to further reduce the impact of target point jitter, this step also includes storing 10 consecutive frames of estimated position data. The average speed of the target point in 10 frames of images is calculated as follows:
其中,pi=(xi,yi,zi)为第i帧图像中目标点的位置坐标。Wherein, p i =(x i ,y i , zi ) is the position coordinate of the target point in the i-th frame image.
这一计算不仅平滑了目标位置的波动,还提供了目标运动的关键动态信息。This calculation not only smooths out fluctuations in the target's position, but also provides critical dynamic information about the target's motion.
S8、基于模型预测控制算法,准确调整无人机的姿态,对无人机进行控制。S8. Based on the model predictive control algorithm, the attitude of the UAV is accurately adjusted to control the UAV.
基于模型预测控制MPC算法,无人机自动检测姿态角后,获得俯仰角和偏航角,构建无人机的状态和控制输入建模,MPC控制无人机追踪动态目标仿真轨迹,如图6所示。Based on the model predictive control MPC algorithm, the UAV automatically detects the attitude angle, obtains the pitch angle and yaw angle, builds the state and control input modeling of the UAV, and controls the UAV to track the dynamic target simulation trajectory through MPC, as shown in Figure 6.
无人机的状态标量包括:位置(x,y,z)、偏航角θ、俯仰角ψ;控制标量包括:速度v、偏航速率yaw、和滚转速率pitch;则无人机的动力学模型可以表示为:The state scalars of the drone include: position (x, y, z), yaw angle θ, pitch angle ψ; the control scalars include: velocity v, yaw rate yaw, and roll rate pitch; the dynamic model of the drone can be expressed as:
S81、针对空中对接加油场景;S81, for aerial docking and refueling scenarios;
S811、首先,最小化无人机与目标点之间的距离,如下所示:S811. First, minimize the distance between the drone and the target point as follows:
其中,(Xcenter,k,Ycenter,k,Zcenter,k)为当前目标点相对于无人机的位置,ωpos是位置误差的权重。Among them, (X center,k ,Y center,k ,Z center,k ) is the position of the current target point relative to the drone, and ω pos is the weight of the position error.
S812、其次,为了确保飞行器飞行平稳,需要最小化无人机的飞行速度变化率,则公式如下:S812. Secondly, in order to ensure the smooth flight of the aircraft, the flight speed change rate of the drone needs to be minimized. The formula is as follows:
其中,ωvel是速度变化的权重;为了保证控制输入(如偏航速率和俯仰速率)的平滑性,则公式如下:Among them, ω vel is the weight of velocity change; in order to ensure the smoothness of control input (such as yaw rate and pitch rate), the formula is as follows:
其中,ωctrl是控制输入变化的权重。Among them, ω ctrl is the weight that controls the input change.
S813、最后,针对空中对接加油场景,目标函数表示为:S813. Finally, for the aerial docking and refueling scenario, the objective function is expressed as:
S82、针对多无人机相对定位场景;S82, for the relative positioning scenario of multiple drones;
目标函数分为以下几个部分:The objective function is divided into the following parts:
S821、通过计算无人机当前位置和目标位置之间的欧几里得距离来实现跟踪误差,确保无人机跟随目标路径,旨在最小化无人机与目标之间的可接受距离差值。跟踪误差计算公式如下:S821. Tracking error is achieved by calculating the Euclidean distance between the current position of the drone and the target position to ensure that the drone follows the target path, aiming to minimize the acceptable distance difference between the drone and the target. The tracking error calculation formula is as follows:
其中,Xk是无人机第k个时间步的位置,ω1是权重因子。Where Xk is the position of the UAV at the kth time step and ω1 is the weight factor.
S822、视场角修正,确保目标始终保持在无人机相机的视场范围内。视场角修正计算公式如下:S822, field of view correction, to ensure that the target always remains within the field of view of the drone camera. The field of view correction calculation formula is as follows:
其中,ω2是权重因子,ellipse是视场角和无人机位置的函数;此函数可以根据无人机的位置、方向以及视场角度来计算。Among them, ω 2 is the weight factor, and ellipse is a function of the field of view angle and the position of the drone; this function can be calculated based on the position, direction and field of view angle of the drone.
S823、在3D空间中,将视场范围视作一个椭圆体,目标应位于椭圆体内部。椭圆函数的公式如下:S823. In 3D space, the field of view is considered as an ellipsoid, and the target should be located inside the ellipsoid. The formula of the ellipse function is as follows:
其中,(x,y,z)是无人机的位置,(xu,yu,zu)是目标点的位置。Among them, (x,y,z) is the position of the UAV, and ( xu , yu , zu ) is the position of the target point.
因此,本发明采用上述一种基于双目深度点云的无人机高精度相对定位方法,使无人机在进行空中相对定位,快速且准确地识别目标物,以及实现精确的姿态控制。Therefore, the present invention adopts the above-mentioned high-precision relative positioning method of UAV based on binocular depth point cloud, so that the UAV can perform relative positioning in the air, quickly and accurately identify the target object, and achieve precise attitude control.
最后应说明的是:以上实施例仅用以说明本发明的技术方案而非对其进行限制,尽管参照较佳实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对本发明的技术方案进行修改或者等同替换,而这些修改或者等同替换亦不能使修改后的技术方案脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410312332.7A CN118210329A (en) | 2024-03-19 | 2024-03-19 | Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410312332.7A CN118210329A (en) | 2024-03-19 | 2024-03-19 | Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118210329A true CN118210329A (en) | 2024-06-18 |
Family
ID=91454903
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410312332.7A Pending CN118210329A (en) | 2024-03-19 | 2024-03-19 | Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118210329A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118896593A (en) * | 2024-09-27 | 2024-11-05 | 中电信无人科技(江苏)有限公司 | A target positioning method based on UAV oblique photography |
CN118967532A (en) * | 2024-10-21 | 2024-11-15 | 南京信息工程大学 | An improved posture correction method for unmanned vehicles based on depth estimation |
-
2024
- 2024-03-19 CN CN202410312332.7A patent/CN118210329A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118896593A (en) * | 2024-09-27 | 2024-11-05 | 中电信无人科技(江苏)有限公司 | A target positioning method based on UAV oblique photography |
CN118967532A (en) * | 2024-10-21 | 2024-11-15 | 南京信息工程大学 | An improved posture correction method for unmanned vehicles based on depth estimation |
CN118967532B (en) * | 2024-10-21 | 2024-12-17 | 南京信息工程大学 | Unmanned vehicle attitude correction method based on depth estimation improvement |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11073389B2 (en) | Hover control | |
CN110865650B (en) | Adaptive estimation method of UAV pose based on active vision | |
CN102298070B (en) | Method for assessing the horizontal speed of a drone, particularly of a drone capable of hovering on automatic pilot | |
CN108323190B (en) | Obstacle avoidance method and device and unmanned aerial vehicle | |
Kong et al. | Autonomous landing of an UAV with a ground-based actuated infrared stereo vision system | |
CN118210329A (en) | Unmanned aerial vehicle high-precision relative positioning method based on binocular depth point cloud | |
CN106873619B (en) | Processing method of flight path of unmanned aerial vehicle | |
WO2019015158A1 (en) | Obstacle avoidance method for unmanned aerial vehicle, and unmanned aerial vehicle | |
CN113311873B (en) | A Vision-Based Servo Tracking Method for UAV | |
CN114216454A (en) | Unmanned aerial vehicle autonomous navigation positioning method based on heterogeneous image matching in GPS rejection environment | |
Sanfourche et al. | Perception for UAV: Vision-Based Navigation and Environment Modeling. | |
IL258551A (en) | Target tracking method performed by a drone, related computer program, electronic system and drone | |
US20220086362A1 (en) | Focusing method and apparatus, aerial camera and unmanned aerial vehicle | |
CN107192375B (en) | A kind of unmanned plane multiple image adaptive location bearing calibration based on posture of taking photo by plane | |
CN106767791A (en) | A kind of inertia/visual combination air navigation aid using the CKF based on particle group optimizing | |
CN110887486B (en) | Unmanned aerial vehicle visual navigation positioning method based on laser line assistance | |
CN118135526A (en) | Visual target recognition and positioning method for four-rotor unmanned aerial vehicle based on binocular camera | |
CN115560760A (en) | Unmanned aerial vehicle-oriented vision/laser ranging high-altitude navigation method | |
CN112991400B (en) | Multi-sensor auxiliary positioning method for unmanned ship | |
CN116202489A (en) | Method and system for co-locating power transmission line inspection machine and pole tower and storage medium | |
Ivancsits et al. | Visual navigation system for small unmanned aerial vehicles | |
CN116860000A (en) | An autonomous aerial docking method for UAVs based on binocular stereo vision | |
Miller et al. | UAV navigation based on videosequences captured by the onboard video camera | |
Daftry et al. | Semi-dense visual odometry for monocular navigation in cluttered environment | |
Gomez-Balderas et al. | Vision-based autonomous hovering for a miniature quad-rotor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |