Unmanned aerial vehicle relative pose positioning method and system
By identifying and presetting the pose transformation operation of the drone QR code marking plate image, combined with the random sampling consensus algorithm, the relative pose of the drone is calculated, which solves the problem of sensitive recognition distance and improves the relative position of the drone. posture accuracy and system robustness.
Patent Information
- Application Number
- CN202410649830.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Existing UAV relative position positioning technology is sensitive to recognition distance, resulting in low accuracy of UAV relative position.
By obtaining the drone QR code marking plate image, perform QR code recognition, output multiple QR code encoding information, and use the preset pose transformation calculation formula and random sampling consensus algorithm to calculate and fuse the drone camera relative pose, and finally calculate the relative pose of the center of the target drone.
It reduces the sensitivity of UAV recognition distance, improves the accuracy of UAV relative posture, and enhances the robustness and adaptability of the system.
Smart Images

Figure CN118570290A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle visual positioning, and in particular to a method and system for positioning relative posture of an unmanned aerial vehicle. Background Art
[0002] In recent years, the capabilities of drone systems have been continuously improved, and they have emerged in military and civilian fields such as urban anti-terrorism reconnaissance, disaster monitoring, logistics distribution, and traffic diversion, with particularly broad application prospects. Drone positioning is a necessary link for drones to carry out dynamic tasks, and it is also an important manifestation of drone autonomy. 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.
[0003] In the field of positioning technology, the advantages of QR codes are being increasingly explored and recognized, and are being used in the development of positioning and auxiliary positioning modules for intelligent devices such as robots or drones, gradually becoming one of the important positioning methods in robot inspection and intelligent logistics scenarios. Especially in situations where it is easy to lose positioning by relying solely on laser, visual and other sensors due to repeated features (such as the row of cabinets in a data center), QR codes can greatly reduce the possibility of positioning loss by providing a posteriori information for the robot's odometer.
[0004] Most of the existing UAV relative posture positioning technologies are based on camera imaging principles to calculate the UAV's posture relative to the unmanned vehicle platform. However, this process is sensitive to the UAV's recognition distance. When the UAV is close to the unmanned vehicle platform, the QR code mark cannot appear completely within the field of view. When the UAV is far away from the unmanned vehicle platform, the area occupied by the QR code mark within the field of view is too small, resulting in low accuracy of the UAV's relative posture. Summary of the invention
[0005] The present invention provides a method and system for relative posture positioning of unmanned aerial vehicles, which are used to solve the technical problem that most existing relative posture positioning technologies of unmanned aerial vehicles are relatively sensitive to the recognition distance of the unmanned aerial vehicles, resulting in low accuracy of the relative posture of the unmanned aerial vehicles.
[0006] A first aspect of the present invention provides a method for relative posture positioning of an unmanned aerial vehicle, comprising:
[0007] Acquire a drone QR code marking plate image, perform QR code recognition on the drone QR code marking plate image, and output multiple QR code encoding information;
[0008] The preset posture transformation calculation formula is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each of the two-dimensional code encoding information;
[0009] Determine the relative position and posture of the fused drone camera according to the random sampling consensus algorithm and the relative position and posture of each of the drone cameras;
[0010] Substitute the relative pose of the fused drone camera into the preset pose conversion formula to calculate the relative pose of the target drone center.
[0011] Optionally, the step of performing QR code recognition on the drone QR code mark plate image and outputting a plurality of QR code encoding information includes:
[0012] Preprocessing the drone two-dimensional code mark plate image to generate a denoised two-dimensional code mark plate image;
[0013] Using the maximum inter-class variance method to perform image segmentation on the denoised two-dimensional code mark plate image, and outputting a black and white two-dimensional code mark plate image;
[0014] Using a contour recognition algorithm to extract the graphic contour of the black and white two-dimensional code mark plate image, and outputting a plurality of graphic contours;
[0015] Using a polygonal approximation algorithm to screen the contours of each graphic, and outputting a QR code candidate frame corresponding to each contour of the graphic;
[0016] Performing perspective transformation on each of the two-dimensional code candidate frames to generate a corrected two-dimensional code candidate frame corresponding to each of the two-dimensional code candidate frames;
[0017] Divide each of the corrected two-dimensional code candidate frames into grids, and output a plurality of pixel grids corresponding to each of the corrected two-dimensional code candidate frames;
[0018] A preset two-dimensional code dictionary is used to generate two-dimensional code encoding information corresponding to each of the correction two-dimensional code candidate frames according to the counted number of pixels in each of the pixel grids.
[0019] Optionally, the preset posture transformation operation formula includes a posture transformation matrix formula group and a relative posture operation formula; the two-dimensional code length and distance data include the two-dimensional code length, the two-dimensional code horizontal distance and the two-dimensional code vertical distance; the step of using the preset posture transformation operation formula to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length and distance data corresponding to each of the two-dimensional code encoding information includes:
[0020] Based on the length of the two-dimensional code corresponding to each of the two-dimensional code encoding information, determine the corner point coordinate data corresponding to each of the two-dimensional code encoding information;
[0021] Determine the posture transformation matrix corresponding to each of the two-dimensional code encoding information according to each of the corner point coordinate data and the posture transformation matrix formula group;
[0022] The relative posture calculation formula is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to each of the posture transformation matrices, the horizontal distance of each two-dimensional code and the vertical distance of each two-dimensional code.
[0023] Optionally, the fused drone camera relative posture includes a fused rotation matrix and a fused translation vector; the step of determining the fused drone camera relative posture according to the random sampling consensus algorithm and the drone camera relative postures includes:
[0024] Selecting a plurality of first intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio;
[0025] Performing a mean operation on the first drone camera translation vectors in each of the first intermediate drone camera relative postures, and outputting a first translation vector mean;
[0026] Selecting a plurality of second intermediate drone camera relative postures from the drone camera relative postures according to the preset sampling ratio;
[0027] Performing a mean operation on the second drone camera translation vectors in each of the second intermediate drone camera relative postures, and outputting a second translation vector mean;
[0028] Performing a difference operation on the first translation vector mean and the second translation vector mean, outputting a mean error and comparing it with a preset error threshold;
[0029] If the mean error is less than the preset error threshold, taking the mean of the second translation vector as the fused translation vector;
[0030] The rotation matrices of the second drone cameras in the relative positions of the second intermediate drone cameras are fused by Euler angles to fuse the rotation matrices.
[0031] Optionally, the step of performing Euler angle fusion on the second drone camera rotation matrices in the relative postures of the second intermediate drone cameras to fuse the rotation matrices comprises:
[0032] Calculate the Euler angle corresponding to each second drone camera rotation matrix according to the matrix elements in each second drone camera rotation matrix using a preset Euler angle calculation formula;
[0033] Performing a mean operation on each of the Euler angles, and outputting a mean value of the Euler angles;
[0034] The fusion rotation matrix is determined according to the Euler angle mean and the preset fusion rotation matrix conversion formula group.
[0035] Optionally, the corner point coordinate data includes the first corner point coordinates, the second corner point coordinates, the third corner point coordinates and the fourth corner point coordinates, the first corner point coordinates include the first corner point horizontal coordinate, the first corner point vertical coordinate and the first corner point vertical coordinate, the second corner point coordinates include the second corner point horizontal coordinate, the second corner point vertical coordinate and the second corner point vertical coordinate, the third corner point coordinates include the third corner point horizontal coordinate, the third corner point vertical coordinate and the third corner point vertical coordinate, the fourth corner point coordinates include the fourth corner point horizontal coordinate, the fourth corner point vertical coordinate and the fourth corner point vertical coordinate; the posture transformation matrix formula group is specifically:
[0036]
[0037] Among them, s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; t1 is the first matrix element in the pose transformation matrix; x m y is the horizontal coordinate of the corner point, which includes the first corner point horizontal coordinate, the second corner point horizontal coordinate, the third corner point horizontal coordinate and the fourth corner point horizontal coordinate; m is the ordinate of the corner point, which includes the first ordinate of the corner point, the second ordinate of the corner point, the third ordinate of the corner point and the fourth ordinate of the corner point; m is the vertical coordinate of the corner point, and the vertical coordinate of the corner point includes the first vertical coordinate of the corner point, the second vertical coordinate of the corner point, the third vertical coordinate of the corner point and the fourth vertical coordinate of the corner point; t2 is the second matrix element in the posture transformation matrix; t3 is the third matrix element in the posture transformation matrix; t4 is the fourth matrix element in the posture transformation matrix; t5 is the fifth matrix element in the posture transformation matrix; t6 is the sixth matrix element in the posture transformation matrix; t7 is the seventh matrix element in the posture transformation matrix; t8 is the eighth matrix element in the posture transformation matrix; t9 is the ninth matrix element in the posture transformation matrix; t 10 is the tenth matrix element in the posture transformation matrix; t 11 is the eleventh matrix element in the posture transformation matrix; t 12 It is the twelfth matrix element in the pose transformation matrix.
[0038] The relative posture calculation formula is specifically:
[0039]
[0040] Among them, R w is the drone camera rotation matrix in the drone camera relative pose; t w is the translation vector of the drone camera in the relative position of the drone camera; d x is the horizontal distance of the QR code; d y is the vertical distance of the QR code; R mis the posture rotation matrix in the posture transformation matrix; t m is the pose translation vector in the pose transformation matrix.
[0041] A second aspect of the present invention provides a relative posture positioning system for an unmanned aerial vehicle, comprising:
[0042] An acquisition module is used to acquire a drone QR code mark plate image, perform QR code recognition on the drone QR code mark plate image, and output a plurality of QR code encoding information;
[0043] An adopting module is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each of the two-dimensional code encoding information by using a preset posture transformation calculation formula;
[0044] According to the module, it is used to determine the relative pose of the fused drone camera based on the random sampling consensus algorithm and the relative pose of each of the drone cameras;
[0045] The calculation module is used to substitute the relative posture of the fused drone camera into a preset posture conversion formula to calculate the relative posture of the target drone center.
[0046] A third aspect of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the relative posture positioning method of the drone as described in any one of the above items.
[0047] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the relative posture positioning method of a drone as described in any one of the above items.
[0048] A fifth aspect of the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the relative posture positioning method of a drone as described in any one of the above items.
[0049] It can be seen from the above technical solutions that the present invention has the following advantages:
[0050] The above technical scheme of the present invention provides a method for relative posture positioning of a drone, which first obtains a two-dimensional code mark plate image of the drone, and performs two-dimensional code recognition on the two-dimensional code mark plate image of the drone, and outputs multiple two-dimensional code encoding information; then, a preset posture transformation operation formula is used to calculate the relative posture of the drone camera corresponding to each two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each two-dimensional code encoding information; according to the random sampling consensus algorithm and the relative posture of each drone camera, the relative posture of the fused drone camera is determined; finally, the relative posture of the fused drone camera is substituted into the preset posture conversion formula to calculate the relative posture of the center of the target drone; based on the above scheme, multiple two-dimensional code encoding information obtained by performing two-dimensional code recognition on the two-dimensional code mark plate image of the drone are combined with the relative posture and substituted into the preset posture conversion formula, the preset posture transformation operation formula and the random sampling consensus algorithm to determine the relative posture of the center of the target drone. This process integrates the posture information of multiple two-dimensional codes, reduces the sensitivity of the recognition distance of the drone, and further improves the accuracy of the relative posture of the drone. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0052] Figure 1 A flowchart of a method for relative posture positioning of a drone provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of a drone QR code marking plate provided by an embodiment of the present invention;
[0054] Figure 3 A flowchart of another method for relative posture positioning of a drone provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of a drone coordinate system, an image coordinate system, and an ArUco code coordinate system provided in an embodiment of the present invention;
[0056] Figure 5 A structural block diagram of a relative posture positioning system for an unmanned aerial vehicle provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The embodiments of the present invention provide a method and system for relative posture positioning of a UAV, which are used to solve the technical problem that most existing relative posture positioning technologies of UAVs are sensitive to the identification distance of the UAV, resulting in low accuracy of the relative posture of the UAV.
[0058] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Terminology explanation:
[0060] Pose estimation: In the field of computer vision and robotics, it refers to the process of determining the position (translation) and orientation (rotation) of an object through sensor data or image information. It is usually implemented using mathematical models and algorithms, such as the PnP algorithm.
[0061] Relative pose: refers to the position and attitude of an object relative to other objects or coordinate systems. In this patent, it refers to the position and attitude of the drone relative to the center of the ArUco (Augmented Reality University of Cordoba) marker.
[0062] ArUco code: A two-dimensional code marking system used in computer vision and augmented reality. ArUco codes consist of black and white blocks with a unique identifier for positioning and identification.
[0063] Camera imaging principle: describes the principle of how a camera projects a three-dimensional scene onto a two-dimensional plane. This includes camera perspective projection, distortion correction, and camera internal and external parameters.
[0064] PnP algorithm: Perspective-n-Point algorithm, used to estimate the position and attitude of the camera from the point pairs in the image. The camera's position and attitude are solved based on the known three-dimensional points and their projections in the image.
[0065] Image segmentation algorithm: an algorithm that divides an image into different regions or objects. Commonly used image segmentation algorithms include threshold segmentation, edge detection, region growing, etc.
[0066] Sub-pixel corners: The detected corners in the image are refined at the sub-pixel level to improve the accuracy and precision of the detection.
[0067] Camera to drone rotation matrix and translation matrix: A matrix that describes the attitude and position relationship of the camera relative to the drone. Usually used to transform points in the camera coordinate system to the drone coordinate system.
[0068] The relationship between the pixel coordinate system and the platform 3D coordinates: describes the mapping relationship between the pixel coordinates in the image and the object coordinates in the real world. The transformation from pixels to real coordinates is achieved through the combination of the camera intrinsic matrix and the extrinsic matrix.
[0069] See also Figure 1 , Figure 1 A flowchart of the steps of a method for relative posture positioning of an unmanned aerial vehicle provided by an embodiment of the present invention.
[0070] The present invention provides a method for relative posture positioning of an unmanned aerial vehicle, comprising:
[0071] Step 101: Acquire a drone QR code marking plate image, perform QR code recognition on the drone QR code marking plate image, and output multiple QR code encoding information.
[0072] The QR code encoding information is the ID value of the ArUco code (QR code).
[0073] Please note that Figure 2 The drone QR code marker image is a color image of the ArUco code marker pasted on the unmanned vehicle platform, which is collected in real time by the drone camera. The drone camera is a pixelplus rolling shutter camera with an image resolution of 800 pixels × 600 pixels; the ArUco code marker consists of 61 square ArUco QR codes, including 4 large QR codes and 57 small QR codes. The side length of the large QR code is 17.6 cm, and the side length of the small QR code is 4.4 cm.
[0074] Furthermore, after obtaining the drone two-dimensional code marker image, the collected drone two-dimensional code marker image is grayed and denoised to generate a denoised two-dimensional code marker image. Then, the ostu threshold segmentation algorithm (maximum inter-class variance method) is used to segment the denoised two-dimensional code marker image to obtain a black-and-white two-dimensional code marker image. The contour recognition algorithm is used to extract the graphic contour of the black-and-white two-dimensional code marker image, and multiple graphic contours are output. Then, each graphic contour is screened by a polygon approximation algorithm, that is, polygons in the image are found and the recognized polygons are screened, so as to output the two-dimensional code candidate frame corresponding to each graphic contour; each two-dimensional code candidate frame is perspective transformed to generate a corrected two-dimensional code candidate frame corresponding to each two-dimensional code candidate frame; each corrected two-dimensional code candidate frame is gridded, and multiple pixel grids corresponding to each corrected two-dimensional code candidate frame are output; finally, according to the statistical number of pixels in each pixel grid, the initial coding information corresponding to each corrected two-dimensional code candidate frame is obtained and matched with a preset two-dimensional code dictionary to determine the two-dimensional code coding information corresponding to each corrected two-dimensional code candidate frame.
[0075] In this embodiment, the drone QR code marking plate image is obtained, and the drone QR code marking plate image is subjected to QR code recognition to output a plurality of QR code encoding information.
[0076] Step 102: Calculate the relative posture of the drone camera corresponding to each QR code information using a preset posture transformation calculation formula based on the QR code length distance data corresponding to each QR code information.
[0077] The preset posture transformation operation formulas include a posture transformation matrix formula group and a relative posture operation formula.
[0078] The QR code length distance data includes the QR code length, the QR code horizontal distance and the QR code vertical distance, wherein the QR code length is the side length of the QR code, the QR code horizontal distance is the horizontal distance from the code center of the identified QR code to the center of the ArUco code marker board, and the QR code vertical distance is the vertical distance from the code center of the identified QR code to the center of the ArUco code marker board.
[0079] It should be noted that after obtaining the QR code encoding information of each QR code according to the above steps, the QR code length, QR code horizontal distance and QR code vertical distance corresponding to each QR code can be known. Based on the QR code length l corresponding to each QR code encoding information, the corner point coordinate data corresponding to each QR code encoding information is determined. Each QR code has four corner points, so the corner point coordinate data of each QR code includes the first corner point coordinates. The coordinates of the second corner The coordinates of the third corner and the coordinates of the fourth corner The first corner point coordinates include the first corner point horizontal coordinate, the first corner point vertical coordinate and the first corner point vertical coordinate, the second corner point coordinates include the second corner point horizontal coordinate, the second corner point vertical coordinate and the second corner point vertical coordinate, the third corner point coordinates include the third corner point horizontal coordinate, the third corner point vertical coordinate and the third corner point vertical coordinate, and the fourth corner point coordinates include the fourth corner point horizontal coordinate, the fourth corner point vertical coordinate and the fourth corner point vertical coordinate.
[0080] Furthermore, according to the coordinate data of each corner point and the pose transformation matrix formula group, the pose transformation matrix corresponding to each two-dimensional code encoding information is determined. Specifically, the four corner points of each two-dimensional code are respectively substituted into the pose transformation matrix formula group, thereby 12 equations can be listed and solved to obtain the pose transformation matrix corresponding to each two-dimensional code, wherein the pose transformation matrix is the pose transformation matrix from the center of the pixel plane to the center of the two-dimensional code, which includes the pose rotation matrix R m and the pose translation vector t m ; The pose transformation matrix formula group is as follows:
[0081]
[0082] Among them, s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; t1 is the first matrix element in the pose transformation matrix; x m y is the horizontal coordinate of the corner point, which includes the first corner point horizontal coordinate, the second corner point horizontal coordinate, the third corner point horizontal coordinate and the fourth corner point horizontal coordinate; m is the ordinate of the corner point, which includes the first ordinate of the corner point, the second ordinate of the corner point, the third ordinate of the corner point and the fourth ordinate of the corner point; m is the vertical coordinate of the corner point, and the vertical coordinate of the corner point includes the first vertical coordinate of the corner point, the second vertical coordinate of the corner point, the third vertical coordinate of the corner point and the fourth vertical coordinate of the corner point; t2 is the second matrix element in the posture transformation matrix; t3 is the third matrix element in the posture transformation matrix; t4 is the fourth matrix element in the posture transformation matrix; t5 is the fifth matrix element in the posture transformation matrix; t6 is the sixth matrix element in the posture transformation matrix; t7 is the seventh matrix element in the posture transformation matrix; t8 is the eighth matrix element in the posture transformation matrix; t9 is the ninth matrix element in the posture transformation matrix; t 10 is the tenth matrix element in the posture transformation matrix; t 11 is the eleventh matrix element in the posture transformation matrix; t 12 It is the twelfth matrix element in the pose transformation matrix.
[0083] Furthermore, the relative posture calculation formula is used to calculate the relative posture of the drone camera corresponding to each QR code encoding information according to each posture transformation matrix, the horizontal distance of each QR code and the vertical distance of each QR code. The relative posture of the drone camera is the relative posture of the drone camera and the center of the ArUco code marker board, which includes the drone camera rotation matrix R w and the drone camera translation vector t w ;Relative posture calculation formula, specifically:
[0084]
[0085] Among them, R w is the rotation matrix of the relative position of the drone camera; t w is the translation vector in the relative position of the drone camera; d x is the horizontal distance of the QR code; d y is the vertical distance of the QR code; R m is the rotation matrix in the pose transformation matrix; t m is the translation vector in the pose transformation matrix.
[0086] In this embodiment, a preset posture transformation calculation formula is used to calculate the relative posture of the drone camera corresponding to each QR code encoding information based on the QR code length distance data corresponding to each QR code encoding information.
[0087] Step 103: Determine the relative position and posture of the fused drone camera according to the random sampling consensus algorithm and the relative position and posture of each drone camera.
[0088] The fusion of drone camera relative pose includes fusion rotation matrix and fusion translation vector.
[0089] It should be noted that, according to the preset sampling ratio, a plurality of first intermediate drone camera relative postures are randomly selected from all drone camera relative postures; the first drone camera translation vector in each first intermediate drone camera relative posture is averaged, and the first translation vector mean is output, and then a plurality of second intermediate drone camera relative postures are randomly selected from all drone camera relative postures according to the preset sampling ratio; the second drone camera translation vector in each second intermediate drone camera relative posture is averaged, and the second translation vector mean is output; the first translation vector mean and the second translation vector mean are differenced, and the mean error is output and compared with the preset error threshold; if the mean error is less than the preset error threshold, the second translation vector mean is used as the fused translation vector; the second drone camera rotation matrix in each second intermediate drone camera relative posture is fused with Euler angles to fuse the rotation matrix; wherein, the preset sampling ratio and the preset error threshold can be set as needed, for example, the preset sampling ratio can be set to 0.7, and the present invention is not limited to this.
[0090] In this embodiment, the relative position and posture of the fused drone camera is determined based on the random sampling consensus algorithm and the relative position and posture of each drone camera.
[0091] Step 104: Substitute the relative pose of the fused drone camera into the preset pose conversion formula to calculate the relative pose of the target drone center.
[0092] It should be noted that the position transformation relationship from the camera to the center of the drone is based on the preset rotation matrix R bc and preset translation vector t bc , the preset posture conversion formula is used to calculate the relative posture of the target drone center according to the relative posture of the fused drone camera. The relative posture of the target drone center is the posture of the drone center relative to the center of the ArUco code marker board. The preset posture conversion formula is specifically:
[0093]
[0094] Among them, R bw is the target rotation matrix in the relative position of the target UAV center; t bw is the target translation vector in the relative position of the target UAV center; R bc is the preset rotation matrix; t bc is the preset translation vector; R f is the fusion rotation matrix; t f is the fused translation vector.
[0095] In this embodiment, the relative pose of the fused drone camera is substituted into the preset pose conversion formula to calculate the relative pose of the target drone center.
[0096] In an embodiment of the present invention, the present invention provides a method for relative posture positioning of a drone, firstly, obtaining a drone two-dimensional code mark plate image, and performing two-dimensional code recognition on the drone two-dimensional code mark plate image, and outputting multiple two-dimensional code encoding information; then, using a preset posture transformation operation formula to calculate the drone camera relative posture corresponding to each two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each two-dimensional code encoding information; according to a random sampling consensus algorithm and the relative postures of each drone camera, the relative posture of the fused drone camera is determined; finally, the relative posture of the fused drone camera is substituted into the preset posture conversion formula to calculate the relative posture of the center of the target drone; based on the above scheme, multiple two-dimensional code encoding information obtained by performing two-dimensional code recognition on the drone two-dimensional code mark plate image are combined with the relative posture and substituted into the preset posture conversion formula, the preset posture transformation operation formula and the random sampling consensus algorithm to determine the relative posture of the center of the target drone. This process integrates the posture information of multiple two-dimensional codes, reduces the sensitivity of the drone's recognition distance, and further improves the accuracy of the drone's relative posture.
[0097] See also Figure 3 , Figure 3 A flowchart of the steps of another method for relative posture positioning of a drone provided by an embodiment of the present invention.
[0098] The present invention provides a method for relative posture positioning of an unmanned aerial vehicle, comprising:
[0099] Step 301: Acquire the drone QR code marking plate image, perform QR code recognition on the drone QR code marking plate image, and output multiple QR code encoding information.
[0100] Further, step 301 may include the following sub-steps:
[0101] S11, preprocessing the drone QR code marker image to generate a denoised QR code marker image;
[0102] It should be noted that the process of preprocessing the drone QR code marker plate image is divided into two stages. The collected color image (drone QR code marker plate image) is grayscaled and denoised. Specifically, the drone QR code marker plate image is first grayscaled to obtain a grayscale QR code marker plate image, and then the grayscale QR code marker plate image is denoised to generate a denoised QR code marker plate image.
[0103] S12, using the maximum inter-class variance method to perform image segmentation on the denoised two-dimensional code mark plate image, and output a black and white two-dimensional code mark plate image;
[0104] S13, using a contour recognition algorithm to extract graphic contours from the black and white two-dimensional code mark plate image, and outputting multiple graphic contours;
[0105] S14, using a polygonal approximation algorithm to screen each graphic outline, and outputting a QR code candidate frame corresponding to each graphic outline;
[0106] It should be noted that after obtaining multiple graphic contours, the polygons in the image are found through a polygon approximation algorithm and the identified polygons are screened to output the QR code candidate frames corresponding to each graphic contour. The outside of the ArUco code is composed of a square frame, and the square frame is still a convex quadrilateral when projected onto the pixel plane. Based on this property, the candidate frame of each ArUco code, that is, the QR code candidate frame, can be obtained.
[0107] S15, performing perspective transformation on each QR code candidate frame to generate a corrected QR code candidate frame corresponding to each QR code candidate frame;
[0108] S16, dividing each corrected two-dimensional code candidate frame into grids, and outputting a plurality of pixel grids corresponding to each corrected two-dimensional code candidate frame;
[0109] S17, using a preset two-dimensional code dictionary to generate two-dimensional code encoding information corresponding to each correction two-dimensional code candidate frame according to the counted number of pixels in each pixel grid.
[0110] It should be noted that after obtaining each QR code candidate frame, the position of each QR code can be known, and each QR code candidate frame is perspective transformed, and then gridded, and the number of black and white pixels in each grid is counted, the more black, the more 0, and vice versa. The initial coding information of each corrected QR code candidate frame obtained by statistics is matched with the preset ArUco dictionary, and finally the ID value of each identified ArUco code, that is, the QR code coding information, is determined.
[0111] In this embodiment, the drone QR code marking plate image is obtained, and the drone QR code marking plate image is subjected to QR code recognition to output a plurality of QR code encoding information.
[0112] Step 302: Determine the corner point coordinate data corresponding to each piece of two-dimensional code encoding information based on the two-dimensional code length corresponding to each piece of two-dimensional code encoding information.
[0113] Corner point coordinate data includes the first corner point coordinates The coordinates of the second corner The coordinates of the third corner and the coordinates of the fourth corner The first corner point coordinates include the first corner point horizontal coordinate, the first corner point vertical coordinate and the first corner point vertical coordinate, the second corner point coordinates include the second corner point horizontal coordinate, the second corner point vertical coordinate and the second corner point vertical coordinate, the third corner point coordinates include the third corner point horizontal coordinate, the third corner point vertical coordinate and the third corner point vertical coordinate, and the fourth corner point coordinates include the fourth corner point horizontal coordinate, the fourth corner point vertical coordinate and the fourth corner point vertical coordinate.
[0114] In this embodiment, based on the two-dimensional code length corresponding to each two-dimensional code encoding information, the corner point coordinate data corresponding to each two-dimensional code encoding information is determined.
[0115] Step 303: Determine the posture transformation matrix corresponding to each two-dimensional code encoding information according to the coordinate data of each corner point and the posture transformation matrix formula group.
[0116] Please note that Figure 4 , define the origin of the image coordinate system as the center of the pixel plane o c , the origin of the ArUco code coordinate system is the center of the ArUco code square frame o m , the origin of the ArUco board coordinate system is the geometric center o of the board w , the origin of the drone body coordinate system is the drone center of mass o u The camera projection model is used to construct the transformation relationship from the image coordinate system to the ArUco code coordinate system, which is specifically:
[0117]
[0118] Where s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; K is the camera internal parameter; x m y is the horizontal coordinate of a point in space in the ArUco code coordinate system; m z is the ordinate of a point in space in the ArUco code coordinate system; m It is the vertical coordinate of a point in space in the ArUco code coordinate system.
[0119] Furthermore, by combining the intrinsic parameter matrix and the pose transformation matrix in the above conversion formula, we can obtain:
[0120]
[0121] Where s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; x m y is the horizontal coordinate of a point in space in the ArUco code coordinate system; mz is the ordinate of a point in space in the ArUco code coordinate system; m is the vertical coordinate of a point in space in the ArUco code coordinate system; t2 is the second matrix element in the pose transformation matrix; t3 is the third matrix element in the pose transformation matrix; t4 is the fourth matrix element in the pose transformation matrix; t5 is the fifth matrix element in the pose transformation matrix; t6 is the sixth matrix element in the pose transformation matrix; t7 is the seventh matrix element in the pose transformation matrix; t8 is the eighth matrix element in the pose transformation matrix; t9 is the ninth matrix element in the pose transformation matrix; t 10 is the tenth matrix element in the posture transformation matrix; t 11 is the eleventh matrix element in the posture transformation matrix; t 12 It is the twelfth matrix element in the pose transformation matrix.
[0122] Furthermore, based on the above formulas and integrating them, we get the pose transformation matrix formula group, and each QR code has four corner points. After obtaining the QR code encoding information of each QR code, we can know that the length of each QR code is l, and the coordinates of the four corner points of each QR code in the ArUco code coordinate system are the first corner point coordinates The coordinates of the second corner The coordinates of the third corner and the coordinates of the fourth corner Substitute the corner point coordinate data of each QR code into the pose transformation matrix formula group, that is, replace the coordinates of a point in the space in the ArUco code coordinate system with the corner point coordinate data, thus 12 equations can be listed to solve the pose transformation matrix R from the center of the pixel plane to the center of the code m and t m , that is, calculate the posture transformation matrix corresponding to each QR code.
[0123] In this embodiment, the posture transformation matrix corresponding to each two-dimensional code encoding information is determined based on the coordinate data of each corner point and the posture transformation matrix formula group.
[0124] Step 304: Use the relative posture calculation formula to calculate the relative posture of the drone camera corresponding to each QR code encoding information according to each posture transformation matrix, each QR code horizontal distance and each QR code vertical distance.
[0125] It should be noted that, by using the relative pose calculation formula, according to the recognized QR code information (ArUco code ID value), we can know the horizontal distance and vertical distance from the center of the recognized ArUco code to the center of the ArUco code marker board and the pose transformation matrix corresponding to each QR code, and get the relative pose R of the drone camera corresponding to each QR code. w and t w .
[0126] In this embodiment, the relative posture calculation formula is used to calculate the relative posture of the drone camera corresponding to each QR code encoding information based on each posture transformation matrix, each QR code horizontal distance and each QR code vertical distance.
[0127] Step 305: Determine the relative position and posture of the fused drone camera based on the random sampling consensus algorithm and the relative position and posture of each drone camera.
[0128] The fusion of drone camera relative pose includes fusion rotation matrix and fusion translation vector.
[0129] Further, step 305 may include the following sub-steps:
[0130] S51, selecting a plurality of first intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio;
[0131] S52, performing a mean operation on the first drone camera translation vectors in the first intermediate drone camera relative postures, and outputting a first translation vector mean;
[0132] S53, selecting a plurality of second intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio;
[0133] S54, performing a mean operation on the second drone camera translation vectors in the relative positions of the second intermediate drone cameras, and outputting a second translation vector mean;
[0134] S55, performing a difference operation on the first translation vector mean and the second translation vector mean, outputting a mean error and comparing it with a preset error threshold;
[0135] S56, if the mean error is less than a preset error threshold, taking the second translation vector mean as the fused translation vector;
[0136] It should be noted that a certain proportion of drone camera relative postures are randomly selected from all drone camera relative postures as the first intermediate drone camera relative postures, and the mean of the first drone camera translation vector in all first intermediate drone camera relative postures is calculated, and the first translation vector mean is output, wherein the calculation formula of the translation vector mean is specifically:
[0137]
[0138] Among them, t avg is the translation vector mean, which includes the first translation vector mean and the second translation vector mean; t wiis the i-th drone camera translation vector, the drone camera translation vector includes the first drone camera translation vector and the second drone camera translation vector; n is the number of QR codes.
[0139] Furthermore, a certain proportion of drone camera relative postures are randomly selected from all drone camera relative postures as the second intermediate drone camera relative posture, and the mean of the second drone camera translation vector in all the second intermediate drone camera relative postures is calculated, the second translation vector mean is output, and the difference operation is performed with the first translation vector mean to obtain the mean error e and compare it with the preset error threshold. If the mean error is less than the preset error threshold, the second translation vector mean is used as the fused translation vector t f If the mean error is greater than or equal to the preset error threshold, the second translation vector mean is used as the new first translation vector mean, and the process jumps to S53 until the mean error is less than the preset error threshold, and the second translation vector mean when the mean error is less than the preset error threshold is used as the fused translation vector t f .
[0140] S57, performing Euler angle fusion on the second drone camera rotation matrices in the relative positions of the second intermediate drone cameras to fuse the rotation matrices.
[0141] Further, S57 may include the following sub-steps:
[0142] S571, using a preset Euler angle calculation formula to calculate the Euler angle corresponding to each second drone camera rotation matrix according to the matrix elements in each second drone camera rotation matrix;
[0143] Euler angles include the first Euler angle α i 、Second Euler angle β i and the third Euler angle γ i .
[0144] It should be noted that in order to obtain the fusion rotation matrix, the present invention adopts the most common Euler angle rotation mode z-x'-z", that is, a point in space is first rotated around the z-axis, then around the x-axis, and finally around the z-axis to obtain the target point. Under the definition of this Euler angle rotation mode, the preset Euler angle calculation formula is used to calculate the Euler angle α corresponding to each second drone camera rotation matrix according to the matrix elements in each second drone camera rotation matrix. i , β i , γ i , where the preset Euler angle calculation formula is:
[0145]
[0146] Among them, α iis the first Euler angle of the rotation matrix of the i-th second drone camera; β i is the second Euler angle of the rotation matrix of the i-th second drone camera; i is the third Euler angle of the rotation matrix of the i-th second drone camera; R i13 is the matrix element of the first row and third column of the rotation matrix of the i-th second drone camera; R i23 is the matrix element of the second row and third column of the rotation matrix of the i-th second drone camera; R i33 is the matrix element of the third row and third column of the rotation matrix of the i-th second drone camera; R i31 R i32 It is the matrix element in the third row and second column of the rotation matrix of the i-th second drone camera.
[0147] S572, performing mean calculation on each Euler angle, and outputting the mean Euler angle.
[0148] It should be noted that the first Euler angle α corresponding to each second drone camera rotation matrix i 、Second Euler angle β i and the third Euler angle γ i Perform mean operation to obtain the mean Euler angle, where the mean Euler angle includes the first Euler angle mean, the second Euler angle mean and the third Euler angle mean. The calculation process of the mean Euler angle is as follows:
[0149]
[0150]
[0151]
[0152] Among them, α f is the mean value of the first Euler angle; β f is the mean value of the second Euler angle; f is the mean value of the third Euler angle; α i is the first Euler angle of the rotation matrix of the i-th second drone camera; β i is the second Euler angle of the rotation matrix of the i-th second drone camera; i is the third Euler angle of the i-th second drone camera rotation matrix; n is the number of second drone camera rotation matrices.
[0153] S573. Determine a fusion rotation matrix according to the Euler angle mean and a preset fusion rotation matrix conversion formula group.
[0154] It should be noted that the first Euler angle mean, the second Euler angle mean and the third Euler angle mean are substituted into the preset fusion rotation matrix conversion formula group to obtain the fusion rotation matrix, wherein the preset fusion rotation matrix conversion formula group is specifically:
[0155]
[0156]
[0157]
[0158] R f =R z1 R x R z2 ;
[0159] Among them, R f is the fusion rotation matrix; R z1 is the first vertical axis rotation matrix; R x is the horizontal axis rotation matrix; R z2 is the second vertical axis rotation matrix; α f is the mean value of the first Euler angle; β f is the mean value of the second Euler angle; f is the mean value of the third Euler angle.
[0160] In this embodiment, the relative position and posture of the fused drone camera is determined based on the random sampling consensus algorithm and the relative position and posture of each drone camera.
[0161] Step 306: Substitute the relative pose of the fused drone camera into the preset pose conversion formula to calculate the relative pose of the target drone center.
[0162] It should be noted that the pose transformation relationship R from the camera to the center of the drone measured in advance is bc and t bc , and according to the preset posture conversion formula, the obtained fusion result (fusion rotation matrix and fusion translation vector) can be converted into the posture R of the center of the drone relative to the center of the board bw and t bw .
[0163] In this embodiment, the relative pose of the fused drone camera is substituted into the preset pose conversion formula to calculate the relative pose of the target drone center.
[0164] As a comparison of technical effects, it can be combined with the existing technology for reference. The existing vision-based two-dimensional code markers are mainly used for the relative pose (position and attitude) estimation of drones. This type of two-dimensional code marker is composed of black and white squares or other geometric figures, and has obvious visual features. Currently, the more commonly used two-dimensional code markers are ArUco, AprilTag, ARTag (Augmented Reality Tag), etc. Among them, the detection speed of ArUco code is fast and the detection accuracy is high, and it is often used to solve relative pose. In the relative pose solution, the drone obtains the two-dimensional code image on the unmanned vehicle platform through the onboard camera, uses the visual algorithm to extract the corner feature information of the two-dimensional code, and then solves the equation group through the relationship between the image coordinate system and the three-dimensional coordinates of the platform, so as to solve the pose of the drone relative to the platform. At present, the pose estimation scheme that is most similar to the present invention is the method based on point projection. This method is based on the principle of camera imaging, that is, a point in three-dimensional space is projected as a point on the pixel plane by the camera. This method first obtains the pixel coordinates of the QR code feature points on the image through image processing, and infers the corresponding three-dimensional space coordinates of these points based on the known QR code size information. The corresponding relationship between the pixel-space coordinates of these points is used to establish a set of equations to solve the position and posture of the drone relative to the unmanned vehicle platform. In addition, there is a line projection-based solution. The line-based solution uses the projection relationship of multiple straight lines in space on the image plane and the known information such as the slope of the straight line to solve the geometric transformation of the spatial coordinate system and the pixel coordinate system to obtain the relative position and posture. Although the line projection-based solution can make more full use of geometric information, it is less used because the marker is easy to be out of the field of view in close-range detection.
[0165] However, the point projection-based solution in the above method is more sensitive to the recognition distance. When the UAV is close to the unmanned vehicle platform, the QR code mark cannot appear completely in the field of view and the pose cannot be calculated. When the UAV is far away from the platform, the area occupied by the QR code mark in the field of view is too small, making it difficult to identify. At the same time, the pose estimation error of this solution is large when the mark is blocked or in reflective, rainy or foggy weather. The line projection-based solution is limited by the specific geometric relationship of spatial straight lines and cannot meet the needs of close-range pose estimation.
[0166] In view of the above problems, the present invention proposes a method for relative posture positioning of unmanned aerial vehicles. The ArUco marker plate is pasted on the unmanned vehicle platform, and the camera is turned on to collect pictures in real time; the collected pictures are detected by candidate frames, and the area where the ArUco code is located is segmented; all recognized ArUco codes are numbered and identified. The ArUco code is composed of multiple black and white squares, and their numbers can be uniquely determined according to the number and arrangement of the squares; corner point correction. The corner points detected in the second step are pixel-level. This step takes the corner point position as the center, constructs a local window, and further refines the screening to obtain sub-pixel corner points; pose estimation is performed based on the corner points. Here, the PnP algorithm is used for solution; the position center conversion of the camera relative to each ArUco code obtained in the fifth step is performed. Here, according to the number information detected in the third step and the distance from the code center to the board center known in advance, the code position can be unified to the center of the ArUco marker board; the positioning results are fused, and the RANSAC algorithm is used for the position result obtained in the sixth step, and multiple steps are iterated until the result with smaller error is screened out; the position transformation matrix of the camera and the center of the drone and the result obtained in the sixth step are used to solve the position of the drone relative to the center of the ArUco marker board. In view of the shortcomings of the existing scheme, by designing a two-dimensional code array and a relative position estimation algorithm, the drone can accurately estimate the relative position and position of the unmanned vehicle platform in a variety of application scenarios; through specific shapes and arrangements, the code recognition accuracy and robustness of ArUco are improved. This layout design enables ArUco codes to be quickly and accurately recognized in different scenarios, providing a reliable basis for information recognition and positioning, and can quickly recognize ArUco codes with complex layouts. The algorithm combines image processing and pattern recognition technology and has strong adaptability and robustness. Through the optimization algorithm, accurate recognition of ArUco codes under different angles and lighting conditions is achieved, providing reliable technical support for information extraction and positioning, and with good adaptability to application scenarios, it can be widely used in industrial production, logistics management, intelligent transportation and other fields. Through customized ArUco code layout and optimized recognition algorithm, the needs of information recognition and positioning in different scenarios are met, providing a reliable solution for information management and positioning in various application scenarios.
[0167] In summary, the current relative positioning method has problems such as insufficient accuracy, poor robustness or high cost, which affects the performance and reliability of the air-ground collaborative system. The relative posture positioning method of a drone proposed by the present invention can solve the problem of the relative posture of the drone and the unmanned vehicle in the air-ground collaborative system, can quickly and accurately identify the ArUco code in the image, and realize the posture estimation of the drone through the RANSAC algorithm. Compared with the traditional method, the recognition speed of the present invention is faster and the positioning accuracy is higher. At the same time, the present invention takes into account the application scenarios under different environmental conditions and designs a more adaptable ArUco code layout and recognition algorithm. Even in the case of lighting changes, occlusion or interference, the ArUco code can still be stably identified and accurate position positioning can be achieved; by placing multiple ArUco codes and establishing the position relationship between them, the present invention can integrate multiple position information and improve the robustness of the system. Even if an ArUco code fails or is blocked, the information of other ArUco codes can still be relied on to accurately locate the drone. The present invention also takes into account the application requirements under different distances and environmental conditions, designs ArUco code layouts of different sizes, and implements corresponding recognition algorithms. This enables the drone to effectively identify and locate the ArUco code at different distances, improving the adaptability and stability of the entire air-ground collaborative system. Therefore, compared with the prior art, the present invention has higher recognition speed, stronger robustness, more location information integration capabilities and better environmental adaptability, and can more effectively achieve precise positioning and navigation of the air-ground collaborative system.
[0168] In an embodiment of the present invention, the present invention provides a method for relative posture positioning of a drone, firstly, obtaining a drone two-dimensional code mark plate image, and performing two-dimensional code recognition on the drone two-dimensional code mark plate image, and outputting multiple two-dimensional code encoding information; then, using a preset posture transformation operation formula to calculate the drone camera relative posture corresponding to each two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each two-dimensional code encoding information; according to a random sampling consensus algorithm and the relative postures of each drone camera, the relative posture of the fused drone camera is determined; finally, the relative posture of the fused drone camera is substituted into the preset posture conversion formula to calculate the relative posture of the center of the target drone; based on the above scheme, multiple two-dimensional code encoding information obtained by performing two-dimensional code recognition on the drone two-dimensional code mark plate image are combined with the relative posture and substituted into the preset posture conversion formula, the preset posture transformation operation formula and the random sampling consensus algorithm to determine the relative posture of the center of the target drone. This process integrates the posture information of multiple two-dimensional codes, reduces the sensitivity of the drone's recognition distance, and further improves the accuracy of the drone's relative posture.
[0169] See also Figure 5 , Figure 5 A structural block diagram of a relative posture positioning system for an unmanned aerial vehicle provided in an embodiment of the present invention.
[0170] The present invention provides a relative posture positioning system for unmanned aerial vehicles, comprising:
[0171] The acquisition module 501 is used to acquire the drone QR code mark plate image, perform QR code recognition on the drone QR code mark plate image, and output multiple QR code encoding information;
[0172] The module 502 is used to calculate the relative posture of the drone camera corresponding to each QR code information according to the QR code length distance data corresponding to each QR code information by using a preset posture transformation calculation formula;
[0173] According to module 503, for determining the relative pose of the fused drone camera according to the random sampling consensus algorithm and the relative pose of each drone camera;
[0174] The calculation module 504 is used to substitute the relative posture of the fused drone camera into the preset posture conversion formula to calculate the relative posture of the target drone center.
[0175] Furthermore, the acquisition module 501 includes:
[0176] A preprocessing submodule is used to preprocess the drone QR code marker image to generate a denoised QR code marker image;
[0177] A segmentation submodule is used to perform image segmentation on the denoised two-dimensional code mark plate image by using the maximum inter-class variance method, and output a black and white two-dimensional code mark plate image;
[0178] An extraction submodule is used to extract the graphic contour of the black and white two-dimensional code mark plate image using a contour recognition algorithm and output a plurality of graphic contours;
[0179] A screening submodule is used to screen each graphic outline using a polygonal approximation algorithm and output a QR code candidate box corresponding to each graphic outline;
[0180] A transformation submodule, used to perform perspective transformation on each QR code candidate frame to generate a corrected QR code candidate frame corresponding to each QR code candidate frame;
[0181] A division submodule, used to divide each corrected QR code candidate frame into grids, and output a plurality of pixel grids corresponding to each corrected QR code candidate frame;
[0182] The statistical submodule is used to generate the two-dimensional code encoding information corresponding to each correction two-dimensional code candidate frame according to the number of pixels in each pixel grid counted by using a preset two-dimensional code dictionary.
[0183] Further, the preset posture transformation operation formula includes a posture transformation matrix formula group and a relative posture operation formula; the two-dimensional code length distance data includes the two-dimensional code length, the two-dimensional code horizontal distance and the two-dimensional code vertical distance; the module 502 is adopted, including:
[0184] A corner point coordinate submodule, used to determine the corner point coordinate data corresponding to each QR code encoding information based on the QR code length corresponding to each QR code encoding information;
[0185] The posture transformation submodule is used to determine the posture transformation matrix corresponding to each QR code encoding information according to the coordinate data of each corner point and the posture transformation matrix formula group;
[0186] The relative posture submodule is used to calculate the relative posture of the drone camera corresponding to each QR code encoding information based on the relative posture calculation formula according to each posture transformation matrix, the horizontal distance of each QR code and the vertical distance of each QR code.
[0187] Further, the relative position and posture of the drone camera is fused including the fusion rotation matrix and the fusion translation vector, according to module 503, including:
[0188] A first submodule, configured to select a plurality of first intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio;
[0189] A second submodule is used to perform a mean operation on the first drone camera translation vectors in the relative positions of the first intermediate drone cameras, and output a first translation vector mean;
[0190] The third submodule is used to select a plurality of second intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio;
[0191] A fourth submodule is used to perform a mean operation on the second drone camera translation vectors in the relative positions of the second intermediate drone cameras, and output a second translation vector mean;
[0192] A fifth submodule is used to perform a difference operation on the first translation vector mean and the second translation vector mean, output a mean error and compare it with a preset error threshold;
[0193] A sixth submodule, configured to use the second translation vector mean as a fused translation vector if the mean error is less than a preset error threshold;
[0194] The seventh submodule is used to perform Euler angle fusion on the second drone camera rotation matrix in the relative position of each second intermediate drone camera to fuse the rotation matrix.
[0195] Furthermore, the seventh submodule includes:
[0196] An Euler angle unit, used to calculate the Euler angle corresponding to each second drone camera rotation matrix according to the matrix elements in each second drone camera rotation matrix by using a preset Euler angle calculation formula;
[0197] The Euler angle averaging unit is used to perform averaging operation on each Euler angle and output the Euler angle average;
[0198] The fusion matrix unit is used to determine the fusion rotation matrix according to the Euler angle mean and a preset fusion rotation matrix conversion formula group.
[0199] Optionally, the corner point coordinate data includes the first corner point coordinates, the second corner point coordinates, the third corner point coordinates and the fourth corner point coordinates, the first corner point coordinates include the first corner point horizontal coordinate, the first corner point vertical coordinate and the first corner point vertical coordinate, the second corner point coordinates include the second corner point horizontal coordinate, the second corner point vertical coordinate and the second corner point vertical coordinate, the third corner point coordinates include the third corner point horizontal coordinate, the third corner point vertical coordinate and the third corner point vertical coordinate, and the fourth corner point coordinates include the fourth corner point horizontal coordinate, the fourth corner point vertical coordinate and the fourth corner point vertical coordinate; the posture transformation matrix formula group is specifically:
[0200]
[0201] Among them, s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; t1 is the first matrix element in the pose transformation matrix; x m y is the horizontal coordinate of the corner point, which includes the first corner point horizontal coordinate, the second corner point horizontal coordinate, the third corner point horizontal coordinate and the fourth corner point horizontal coordinate; m is the ordinate of the corner point, which includes the first ordinate of the corner point, the second ordinate of the corner point, the third ordinate of the corner point and the fourth ordinate of the corner point; m is the vertical coordinate of the corner point, and the vertical coordinate of the corner point includes the first vertical coordinate of the corner point, the second vertical coordinate of the corner point, the third vertical coordinate of the corner point and the fourth vertical coordinate of the corner point; t2 is the second matrix element in the posture transformation matrix; t3 is the third matrix element in the posture transformation matrix; t4 is the fourth matrix element in the posture transformation matrix; t5 is the fifth matrix element in the posture transformation matrix; t6 is the sixth matrix element in the posture transformation matrix; t7 is the seventh matrix element in the posture transformation matrix; t8 is the eighth matrix element in the posture transformation matrix; t9 is the ninth matrix element in the posture transformation matrix; t 10 is the tenth matrix element in the posture transformation matrix; t 11 is the eleventh matrix element in the posture transformation matrix; t 12 It is the twelfth matrix element in the pose transformation matrix.
[0202] The relative posture calculation formula is as follows:
[0203]
[0204] Among them, R w is the drone camera rotation matrix in the drone camera relative pose; t w is the translation vector of the drone camera in the relative position of the drone camera; d x is the horizontal distance of the QR code; d y is the vertical distance of the QR code; R m is the posture rotation matrix in the posture transformation matrix; t m is the pose translation vector in the pose transformation matrix.
[0205] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, modules, sub-modules and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0206] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory; when the computer program is executed by the processor, the processor executes the steps of the relative posture positioning method of a drone as described in any of the above embodiments.
[0207] An embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the relative posture positioning method of a drone as in any of the above embodiments are implemented.
[0208] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the relative posture positioning method of a drone as in any of the above embodiments.
[0209] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0210] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0211] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for relative posture positioning of unmanned aerial vehicles, It is characterized in that include: Acquire a drone QR code marking plate image, perform QR code recognition on the drone QR code marking plate image, and output multiple QR code encoding information; The preset posture transformation calculation formula is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each of the two-dimensional code encoding information; Determine the relative position and posture of the fused drone camera according to the random sampling consensus algorithm and the relative position and posture of each of the drone cameras; Substitute the relative pose of the fused drone camera into the preset pose conversion formula to calculate the relative pose of the target drone center.
2. The method for relative posture positioning of a drone according to claim 1, It is characterized in that The step of performing two-dimensional code recognition on the drone two-dimensional code mark plate image and outputting a plurality of two-dimensional code encoding information comprises: Preprocessing the drone two-dimensional code mark plate image to generate a denoised two-dimensional code mark plate image; Using the maximum inter-class variance method to perform image segmentation on the denoised two-dimensional code mark plate image, and outputting a black and white two-dimensional code mark plate image; Using a contour recognition algorithm to extract the graphic contour of the black and white two-dimensional code mark plate image, and outputting a plurality of graphic contours; Using a polygonal approximation algorithm to screen the contours of each graphic, and outputting a QR code candidate frame corresponding to each contour of the graphic; Performing perspective transformation on each of the two-dimensional code candidate frames to generate a corrected two-dimensional code candidate frame corresponding to each of the two-dimensional code candidate frames; Divide each of the corrected two-dimensional code candidate frames into grids, and output a plurality of pixel grids corresponding to each of the corrected two-dimensional code candidate frames; A preset two-dimensional code dictionary is used to generate two-dimensional code encoding information corresponding to each of the correction two-dimensional code candidate frames according to the counted number of pixels in each of the pixel grids.
3. The method for relative posture positioning of a drone according to claim 1, It is characterized in that The preset posture transformation calculation formula includes a posture transformation matrix formula group and a relative posture calculation formula; the two-dimensional code length and distance data include the two-dimensional code length, the two-dimensional code horizontal distance and the two-dimensional code vertical distance; the step of using the preset posture transformation calculation formula to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length and distance data corresponding to each of the two-dimensional code encoding information includes: Based on the length of the two-dimensional code corresponding to each of the two-dimensional code encoding information, determine the corner point coordinate data corresponding to each of the two-dimensional code encoding information; Determine the posture transformation matrix corresponding to each of the two-dimensional code encoding information according to each of the corner point coordinate data and the posture transformation matrix formula group; The relative posture calculation formula is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to each of the posture transformation matrices, the horizontal distance of each two-dimensional code and the vertical distance of each two-dimensional code.
4. The method for relative posture positioning of a drone according to claim 1, It is characterized in that The fused drone camera relative posture includes a fused rotation matrix and a fused translation vector; the step of determining the fused drone camera relative posture according to the random sampling consensus algorithm and the relative posture of each drone camera includes: Selecting a plurality of first intermediate drone camera relative postures from the drone camera relative postures according to a preset sampling ratio; Performing a mean operation on the first drone camera translation vectors in each of the first intermediate drone camera relative postures, and outputting a first translation vector mean; Selecting a plurality of second intermediate drone camera relative postures from the drone camera relative postures according to the preset sampling ratio; Performing a mean operation on the second drone camera translation vectors in each of the second intermediate drone camera relative postures, and outputting a second translation vector mean; Performing a difference operation on the first translation vector mean and the second translation vector mean, outputting a mean error and comparing it with a preset error threshold; If the mean error is less than the preset error threshold, taking the mean of the second translation vector as the fused translation vector; The rotation matrices of the second drone cameras in the relative positions of the second intermediate drone cameras are fused by Euler angles to fuse the rotation matrices.
5. The method for relative posture positioning of a UAV according to claim 4, It is characterized in that The step of performing Euler angle fusion on the second drone camera rotation matrices in the relative positions of the second intermediate drone cameras to fuse the rotation matrices comprises: Calculate the Euler angle corresponding to each second drone camera rotation matrix according to the matrix elements in each second drone camera rotation matrix using a preset Euler angle calculation formula; Performing a mean operation on each of the Euler angles, and outputting a mean value of the Euler angles; The fusion rotation matrix is determined according to the Euler angle mean and the preset fusion rotation matrix conversion formula group.
6. The method for relative posture positioning of a drone according to claim 3, It is characterized in that The corner point coordinate data includes the first corner point coordinates, the second corner point coordinates, the third corner point coordinates and the fourth corner point coordinates, the first corner point coordinates include the first corner point horizontal coordinates, the first corner point vertical coordinates and the first corner point vertical coordinates, the second corner point coordinates include the second corner point horizontal coordinates, the second corner point vertical coordinates and the second corner point vertical coordinates, the third corner point coordinates include the third corner point horizontal coordinates, the third corner point vertical coordinates and the third corner point vertical coordinates, the fourth corner point coordinates include the fourth corner point horizontal coordinates, the fourth corner point vertical coordinates and the fourth corner point vertical coordinates; the posture transformation matrix formula group is specifically: Where s is the pixel depth value; u is the horizontal coordinate of the pixel of the drone QR code marker image in the image coordinate system; v is the vertical coordinate of the pixel of the drone QR code marker image in the image coordinate system; t 1 is the first matrix element in the pose transformation matrix; x m y is the horizontal coordinate of the corner point, which includes the first corner point horizontal coordinate, the second corner point horizontal coordinate, the third corner point horizontal coordinate and the fourth corner point horizontal coordinate; m is the ordinate of the corner point, which includes the first ordinate of the corner point, the second ordinate of the corner point, the third ordinate of the corner point and the fourth ordinate of the corner point; m is the vertical coordinate of the corner point, which includes the first vertical coordinate of the corner point, the second vertical coordinate of the corner point, the third vertical coordinate of the corner point and the fourth vertical coordinate of the corner point; t 2 is the second matrix element in the pose transformation matrix; t 3 is the third matrix element in the pose transformation matrix; t 4 is the fourth matrix element in the pose transformation matrix; t 5 is the fifth matrix element in the pose transformation matrix; t 6 is the sixth matrix element in the pose transformation matrix; t 7 is the seventh matrix element in the posture transformation matrix; t 8 is the eighth matrix element in the posture transformation matrix; t 9 is the ninth matrix element in the pose transformation matrix; t 10 is the tenth matrix element in the posture transformation matrix; t 11 is the eleventh matrix element in the posture transformation matrix; t 12 is the twelfth matrix element in the posture transformation matrix; The relative posture calculation formula is specifically: Among them, R w is the drone camera rotation matrix in the drone camera relative pose; t w is the translation vector of the drone camera in the relative position of the drone camera; d x is the horizontal distance of the QR code; d y is the vertical distance of the QR code; R m is the posture rotation matrix in the posture transformation matrix; t m is the pose translation vector in the pose transformation matrix.
7. A relative posture positioning system for unmanned aerial vehicles, It is characterized in that include: An acquisition module is used to acquire a drone QR code mark plate image, perform QR code recognition on the drone QR code mark plate image, and output a plurality of QR code encoding information; An adopting module is used to calculate the relative posture of the drone camera corresponding to each of the two-dimensional code encoding information according to the two-dimensional code length distance data corresponding to each of the two-dimensional code encoding information by using a preset posture transformation calculation formula; According to the module, it is used to determine the relative pose of the fused drone camera based on the random sampling consensus algorithm and the relative pose of each of the drone cameras; The calculation module is used to substitute the relative posture of the fused drone camera into a preset posture conversion formula to calculate the relative posture of the target drone center.
8. An electronic device, It is characterized in that It includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the relative posture positioning method of the unmanned aerial vehicle as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program / instructions stored thereon, It is characterized in that When the computer program / instructions are executed by the processor, the steps of the method for relative posture positioning of a drone as described in any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by the processor, the steps of the method for relative posture positioning of a drone as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Two-dimensional code pose calibration method, device and system
CN110163912A
Unmanned aerial vehicle autonomous landing method and system based on nested two-dimensional code
CN113485449A
Mobile robot indoor positioning system and method based on ArUco array
CN116972844A
Unmanned aerial vehicle visual navigation positioning recovery method, system and device and readable storage medium
CN117649619A
Cited By
XR equipment repositioning method without map prior
CN120070818A
Unmanned aerial vehicle air docking method and device based on multiple two-dimensional codes
CN120508121A
Pose recognition method of transparent culture dish and related equipment
CN120747206A
A pose recognition method of a transparent culture dish and a related device
CN120747206B
Robot docking method, electronic equipment and computer readable storage medium
CN121104993A
