A method for indoor drone positioning based on two-dimensional code array

Through the UAV positioning method based on QR code array, AprilTag and nonlinear optimization algorithm are used to solve the problems of positioning accuracy and resource occupation on small and medium-sized UAVs, and achieve low-cost and efficient indoor positioning effects.

CN112419403BActive Publication Date: 2024-10-11HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011374345.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2024-10-11
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

Existing UAV indoor positioning technology has limitations in equipment computing power and battery life. Bluetooth-based positioning is greatly affected by environmental interference, UWB signal accuracy is reduced, SLAM algorithms occupy a lot of CPU resources and are costly, and three-dimensional lidar is expensive and heavy. It is difficult to implement effectively on small and medium-sized UAVs.

Method used

An indoor UAV positioning method based on a QR code array is used to identify the April Tag through the image acquisition component. The homography matrix and PnP algorithm are used to solve the camera posture. The nonlinear optimization algorithm is combined with the beam method adjustment and pose diagram optimization. Only relying on Single camera for positioning.

Benefits of technology

It has realized indoor positioning of UAVs with low cost and low computing power requirements, with low recognition error rate and fast recognition speed. It can achieve better positioning results indoors and avoid the problems of reduced accuracy and large resource usage in traditional technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112419403B_ABST
    Figure CN112419403B_ABST
Patent Text Reader

Abstract

The present invention provides an indoor UAV positioning method based on a two-dimensional code array, comprising the following steps: S1, the UAV obtains and executes a take-off command, collects ground images through an image acquisition component and identifies AprilTag; S2, the image acquisition component transmits AprilTag information to a host computer, and the host computer performs a world coordinate system conversion based on the AprilTag information, obtains UAV positioning information and aircraft trajectory, and visualizes them. In terms of two-dimensional code recognition, the present invention adopts AprilTag two-dimensional code, which has a general complexity, low recognition error rate, fast recognition speed, etc., so that the method does not require a CPU with high computing power, and can be positioned by relying on only a single camera, and can achieve better positioning effect indoors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of indoor positioning technology, and in particular to an indoor unmanned aerial vehicle positioning method based on a two-dimensional code array. Background Art

[0002] Drones have a wide range of application scenarios. They can be used for terrain detection, express delivery, and agricultural fertilization outdoors, and for drone formation collaboration, indoor exploration and rescue, etc. As application scenarios become more and more complex, drone positioning technology has become more and more important. At present, indoor positioning technology is becoming more and more mature, and solutions such as UWB positioning, WIFI positioning, Bluetooth positioning, QR code positioning, and SLAM positioning have emerged. However, indoor positioning on drones is still a hot issue, especially on small and medium-sized drones. The computing power and endurance of the equipment are limited, which makes many positioning solutions unable to be effectively implemented on this type of drone. Among the existing drone indoor positioning technologies, Bluetooth-based positioning is greatly affected by environmental interference and cannot block the device. UWB-based positioning solutions have been applied to drones, but at least three base stations are required, and signal propagation will be blocked by obstacles such as walls, ceilings, doors, and people, resulting in signal reflection, refraction, and diffraction. The transmitted signal reaches the UWB receiver at different times and different paths, which ultimately reduces the accuracy of UWB and requires more complex algorithms for filtering and optimization. The positioning solution based on visual SLAM takes up a lot of CPU resources during operation and requires a relatively powerful CPU to run in real time. The equipment cost is high, the technology is difficult, and it requires rich environmental texture features. However, the texture features of the top-down view of indoor drones are not particularly rich, so the general SLAM algorithm is not completely applicable to the top-down view of drones, and the positioning trajectory is prone to drift. Using 3D laser radar for mapping and positioning is expensive and heavy, and has extremely high requirements for drones. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide an indoor UAV positioning method based on a two-dimensional code array, which has low hardware requirements for the UAV and high feasibility, so as to overcome or at least partially solve the above-mentioned problems existing in the prior art.

[0004] An indoor drone positioning method based on a two-dimensional code array comprises the following steps:

[0005] S1. The drone obtains and executes the take-off command, collects ground images through the image acquisition component and identifies the AprilTag;

[0006] S2. The image acquisition component transmits the AprilTag information to the host computer. The host computer performs world coordinate system conversion based on the AprilTag information, obtains the UAV positioning information and aircraft trajectory, and visualizes them.

[0007] Furthermore, when the UAV receives the AprilTag ID sent by the host computer, it determines whether the AprilTag ID recognized by the image acquisition component contains the received AprilTag ID. If so, it hovers above the AprilTag corresponding to the received AprilTag ID; otherwise, it hovers according to the data collected by the optical flow sensor.

[0008] Furthermore, the identification of AprilTag by the image acquisition component includes the steps of: boundary segmentation, rectangle detection, camera posture solution, and AprilTag encoding and decoding.

[0009] Furthermore, solving the camera posture is solving the camera posture through a homography matrix, or solving the camera posture through a PnP algorithm.

[0010] Furthermore, after obtaining the camera posture T through the homography matrix, a nonlinear optimization algorithm is used to solve the bundle adjustment, which specifically includes the following steps:

[0011] S11, given the initial transformation matrix and damping factor μ, through the formula (J T J+μI)Δx=-J T e performs iterative calculation, where J is the 2*6 Jacobian matrix and e is the error function;

[0012] S12. Calculate the damping factor ρ, the expression is:

[0013]

[0014] When ρ>0.75, μ=μ*2, accept this update x new ; When ρ<0.75, μ=μ / 3, reject this update x new ;

[0015] S13, determine whether the algorithm converges, if converged, end the iteration, otherwise re-execute step S11.

[0016] Furthermore, after solving the camera posture through the PnP algorithm, the reprojection error is calculated, and the camera posture T is iteratively optimized again based on the calculation result of the reprojection error. The calculation formula of the reprojection error f(x) is:

[0017]

[0018] Where P is the coordinate of the space point in the known world coordinate system (X w ,Yw ,Z w ), the homogeneous coordinate point of this space point in the camera coordinate system is p = (u, v, 1), R cw is the rotation matrix from the world coordinate system to the camera coordinate system, t cw is the translation vector, and K is the camera intrinsic parameter.

[0019] Furthermore, the identifying of the AprilTag by the image acquisition component also includes: optimizing the pose graph of the transformation matrix between the AprilTag images, specifically including:

[0020] Assume that the pose of each AprilTag image is T 1 , …, T n , i,j∈[1,n], T i and T j The transformation matrix between them is T ij , we can get:

[0021] T ij =T i -1 T j ;

[0022] Assume that the transformation error between the poses of each AprilTag image is e ij , we can get:

[0023] e ij =ln(T ij -1 T i -1 T j ) ∨ ;

[0024] Assuming the set of all edges is ε, the overall objective function is:

[0025]

[0026] Perform nonlinear optimization on the objective function.

[0027] Furthermore, the identification of AprilTag by the image acquisition component specifically includes: taking the Euclidean distance credibility weight between the center of AprilTag and the center of the image, fusing multiple spatial points to obtain fused spatial point information, assuming that the Euclidean distance between the central pixels of two different AprilTags and the center of the image is r 1 、r 2 , and the corresponding spatial point coordinates are P 1 , P 2 , then the fused space point P is:

[0028]

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] The present invention provides an indoor UAV positioning method based on a two-dimensional code array. In terms of two-dimensional code recognition, AprilTag two-dimensional code is used. The complexity is generally high, and the recognition error rate is low, the recognition speed is fast, etc. Therefore, the method does not require a CPU with very high computing power, and positioning can be performed by relying on a single camera, and better positioning effect can be achieved indoors. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 The figure is a schematic diagram of the overall process of an indoor UAV positioning method based on a two-dimensional code array provided by an embodiment of the present invention.

[0033] Figure 2 This is a schematic diagram of the AprilTag posture optimization results collected using an ordinary camera.

[0034] Figure 3 This is a schematic diagram of the AprilTag posture optimization results collected using OpenMV.

[0035] Figure 4 Schematic diagram a for comparing positioning trajectories provided in an embodiment of the present invention.

[0036] Figure 5 Schematic diagram b for comparing positioning trajectories provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The enumerated embodiments are only used to explain the present invention and are not used to limit the scope of the present invention.

[0038] Reference Figure 1 The present invention provides an indoor UAV positioning method based on a two-dimensional code array, the method comprising the following steps:

[0039] S1. The drone obtains and executes a take-off command, collects ground images through an image acquisition component, and identifies April Tags, which are all set on the ground.

[0040] S2. The image acquisition component transmits the AprilTag information to the host computer. The host computer performs world coordinate system conversion based on the AprilTag information, obtains the UAV positioning information and aircraft trajectory, and visualizes them.

[0041] The image acquisition component is arranged on the drone. In this embodiment, the image acquisition component adopts OpenMV and a driver-free USB camera, wherein OpenMV is used to identify AprilTag, and the driver-free USB camera is used to perform image acquisition or online aerial photography. In addition, the drone is also provided with a microcontroller, a power supply, a flight control, an optical flow sensor, a Bluetooth module, etc. The microcontroller can adopt a Raspberry Pi microcomputer. The user can control the drone through a remote control, or send control instructions to the drone through a host computer, which can be a device such as a computer or a server.

[0042] After receiving the take-off command from the remote controller, the drone will automatically fly to the specified height and hover. At this time, OpenMV will start to identify the surrounding AprilTags. When the drone receives the AprilTag ID sent by the host computer, it determines whether the AprilTag ID identified by the image acquisition component contains the received AprilTag ID. If it does, it will hover above the AprilTag corresponding to the received AprilTag ID. Otherwise, it will hover according to the data collected by the optical flow sensor.

[0043] The identification of AprilTag by the image acquisition component includes the steps of boundary segmentation, monitoring rectangle, solving camera posture and AprilTag encoding and decoding.

[0044] After AprilTag is successfully recognized, it is necessary to establish corresponding connections between the four corner points of the rectangle and the three-dimensional space points, and perform posture calculation.

[0045] In one implementation, the camera posture is solved by a homography matrix. The homography matrix is ​​used to describe the mapping relationship between two planes. When the known spatial points are coplanar, the camera posture can be solved by the homography matrix. Let the homography matrix be H, and the spatial point coordinates in the AprilTag coordinate system be (X, Y, Z). Since each AprilTag is coplanar and overlaps with the xy plane, Z=0 in all AprilTag spatial points. The corner coordinates of the AprilTag matrix are x, and K is the camera intrinsic parameter, then:

[0046] x=sK[R t] 3×4 [XYZ 1] T

[0047] r 0 、r 1is the first and second columns of the rotation matrix R. The rotation matrix R can be used to solve the intrinsic parameters and distortion parameters of the camera through the Matlab chessboard calibration method. In addition to the intrinsic parameters and distortion parameters, Matlab will also solve the transformation matrix T, which is composed of the rotation matrix R and the translation vector t. After sorting, we can get:

[0048] x=sK[r 0 r 1 t] 3×3 [XY 1] T

[0049] Let H = sK[r 0 r 1 t], P = [XY 1], and finally we can get:

[0050] x=HP

[0051] The H matrix can be solved by algorithms such as DLT.

[0052] In some implementations, after obtaining the camera posture T by solving the homography matrix, a nonlinear optimization algorithm is used to solve the bundle adjustment, which specifically includes the following steps:

[0053] S11, given the initial transformation matrix and damping factor μ, through the formula (J T J+μI)Δx=-J T e performs iterative calculations, where J is a 2*6 Jacobian matrix and e is an error function in the following form:

[0054]

[0055]

[0056] where (X', Y', Z') is the left side of the space point in the camera coordinate system, δξ is the perturbation of the transformation matrix T under the special Euclidean group SE(3), (u, v) is the pixel coordinate, and k 1 , k 2 is the distortion coefficient, f x 、f y 、c x 、c y is the camera internal parameter, r is the distance between the pixel coordinate and the origin in the normalized coordinate system. The special Euclidean group SE(3) is defined as follows:

[0057]

[0058] Where ∧ is the conversion of the 3*1 vector into an antisymmetric matrix form, which is as follows:

[0059]

[0060] Before iteration, a good transformation matrix needs to be provided as the initial value, otherwise the error function will converge to the local extreme value. The initial value can be selected as the camera posture T obtained by the homography matrix. Adding a damping factor can effectively control the error in the downward direction and ensure the positive definiteness of the matrix.

[0061] S12. Calculate the damping factor ρ, the expression is:

[0062]

[0063] When ρ>0.75, μ=μ*2, accept this update x new ; When ρ<0.75, μ=μ / 3, reject this update x new .

[0064] S13, determine whether the algorithm converges, if converged, end the iteration, otherwise re-execute step S11.

[0065] In another implementation, the camera posture may be solved by a PnP algorithm, which may be a DLT, P3P, EPnP, or iterative method.

[0066] After solving the camera pose through the PnP algorithm, the reprojection error is calculated. Based on the calculation result of the reprojection error, the camera pose T is iteratively optimized again. The calculation formula of the reprojection error f(x) is:

[0067]

[0068] Where P is the coordinate of the space point in the known world coordinate system (X w ,Y w ,Z w ), the homogeneous coordinate point of this space point in the camera coordinate system is p = (u, v, 1), R cw is the rotation matrix from the world coordinate system to the camera coordinate system, t cw is the translation vector, and K is the camera intrinsic parameter.

[0069] In the process of AprilTag recognition, the transformation matrix between AprilTags needs to be collected, but the collected matrix has a large error, and the error needs to be reduced. In order to solve this problem, as an example, the recognition of AprilTag by the image acquisition component also includes: optimizing the pose graph of the transformation matrix between AprilTag images, specifically including:

[0070] Assume that the pose of each AprilTag image is T 1 ,…,T n , i,j∈[1,n], T i and Tj The transformation matrix between them is T ij , we can get:

[0071] T ij =T i -1 T j ;

[0072] Assume that the transformation error between the poses of each AprilTag image is e ij , we can get:

[0073] e ij =ln(T ij -1 T i -1 T j ) ∨ ;

[0074] Assuming the set of all edges is ε, the overall objective function is:

[0075]

[0076] in is a 6*6 diagonal information matrix, representing the uncertainty of the corresponding variable, and performing nonlinear optimization on the objective function. The AprilTag posture captured by an ordinary camera is used for optimization, and the results are as follows Figure 2 As shown, the AprilTag posture collected by OpenMV is used for optimization, and the results are as follows Figure 3 As shown in the figure. From the optimization results, pose graph optimization is completely effective for AprilTag optimization and can reduce the error as much as possible. For example, when optimizing the AprilTag posture obtained by OpenMV, it can be clearly seen that the optimization effect is good. However, since the image obtained by OpenMV is not dedistorted, the optimization result is not optimal, but it can reduce the influence of distortion parameters as much as possible. For ordinary cameras, due to the advance processing of image dedistortion, the AprilTag posture error obtained before optimization is relatively small, and the effect after optimization is very ideal.

[0077] As an example, the identification of AprilTag by the image acquisition component specifically includes: taking the Euclidean distance credibility weight between the center of AprilTag and the center of the image, fusing multiple spatial points to obtain fused spatial point information, assuming that the Euclidean distance between the central pixels of two different AprilTags and the center of the image is r 1 、r 2 , and the corresponding spatial point coordinates are P 1 , P 2 , then the fused space point P is:

[0078]

[0079] In one embodiment of the present invention, a compact irregular elliptical motion is performed over a 3*3 AprilTag two-dimensional code array as test data. The test platform is Ubuntu 16.04, the output data is the spatial coordinate point (X, Y, Z), and the visualization data platform is Matlab2019a. The positioning trajectory generated by this method is compared with the positioning trajectory generated by the visual SLAM solution ORBSLAM2 with relatively high accuracy in recent years. The results are as follows: Figure 4 and Figure 5 As shown. Figure 4 , Figure 5 It can be seen that:

[0080] (1) The positioning results of ORBSLAM2 have obvious drift and jumping segments, such as Figure 4 In (c), the positioning trajectory based on AprilTag is obviously compact and has almost no jump segments. Figure 5 (e), (f);

[0081] (2) The trajectory located by AprilTag has real scale information. In the present invention, the AprilTag positioning unit is meter, while ORBSLAM2 cannot know the specific scale due to the uncertainty of monocular scale;

[0082] (3) After using the attitude calculation API in the open source code of Millikan University and converting it to the world coordinate system, the result is as follows Figure 5 In (d), it can be seen from the figure that some of the postures obtained by the algorithm have obvious errors, and the effect is not as good as the posture of the AprilTag solved by the posture of this design. The positioning effect of using multiple AprilTag information fusion is as follows Figure 5 In (f), some local positions are obviously better than the positions without fusion of multiple AprilTag information. It can be seen that the positioning track of the present invention is better than the ORBSLAM2 positioning track when there are clear landmarks, and a better positioning effect can be achieved indoors.

[0083] 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 principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for indoor drone positioning based on a two-dimensional code array, characterized in that: The method comprises the following steps: S1. The drone obtains and executes the take-off command, collects ground images through the image acquisition component and recognizes the AprilTag. The recognition of the AprilTag through the image acquisition component includes the following steps: boundary segmentation, rectangle detection, camera posture solution, and AprilTag encoding and decoding; S2, the image acquisition component transmits AprilTag information to the host computer, and the host computer performs world coordinate system conversion based on AprilTag information, obtains the UAV positioning information and aircraft trajectory, and visualizes them; When the drone receives the AprilTag ID sent by the host computer, it determines whether the AprilTag ID identified by the image acquisition component contains the received AprilTag ID. If so, it hovers above the AprilTag corresponding to the received AprilTag ID. Otherwise, it hovers according to the data collected by the optical flow sensor. The camera posture is solved by using a homography matrix or a PnP algorithm. After solving the camera pose through the PnP algorithm, the reprojection error is calculated, and the camera pose is re-calculated based on the reprojection error calculation result. Perform iterative optimization and reprojection error The calculation formula is: in is the coordinates of the space point in the known world coordinate system , the homogeneous coordinate point of this space point in the camera coordinate system is p = (u, v, 1), is the rotation matrix from the world coordinate system to the camera coordinate system, is the translation vector, is the camera internal reference; The camera pose is obtained by solving the homography matrix Finally, a nonlinear optimization algorithm is used to solve the bundle adjustment, which includes the following steps: S11, given the initial transformation matrix and damping factor , through the formula Perform iterative calculations, where is a 2*6 Jacobian matrix, is the error function; S12. Calculate the damping factor , the expression is: ; when , , accept this update ;when , , reject this update ; S13, determine whether the algorithm converges, if converged, end the iteration, otherwise re-execute step S11.

2. The indoor UAV positioning method based on a two-dimensional code array according to claim 1, characterized in that: The identifying of the AprilTag by the image acquisition component further includes: optimizing the pose graph of the transformation matrix between the AprilTag images, specifically including: Assume that the pose of each AprilTag image is , , and The transformation matrix between , we can get: ; Assume that the transformation error between the poses of each AprilTag image is , we can get: ; Let the set of all edges be , then the overall objective function is: Perform nonlinear optimization on the objective function.

3. The indoor UAV positioning method based on a two-dimensional code array according to claim 1, characterized in that: The identification of AprilTag by the image acquisition component specifically includes: taking the Euclidean distance between the center of AprilTag and the center of the image as the credibility weight, fusing multiple spatial points to obtain fused spatial point information, assuming that the Euclidean distance between the central pixels of two different AprilTags and the center of the image is , , and the corresponding spatial point coordinates are , , then the fused spatial point for: 。