Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides an unmanned aerial vehicle landing method based on an embedded two-dimensional code.
In order to achieve the purpose, the invention adopts the following technical scheme:
an unmanned aerial vehicle landing method based on embedded two-dimensional codes,
the embedded two-dimensional code is arranged in the landing area; the unmanned aircraft is provided with an onboard camera for identifying the embedded two-dimensional code;
the airborne camera identifies the embedded two-dimensional code of the landing area;
the unmanned aerial vehicle decodes the embedded two-dimensional code;
judging the legality of the embedded two-dimensional code;
constructing a coordinate system taking the embedded two-dimensional code as a reference according to a legal embedded two-dimensional code, and extracting four corner coordinates of the embedded two-dimensional code;
calculating the actual coordinates and attitude information of the unmanned aircraft in a coordinate system according to the four corner coordinates of the embedded two-dimensional code;
the unmanned plane is guided to move according to the relative position of the space coordinate of the unmanned plane and the origin of the coordinate system and landed at the origin of the coordinate system.
The further technical scheme is as follows: the embedded two-dimensional code is a grid formed by combining N × N identification monomers and is set as a mother embedded two-dimensional code; the [ (N +1)/2] × [ (N +1)/2] recognition monomer of the embedded two-dimensional code is a central recognition monomer;
the central identification single body is embedded with a sub-embedded two-dimensional code; the sub-embedded two-dimensional code is a grid formed by combining N × N identification monomers; the [ (N +1)/2] × [ (N +1)/2] identification monomer of the sub-embedded two-dimensional code is a sub-center identification monomer; the sub-center identification single body is provided with a grid of N × N identification single body combinations;
wherein, the identification monomer is in binarization setting, and N is an odd number which is more than or equal to 3.
The further technical scheme is as follows: the identification monomer is black or white; wherein the black color of the identification monomer is defined as 1, and the white color is defined as 0; or, the black color of the identification monomer is defined as 0, and the white color is defined as 1.
The further technical scheme is as follows: the 1 st identification monomer, the Nth 1 identification monomer and the Nth identification monomer of the N-N grid are respectively black, black and white;
or the like, or, alternatively,
the 1 st identification monomer, the Nth 1 identification monomer and the Nth identification monomer of the N-N grid are respectively white, black and black.
The further technical scheme is as follows: the embedded two-dimensional code recognition of the landing area by the airborne camera is realized by acquiring an image of the landing area by the airborne camera when the unmanned aircraft is positioned above the landing area; filtering and binarizing the image by an internal program of the unmanned aircraft; and identifying the embedded two-dimensional code from the processed image.
The further technical scheme is as follows: identifying pixels on grid line intersection points and pixels in a set range around the intersection points from the N-N grid by an onboard camera of the unmanned aircraft, judging the color according to binarization, and judging the area of the identified single body; decoding the coded value of the embedded two-dimensional code according to the definition of image binaryzation; and comparing the decoded code value of the embedded two-dimensional code with the two-dimensional code value stored in the database in the unmanned aerial vehicle to judge the legality of the embedded two-dimensional code.
The further technical scheme is as follows: the coordinate system of the actual physical coordinates of the four corners of the embedded two-dimensional code is based on the center of the embedded two-dimensional code as the original point, the x axis is parallel to one side of the embedded two-dimensional code, and the direction is any direction; the z axis is vertical to the plane of the embedded two-dimensional code and faces downwards, and the y axis is vertical to the plane formed by the x axis and the z axis; and calculating the actual physical coordinates of the four corners through the actual size of the embedded two-dimensional code.
The further technical scheme is as follows: and calculating the space coordinate and attitude information of the unmanned aircraft by a PNP algorithm according to the two-dimensional coordinates of the four corners of the embedded two-dimensional code in the XY plane of the coordinate system and the space coordinate of the coordinate system.
The further technical scheme is as follows: the guiding of the relative position of the space coordinate of the unmanned aircraft and the origin of the coordinate system is to control the displacement of the unmanned aircraft by a PID control algorithm; in the guiding process of the unmanned aerial vehicle, four corners of the mother embedded two-dimensional code are used as identification points in the visual field range of the airborne camera, and the coordinate system of the mother embedded two-dimensional code is used for guiding landing; if the vision range of the airborne camera is exceeded, the airborne camera takes the four corners of the sub-embedded two-dimensional code as identification points, and the sub-embedded two-dimensional code is guided to land by the coordinate system of the sub-embedded two-dimensional code until the sub-embedded two-dimensional code lands to the origin of the coordinate system.
The further technical scheme is as follows: and determining the coordinates of the unmanned aerial vehicle, namely solving the external coordinate parameters of the airborne camera by utilizing an algorithm of minimizing a reprojection error according to the comparison between the internal coordinate parameters set by the airborne camera and the xy plane coordinates and space coordinates of the four corners of the embedded two-dimensional code, wherein the external coordinate parameters of the airborne camera are the position coordinates of the unmanned aerial vehicle in a coordinate system, and recognizing the attitude information of the unmanned aerial vehicle.
Compared with the prior art, the invention has the beneficial effects that: the unmanned aerial vehicle is guided to automatically land through the embedded two-dimensional codes, the unmanned aerial vehicle descends based on the mother embedded two-dimensional code within a certain height range, and after the unmanned aerial vehicle descends to a certain height, the son embedded two-dimensional code is started when the mother embedded two-dimensional code is not within the visual range of the onboard camera, so that the whole descending process is ensured to have a descending target. The embedded two-dimensional code is simple, effective information of a unit area is rich in the landing process of the unmanned aerial vehicle, the target is not easy to lose, the identified height range is wide, the whole landing height of the unmanned aerial vehicle can be covered, and the landing accuracy is high.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented according to the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more apparent, the following detailed description will be given of preferred embodiments.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
FIGS. 1 to 4 are drawings of the present invention.
The embodiment provides an unmanned aerial vehicle landing method based on an embedded two-dimensional code, and particularly relates to an automatic landing method for an unmanned aerial vehicle. And (3) setting the landing platform with the embedded two-dimensional code at a proper landing position, and automatically or manually flying the unmanned plane to a landing area and a proper height.
The embedded two-dimensional code is a grid formed by combining N × N identification monomers and is set as a mother embedded two-dimensional code. The [ (N +1)/2] × [ (N +1)/2] recognition monomer of the embedded two-dimensional code is a central recognition monomer.
The center identification single body is embedded with a sub-embedded two-dimensional code. The sub-embedded two-dimensional code is a grid of N × N identification monomer combinations. The [ (N +1)/2] × [ (N +1)/2] identification monomer of the sub-embedded two-dimensional code is a sub-center identification monomer. The sub-center identification single body is provided with a grid of N × N identification single body combinations; wherein N is an odd number of 3 or more. And an outer frame is arranged outside the grid of the N-by-N identification monomer combinations.
Specifically, referring to fig. 1 and 2, taking a grid of 3 × 3 identification cells as an example, a sub-embedded two-dimensional code is further arranged in the identification cell 2 × 2 (i.e., the middle identification cell) of the parent embedded two-dimensional code. In the landing process of the unmanned aerial vehicle, an airborne camera of the unmanned aerial vehicle firstly identifies a mother embedded two-dimensional code (a grid combined by 3 × 3 identification monomers), when the unmanned aerial vehicle lands to a certain height, the mother embedded two-dimensional code can exceed the visual range of the airborne camera, then the airborne camera of the unmanned aerial vehicle can identify a child embedded two-dimensional code, and the child embedded two-dimensional code is used as the landing reference again to continue landing.
For the accuracy of landing, the sub-embedded two-dimensional code can be re-arranged at the [ (N +1)/2] × [ (N +1)/2] recognition unit of the sub-embedded two-dimensional code, and the principle of landing is the same as that described above.
Theoretically, infinite sub-embedded two-dimensional codes can be set, wherein each embedded two-dimensional code comprises a mother embedded two-dimensional code and n embedded two-dimensional codes, and n is greater than or equal to 1; the nth embedded two-dimensional code is arranged on the [ (N +1)/2] × [ (N +1)/2] identification monomer of the (N-1) th embedded two-dimensional code as a central identification monomer.
The more the sub-embedded two-dimensional codes are set, the higher the landing accuracy is, and generally, triple-embedded two-dimensional codes (a mother embedded two-dimensional code, a child embedded two-dimensional code, and a child-child embedded two-dimensional code) are set.
Identifying the monomer as a binary setting, and identifying the monomer as black or white; wherein the black color of the identification monomer is defined as 1, and the white color is defined as 0; or, the black color of the identification monomer is defined as 0, and the white color is defined as 1. The binarization setting is beneficial to the identification and decoding of the airborne camera.
Specifically, in order to obtain a correct sequence through shooting at different angles, the 1 st x 1 identification single body, the 1 st x N identification single body, the N x 1 identification single body and the N x N identification single body of the N x N grid are respectively black, black and white; or the 1 st identification monomer, the N1 st identification monomer and the N identification monomer of the N X N grid are respectively white, black and black.
For example, referring to fig. 1 and 2, a grid formed by combining 3 × 3 identification cells includes a 3 × 3 grid inside a frame, and 9 identification cells of small squares in total, each identification cell may be black and white, and in order to obtain a correct sequence for shooting at different angles, the four small squares at the upper left corner, the upper right corner, the lower left corner and the lower right corner are respectively black, black and white; white, black and black can be reversed, and black and white can be customized. While black is defined as 1 and white is defined as 0, conversely, black is defined as 0 and white is defined as 1.
In order to embed the two-dimensional code into another two-dimensional code, the middle small square (i.e., the middle identification unit) is replaced by another small-sized two-dimensional code (i.e., the sub-embedded two-dimensional code). The remaining 4 small squares identify the single body in the sequence from top to bottom and from left to right, the color is black or white, the code value of the two-dimensional code is determined by the 4 small squares, and the coding mode supports 16(2 fourth power) two-dimensional code values.
Referring to fig. 3, the number of grids of the embedded two-dimensional code (e.g., 5 × 5) may be increased to increase the number of codes of the two-dimensional code. The middle identification single body is embedded into a small-sized sub-embedded two-dimensional code, and the function of the middle identification single body is the same as that of a mother embedded two-dimensional code. If necessary, the identification single body in the middle of the sub-embedded two-dimensional code can be embedded with an embedded two-dimensional code of a next level. And the coding values of the mother embedded two-dimensional code and the son embedded two-dimensional code are changed according to the needs.
Referring to fig. 4, after the embedded two-dimensional code is set in the landing area, the unmanned aerial vehicle flies to the predetermined landing area and lands according to the following steps:
step S10, arranging the embedded two-dimensional code in a landing area; the unmanned aircraft is provided with an onboard camera for identifying the embedded two-dimensional code; the airborne camera identifies the embedded two-dimensional code of the landing area.
The embedded two-dimensional code identification of the landing area by the airborne camera is realized by acquiring an image of the landing area by the airborne camera when the unmanned aircraft is positioned above the landing area; filtering and binarizing the image by an internal program of the unmanned aircraft; and identifying the embedded two-dimensional code from the processed image. The onboard camera is installed at the bottom of the unmanned aircraft, acquires images of the landing point at a speed of 60hz, and transmits the images to a processing unit in the interior of the unmanned aircraft for processing.
The unmanned aerial vehicle photographs the periphery of the landing point at a certain height, and can photograph through scanning in a matrix form to determine the approximate position of the embedded two-dimensional code, then search in a reduced range, finally determine the accurate position of the embedded two-dimensional code, and further photograph and identify.
Generally, the embedded two-dimensional code is arranged on a flat landing surface, and the periphery of the embedded two-dimensional code is a regular figure such as a quadrangle and a circle, so that the identification of an airborne camera is facilitated.
And step S20, decoding the embedded two-dimensional code after the unmanned aerial vehicle recognizes, and judging the legality of the embedded two-dimensional code.
The unmanned aerial vehicle identifies the range of the embedded two-dimensional code from the photographed image, determines the position of the specific embedded two-dimensional code, and the onboard camera can decode the embedded two-dimensional code. And the onboard camera of the unmanned aircraft identifies pixels on grid line intersection points and pixels in a set range around the intersection points from the N-N grid, carries out color judgment according to binarization and judges the area of the identified single body. And decoding the coded value of the embedded two-dimensional code according to the definition of image binaryzation.
And step S30, judging the validity of the embedded two-dimensional code. And comparing the decoded code value of the embedded two-dimensional code with the two-dimensional code value stored in the unmanned aircraft database to judge the legality of the embedded two-dimensional code. If the coded value of the decoded embedded two-dimensional code is consistent with the coded value of the two-dimensional code stored in the unmanned aircraft database, the two-dimensional code is a legal embedded two-dimensional code; and if the coded value of the decoded embedded two-dimensional code is not consistent with the two-dimensional code coded value stored in the unmanned aircraft database, the decoded embedded two-dimensional code is an illegal embedded two-dimensional code, and the step S10 is returned to continuously identify and decode the embedded two-dimensional code.
And step S40, constructing a coordinate system taking the embedded two-dimensional code as a reference according to the decoded legal embedded two-dimensional code, and extracting four corner coordinates of the embedded two-dimensional code.
The coordinate system where the actual physical coordinates of four corners of the embedded two-dimensional code are located is based on that the center of the embedded two-dimensional code is taken as an original point, the x axis is parallel to one side of the embedded two-dimensional code, and the direction is any direction; the z axis is vertical to the plane of the two-dimensional code and faces downwards, and the y axis is vertical to the plane formed by the x axis and the z axis. And calculating the actual physical coordinates of the four corners through the actual size of the embedded two-dimensional code.
Preferably, the y-axis is perpendicular to the plane formed by the x-axis and the z-axis to construct a right-hand coordinate system.
And step S50, calculating the actual coordinates and attitude information of the unmanned aerial vehicle in the coordinate system according to the four corner coordinates of the embedded two-dimensional code.
And calculating the space coordinate and attitude information of the unmanned aircraft by a PNP algorithm according to the two-dimensional coordinates of the four corners of the embedded two-dimensional code in the XY plane of the coordinate system and the space coordinate of the coordinate system.
The algorithm for solving the external parameters of the airborne camera by utilizing the minimized reprojection error under the condition of knowing or not knowing the internal parameters of the airborne camera through a plurality of pairs of matching points of space coordinates and plane coordinates, wherein the external parameters of the airborne camera are the position and attitude information of the airborne camera in a coordinate system.
Specifically, the coordinates of the unmanned aerial vehicle are determined, according to the comparison between the internal coordinate parameters set by the airborne camera and the xy plane coordinates and the space coordinates of the four corners of the embedded two-dimensional code, the external coordinate parameters of the airborne camera are solved by utilizing an algorithm for minimizing the reprojection error, and the external coordinate parameters of the airborne camera are the position coordinates of the unmanned aerial vehicle in a coordinate system, so that the attitude information of the unmanned aerial vehicle is identified.
And step S60, the unmanned plane guides the unmanned plane to move according to the relative position of the space coordinate of the unmanned plane and the origin of the coordinate system, and the unmanned plane lands on the origin of the coordinate system.
The guiding of the relative position of the space coordinate of the unmanned aircraft and the origin of the coordinate system is to control the displacement of the unmanned aircraft by a PID control algorithm; in the guiding process of the unmanned aerial vehicle, four corners of the mother embedded two-dimensional code are used as identification points in the visual field range of the airborne camera, and the coordinate system of the mother embedded two-dimensional code is used for guiding landing; and when the position of the airborne camera exceeds the visual field range of the airborne camera, the airborne camera takes the four corners of the sub-embedded two-dimensional code as identification points, and the sub-embedded two-dimensional code is guided to land by the coordinate system of the sub-embedded two-dimensional code until the sub-embedded two-dimensional code lands to the origin of the coordinate system.
Step S70, judging whether it is the origin of coordinates, if the landing position is the origin, ending the control; if not, the process returns to step S10 to continue execution.
In other embodiments, step S50 is to calculate the actual coordinates of the drone in the coordinate system according to the four corner coordinates of the embedded two-dimensional code, and calculate the attitude information according to the actual coordinates and the internal parameters of the onboard camera. And adjusting the landing attitude according to the attitude information of the unmanned plane. The landing attitude is set in the unmanned aircraft, so that the correct landing attitude of the unmanned aircraft can be continuously adjusted according to the relationship between the space coordinates of the unmanned aircraft and the internal coordinate parameters of the airborne camera.
Because the onboard camera is fixedly connected to the unmanned aerial vehicle, the coordinates (which can be approximately equal to) of the unmanned aerial vehicle can be obtained from the coordinates of the onboard camera in the embedded two-dimensional code coordinate system. And guiding (performing position control through a PID control algorithm) the movement of the unmanned aircraft according to the relative position of the unmanned aircraft and the embedded two-dimensional code, so that the coordinates of the unmanned aircraft are (0,0,0), and the unmanned aircraft can land on the two-dimensional code accurately. At the initial stage of the guidance landing of the embedded two-dimensional code, four corners of the embedded two-dimensional code are used as identification points, the four corners of the embedded two-dimensional code can exceed the visual field of a camera in the process of the continuous descending of the height of the unmanned aerial vehicle, and the embedded small two-dimensional code (namely, the embedded two-dimensional code) is used for positioning, so that the continuous and reliable landing process is ensured.
Compared with the prior art, the unmanned aerial vehicle is guided to automatically land through the embedded two-dimensional codes, the unmanned aerial vehicle descends based on the mother embedded two-dimensional code within a certain height range, and after the unmanned aerial vehicle descends to a certain height, the son embedded two-dimensional code is started when the mother embedded two-dimensional code is not within the visual range of the onboard camera, so that the whole descending process is ensured to have a descending target. The embedded two-dimensional code is simple, effective information of a unit area is rich in the landing process of the unmanned aerial vehicle, the target is not easy to lose, the identified height range is wide, the whole landing height range of the unmanned aerial vehicle can be covered, and the landing accuracy is high.
The technical contents of the present invention are further illustrated by the examples only for the convenience of the reader, but the embodiments of the present invention are not limited thereto, and any technical extension or re-creation based on the present invention is protected by the present invention. The protection scope of the invention is subject to the claims.