Unmanned aerial vehicle camera attitude estimation method and device based on evolutionary algorithm and two-dimensional code
By constructing an error model and applying evolutionary algorithm optimization, the problem of QR code posture information error in vertical landing of the drone is solved, and the effect of precise control and reducing the complexity of the algorithm is achieved.
Patent Information
- Application Number
- CN202411435590.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-17
AI Technical Summary
During the vertical landing of the drone, due to the uncertainty of the flight environment, the quality of the QR code image captured by the camera may be affected, resulting in errors in the extraction of QR code posture information. The existing technology increases the complexity of algorithms and computing resources It is difficult to improve accuracy and reduce complexity at the same time.
The error model is constructed using Taylor expansion, combined with an evolutionary algorithm to simulate biological evolution process, optimize the model through multiple iterations and two-population strategy, and generate optimal offspring to improve the accuracy of the error model and reduce the complexity of the algorithm, and apply the error model to The drone QR code assists the landing process and is used for precise control.
The accuracy of drone QR code attitude estimation is improved, the algorithm complexity is reduced, and the flight control system can obtain error values faster and more accurately, thereby achieving accurate drone control.
Smart Images

Figure CN119323606A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention generally relate to the field of drone technology, and more particularly to a method and device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code. Background Art
[0002] In the vertical landing technology of drones, QR codes are often used to estimate the camera attitude. First, the drone is moved to the vicinity of the landing point through the integrated navigation and positioning system, and the QR code is recognized using the image captured by the camera. If the QR code in the image is the same as the pre-stored QR code in the onboard computer, the plane marker is detected and the camera attitude is estimated through QR code recognition technology (such as ARUCO). In addition, the camera attitude and inertial navigation need to be combined to calculate the position of the center point of the QR code relative to the drone body coordinate system and the attitude of the drone in the local coordinate system of the QR code. Based on these data, the drone can automatically adjust its position and attitude, and finally achieve a smooth and accurate automatic landing process.
[0003] During the descent of the drone, due to the uncertainty of the flight environment (such as wind speed changes, light condition fluctuations, etc.), the quality of the QR code image captured by the camera may be affected, resulting in errors in the QR code attitude information extracted from the image. Although the current method of combining with inertial navigation systems (such as GPS, INS, etc.) is generally used to make up for this deficiency, this increases the complexity of the algorithm and places higher requirements on the real-time performance and computing resources of the calculation. Therefore, it is necessary to further improve the accuracy of estimating the camera attitude through the QR code, and to reduce the complexity of the algorithm while improving the accuracy. Summary of the invention
[0004] To solve the above problems, the present invention finds that there is a certain linear relationship between height and offset error and rotation error based on experimental data, and constructs an error model using Taylor expansion. The model is optimized simultaneously with accuracy and complexity as the goal. The evolutionary algorithm simulates the biological evolution process: reproduction, mutation, environmental selection, etc. After multiple rounds of iterations, the optimal offspring is generated, that is, a model with high accuracy and low algorithm complexity is guaranteed at the same time. In addition, a dual population strategy is adopted to ensure that each solution converges to the optimal solution set, thereby accelerating the convergence process. The error model is applied to the UAV QR code assisted landing process. Due to the high accuracy of the error model and the low algorithm complexity, the flight control system can obtain the error value faster and better, thereby performing precise control.
[0005] According to an embodiment of the present invention, a method and device for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code are provided.
[0006] In a first aspect of the present invention, a method for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code is provided. The method comprises:
[0007] When the drone is landing, it determines whether it is the first time to use the QR code to assist landing. If it is the first time, the camera will be calibrated. If it is not the first time, the QR code will be directly used to assist landing.
[0008] The camera calibration includes: camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code, collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set;
[0009] The steps of the two-dimensional code assisted landing are: using a two-dimensional code recognition algorithm to calculate the offset and rotation of the two-dimensional code; using an error model to convert altitude information into an error value; combining the offset and rotation obtained by the two-dimensional code recognition algorithm with the error value obtained by the error model, calculating the precise offset and rotation and sending them to the flight control system, and the flight control system controls the drone to deflect left and right and rotate according to the information obtained to complete the assisted landing.
[0010] Furthermore, the camera error calibration steps are as follows:
[0011] S1: Start the camera, use aruco technology to recognize the QR code, and output the offset and rotation of the QR code;
[0012] S2: Process the data and clean up the data with large filtering errors;
[0013] S3: Hover the drone directly above the drone, collect the offset and rotation of the QR code at different heights, and build a data set for the model;
[0014] S4: Construct an error model with height (z) as the independent variable, offset (x, y) and rotation (r, p, y) as the dependent variables. The transformation matrix between height and posture is as follows:
[0015]
[0016] S5: A multi-objective optimization algorithm is used to apply the constructed data set to the error model to improve the model accuracy. The multi-objective optimization algorithm adopts a multi-objective evolutionary algorithm based on dual populations, with model accuracy and algorithm complexity as the goals, and optimizes simultaneously.
[0017] Furthermore, the steps of the multi-objective optimization algorithm described in S5 are:
[0018] S51: Constructing the initial population: Randomly generate 99 other individuals based on the individual, thus constructing a population of 100 individuals;
[0019] S52: Calculate target value: use two target functions to calculate the target values of all individuals and define the maximum number of iterations;
[0020] S53: Determine whether the maximum number of iterations has been reached. If so, exit. If not, perform non-dominated sorting on each solution and classify all non-dominated solutions into the optimal sub-population.
[0021] S54: Traverse each individual and randomly select an individual from the optimal subpopulation as the parent;
[0022] S55: Use particle swarm algorithm to learn the excellent performance of the parent generation and generate offspring;
[0023] S56: Offspring mutation, calculate the target value of the offspring after enhancing randomness;
[0024] S57: Environment selection: perform non-dominated sorting on all parents and offspring, select the best 100 individuals, and repeat steps S53-S57.
[0025] Furthermore, the specific steps of using the two-dimensional code recognition algorithm to calculate the offset and rotation of the two-dimensional code are:
[0026] S01: Enhance the camera image to obtain the optimized QR code image, and use the ARUCO technology to calculate the offset and rotation of the QR code;
[0027] S02: Process the data and clean up the data with large filtering errors;
[0028] S03: If there are multiple two-dimensional codes in the acquired image, the data of each two-dimensional code is averaged to obtain the offset and rotation amount of each two-dimensional code;
[0029] S04: Output the current offset and rotation.
[0030] In a second aspect of the present invention, a device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code is provided. The device comprises:
[0031] Judgment module: used to determine whether it is the first time to use the QR code to assist landing when the drone is landing. If it is the first time, the camera calibration module is used to calibrate the camera. If it is not the first time, the QR code assisted landing module is used directly to perform the QR code assisted landing.
[0032] Camera calibration module: used for camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code and collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set.
[0033] The two-dimensional code assisted landing module includes:
[0034] Two-dimensional code recognition algorithm calculation module: used to calculate the offset and rotation of the two-dimensional code using the two-dimensional code recognition algorithm;
[0035] Error model calculation module: used to convert height information into error value using error model;
[0036] Drone landing module: It is used to combine the offset and rotation obtained by the QR code recognition algorithm with the error value obtained by the error model, calculate the precise offset and rotation and send them to the flight control system. The flight control system controls the drone to deflect and rotate left and right based on the information obtained to complete assisted landing.
[0037] Furthermore, the camera error calibration steps are as follows:
[0038] S1: Start the camera, use aruco technology to recognize the QR code, and output the offset and rotation of the QR code;
[0039] S2: Process the data and clean up the data with large filtering errors;
[0040] S3: Hover the drone directly above the drone, collect the offset and rotation of the QR code at different heights, and build a data set for the model;
[0041] S4: Construct an error model with height (z) as the independent variable, offset (x, y) and rotation (r, p, y) as the dependent variables. The transformation matrix between height and posture is as follows:
[0042]
[0043] S5: A multi-objective optimization algorithm is used to apply the constructed data set to the error model to improve the model accuracy. The multi-objective optimization algorithm adopts a multi-objective evolutionary algorithm based on dual populations, with model accuracy and algorithm complexity as the goals, and optimizes simultaneously.
[0044] Furthermore, the steps of the multi-objective optimization algorithm described in S5 are:
[0045] S51: Constructing the initial population: Randomly generate 99 other individuals based on the individual, thus constructing a population of 100 individuals;
[0046] S52: Calculate target value: use two target functions to calculate the target values of all individuals and define the maximum number of iterations;
[0047] S53: Determine whether the maximum number of iterations has been reached. If so, exit. If not, perform non-dominated sorting on each solution and classify all non-dominated solutions into the optimal sub-population.
[0048] S54: Traverse each individual and randomly select an individual from the optimal subpopulation as the parent;
[0049] S55: Use particle swarm algorithm to learn the excellent performance of the parent generation and generate offspring;
[0050] S56: Offspring mutation, calculate the target value of the offspring after enhancing randomness;
[0051] S57: Environment selection: perform non-dominated sorting on all parents and offspring, select the best 100 individuals, and repeat steps S53-S57.
[0052] Furthermore, the two-dimensional code recognition algorithm calculation module includes:
[0053] Data calculation module: used to enhance the camera image to obtain the optimized QR code image, and use the ARUCO technology to calculate the offset and rotation of the QR code;
[0054] Data processing module: used to process data and clean up and filter data with large errors;
[0055] Data synthesis module: if there are multiple QR codes in the acquired image, the data of each QR code is synthesized and averaged to obtain the offset and rotation of each QR code;
[0056] Data output module: used to output the current offset and rotation.
[0057] The meanings of the above mentioned English abbreviations:
[0058] aruco: an open source library for marker detection and pose estimation in augmented reality (AR) applications
[0059] The present invention finds that there is a certain linear relationship between height and offset error and rotation error based on experimental data, constructs an error model by using Taylor expansion, and optimizes the model simultaneously with the accuracy and complexity of the model. The evolutionary algorithm simulates the biological evolution process: reproduction, mutation, environmental selection, etc. After multiple rounds of iterations, the optimal offspring is generated, that is, a model with high accuracy and low algorithm complexity is guaranteed at the same time; in addition, a dual population strategy is adopted to ensure that each solution converges to the optimal solution set, thereby accelerating the convergence process; the error model is applied to the UAV two-dimensional code assisted landing process. Due to the high accuracy of the error model and the low algorithm complexity, the flight control system can obtain the error value faster and better, thereby performing precise control.
[0060] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings.
[0062] Figure 1 A flow chart of a method for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code according to an embodiment of the present invention is shown;
[0063] Figure 2 A camera calibration flow chart according to an embodiment of the present invention is shown;
[0064] Figure 3 A schematic diagram of a data collection process according to an embodiment of the present invention is shown;
[0065] Figure 4 shows an x-direction offset data flow chart according to an embodiment of the present invention;
[0066] Figure 5 A flow chart of a multi-objective evolutionary algorithm curve fitting according to an embodiment of the present invention is shown;
[0067] Figure 6 A multi-objective optimization algorithm flow chart according to an embodiment of the present invention is shown;
[0068] Figure 7 A QR code assisted landing flow chart according to an embodiment of the present invention is shown;
[0069] Figure 8 A block diagram of a device for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 described embodiments are 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.
[0071] According to an embodiment of the present invention, a method and device for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code are proposed. Based on experimental data, it is found that there is a certain linear relationship between the height and the offset error and the rotation error. The error model is constructed using Taylor expansion, and the model accuracy and complexity are optimized simultaneously. The evolutionary algorithm simulates the biological evolution process: reproduction, mutation, environmental selection, etc. After multiple rounds of iterations, the optimal offspring is generated, that is, a model with high accuracy and low algorithm complexity is guaranteed at the same time; in addition, a dual population strategy is adopted to ensure that each solution converges to the optimal solution set, thereby accelerating the convergence process; the error model is applied to the drone QR code assisted landing process. Due to the high accuracy of the error model and the low algorithm complexity, the flight control system can obtain the error value faster and better, thereby performing precise control.
[0072] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.
[0073] Figure 1 1 is a flow chart of a method for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to an embodiment of the present invention. The method comprises:
[0074] When the drone is landing, it determines whether it is the first time to use the QR code to assist landing. If it is the first time, the camera will be calibrated. If it is not the first time, the QR code will be directly used to assist landing.
[0075] The camera calibration includes: camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code, collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set;
[0076] The steps of the two-dimensional code assisted landing are: using a two-dimensional code recognition algorithm to calculate the offset and rotation of the two-dimensional code; using an error model to convert altitude information into an error value; combining the offset and rotation obtained by the two-dimensional code recognition algorithm with the error value obtained by the error model, calculating the precise offset and rotation and sending them to the flight control system, and the flight control system controls the drone to deflect left and right and rotate according to the information obtained to complete the assisted landing.
[0077] It should be noted that, although the operations of the method of the present invention are described in a specific order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0078] In order to explain more clearly the above-mentioned method of drone camera attitude estimation based on evolutionary algorithm and QR code, a specific embodiment is used for illustration below. However, it should be noted that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation to the present invention.
[0079] The following is a specific example to further explain the method of drone camera attitude estimation based on evolutionary algorithm and QR code:
[0080] like Figure 1 As shown, when the drone lands, it is determined whether it is the first time to use the QR code to assist landing. If it is the first time, the camera is calibrated. The camera calibration includes: camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code, collect the offset and rotation of the QR code at different heights, and use them to construct an error model to obtain an optimized data set.
[0081] Specifically, the standard camera intrinsic calibration process can quickly calculate the camera intrinsic parameters and distortion parameters through the standard black and white grid image, such as Figure 2 As shown in the figure, the specific steps are: take photos of the standard calibration template at various angles, detect corner points, extract sub-pixel points, and calculate camera intrinsic parameters and camera distortion parameters.
[0082] The steps of camera error calibration are:
[0083] S1: Start the camera, use aruco technology to recognize the QR code, and output the offset and rotation of the QR code;
[0084] S2: Process the data and clean up the data with large filtering errors;
[0085] S3: Hover the drone directly above the drone, collect the offset and rotation of the QR code at different heights, and build a data set for the model;
[0086] S4: Construct an error model with height (z) as the independent variable, offset (x, y) and rotation (r, p, y) as the dependent variables. The transformation matrix between height and posture is as follows:
[0087]
[0088] S5: A multi-objective optimization algorithm is used to apply the constructed data set to the error model to improve the model accuracy. The multi-objective optimization algorithm adopts a multi-objective evolutionary algorithm based on dual populations, with model accuracy and algorithm complexity as the goals, and optimizes simultaneously.
[0089] Since the drone is directly above the QR code, the theoretical values of the offset and rotation of the QR code are 0. However, due to the uncertainty of the flight environment, the quality of the QR code image captured by the camera may be affected, resulting in the offset and rotation of the QR code being non-zero values. Therefore, a dataset needs to be constructed.
[0090] like Figure 3 As shown in the figure, the camera is hovered above the QR code and moved in the z direction to collect the initial errors of the offset and rotation at different heights. Taking the error in the x direction as an example, the final data presentation result is as follows: Figure 4 As shown, the horizontal axis is the height z and the vertical axis is the initial error in the x direction.
[0091] Using a multi-objective evolutionary algorithm, with high accuracy and low algorithm complexity as the goals, the collected data is brought in to solve the mathematical model of Formula 1. High accuracy is guaranteed by minimizing the loss function in Formula 2, and low algorithm complexity is guaranteed by minimizing the complexity evaluation index in Formula 3. The final result is as follows Figure 5 As shown in the figure, the line is the convergent mathematical model. It can be seen from the figure that the mathematical model can fit the collected data well. Finally, the error model is transplanted into the drone.
[0092]
[0093] in
[0094] if k ij = = 0: ω ij =0
[0095] else:ω ij =1
[0096] Formula 3
[0097] Specifically, Figure 6 As shown in Figure 2, the steps of the multi-objective optimization algorithm are:
[0098] S51: Constructing the initial population: Randomly generate 99 other individuals based on the individual, thus constructing a population of 100 individuals;
[0099] S52: Calculate target value: use two target functions to calculate the target values of all individuals and define the maximum number of iterations;
[0100] S53: Determine whether the maximum number of iterations has been reached. If so, exit. If not, perform non-dominated sorting on each solution and classify all non-dominated solutions into the optimal sub-population.
[0101] S54: Traverse each individual and randomly select an individual from the optimal subpopulation as the parent;
[0102] S55: Use particle swarm algorithm to learn the excellent performance of the parent generation and generate offspring;
[0103] S56: Offspring mutation, calculate the target value of the offspring after enhancing randomness;
[0104] S57: Environment selection: perform non-dominated sorting on all parents and offspring, select the best 100 individuals, and repeat steps S53-S57.
[0105] If this is not the first time you use it, proceed directly to QR code assisted landing.
[0106] Specifically, the steps of QR code assisted landing are: use the QR code recognition algorithm to calculate the offset and rotation of the QR code; use the error model to convert the altitude information into an error value; combine the offset and rotation obtained by the QR code recognition algorithm with the error value obtained by the error model, calculate the precise offset and rotation and send them to the flight control system. The flight control system controls the drone to offset and rotate left and right based on the information obtained to complete the assisted landing.
[0107] Specifically, the specific steps of using the QR code recognition algorithm to calculate the offset and rotation of the QR code are as follows:
[0108] S01: Enhance the camera image to obtain the optimized QR code image, and use the ARUCO technology to calculate the offset and rotation of the QR code;
[0109] S02: Process the data and clean up the data with large filtering errors;
[0110] S03: If there are multiple two-dimensional codes in the acquired image, the data of each two-dimensional code is averaged to obtain the offset and rotation amount of each two-dimensional code;
[0111] S04: Output the current offset and rotation.
[0112] The actual assisted drone landing process is as follows Figure 7 As shown in the figure, on the one hand, the drone attitude information is obtained through the ARUCO technology, and on the other hand, the drone height information is input into the error model, and the error model calculates the initial error of the attitude. Finally, the two are subtracted to obtain the accurate attitude information of the drone, and the final result is sent to the flight control system for attitude adjustment.
[0113] Based on the same inventive concept, the present invention also proposes a device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code. The implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated. Figure 8 As shown, the device 100 includes:
[0114] Determination module 101: when the drone is landing, it is determined whether it is the first time to use the QR code assisted landing. If it is the first time, the camera calibration module is used to calibrate the camera. If it is not the first time, the QR code assisted landing module is directly used to perform the QR code assisted landing.
[0115] Camera calibration module 102: used for camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code, collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set;
[0116] The two-dimensional code assisted landing module 103 includes:
[0117] The two-dimensional code recognition algorithm calculation module 1031 is used to calculate the offset and rotation of the two-dimensional code using the two-dimensional code recognition algorithm;
[0118] Error model calculation module 1032: used to convert the height information into an error value using an error model;
[0119] UAV landing module 1033: used to combine the offset and rotation obtained by the QR code recognition algorithm with the error value obtained by the error model, calculate the precise offset and rotation and send them to the flight control system. The flight control system controls the UAV to deflect and rotate left and right based on the information obtained to complete assisted landing.
[0120] The device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code proposed in the present invention finds, based on experimental data, that there is a certain linear relationship between height and offset error and rotation error, uses Taylor expansion to construct an error model, and optimizes the model simultaneously with accuracy and complexity as the goal. The evolutionary algorithm simulates the biological evolution process: reproduction, mutation, environmental selection, etc., and after multiple rounds of iterations, produces the optimal offspring, that is, a model with high accuracy and low algorithm complexity. In addition, a dual-population strategy is adopted to ensure that each solution converges to the optimal solution set, thereby accelerating the convergence process. The error model is applied to the drone's two-dimensional code assisted landing process. Due to the high accuracy of the error model and the low algorithm complexity, the flight control system can obtain the error value faster and better, thereby performing precise control.
[0121] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements contained in the spirit and scope of the attached claims.
[0122] Regarding the limitation of the protection scope of the present invention, those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.
Claims
1. A method for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code, characterized in that: The method includes: When the drone is landing, it determines whether it is the first time to use the QR code to assist landing. If it is the first time, the camera will be calibrated. If it is not the first time, the QR code will be directly used to assist landing. The camera calibration includes: camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code, collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set; The steps of the two-dimensional code assisted landing are: using a two-dimensional code recognition algorithm to calculate the offset and rotation of the two-dimensional code; using an error model to convert altitude information into an error value; combining the offset and rotation obtained by the two-dimensional code recognition algorithm with the error value obtained by the error model, calculating the precise offset and rotation and sending them to the flight control system, and the flight control system controls the drone to deflect left and right and rotate according to the information obtained to complete the assisted landing.
2. The method for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 1, characterized in that: The steps of camera error calibration are: S1: Start the camera, use aruco technology to recognize the QR code, and output the offset and rotation of the QR code; S2: Process the data and clean up the data with large filtering errors; S3: Hover the drone directly above the drone, collect the offset and rotation of the QR code at different heights, and build a data set for the model; S4: Construct an error model with height (z) as the independent variable, offset (x, y) and rotation (r, p, y) as the dependent variables. The transformation matrix between height and posture is as follows: S5: A multi-objective optimization algorithm is used to apply the constructed data set to the error model to improve the model accuracy. The multi-objective optimization algorithm adopts a multi-objective evolutionary algorithm based on dual populations, with model accuracy and algorithm complexity as the goals, and optimizes simultaneously.
3. The method for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 2, characterized in that: The steps of the multi-objective optimization algorithm described in S5 are: S51: Constructing the initial population: Randomly generate 99 other individuals based on the individual, thus constructing a population of 100 individuals; S52: Calculate target value: use two target functions to calculate the target values of all individuals and define the maximum number of iterations; S53: Determine whether the maximum number of iterations has been reached. If so, exit. If not, perform non-dominated sorting on each solution and classify all non-dominated solutions into the optimal sub-population. S54: Traverse each individual and randomly select an individual from the optimal subpopulation as the parent; S55: Use particle swarm algorithm to learn the excellent performance of the parent generation and generate offspring; S56: Offspring mutation, calculate the target value of the offspring after enhancing randomness; S57: Environment selection: perform non-dominated sorting on all parents and offspring, select the best 100 individuals, and repeat steps S53-S57.
4. The method for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 1, characterized in that: The specific steps of using the two-dimensional code recognition algorithm to calculate the offset and rotation of the two-dimensional code are: S01: Enhance the camera image to obtain the optimized QR code image, and use the ARUCO technology to calculate the offset and rotation of the QR code; S02: Process the data and clean up the data with large filtering errors; S03: If there are multiple two-dimensional codes in the acquired image, the data of each two-dimensional code is averaged to obtain the offset and rotation amount of each two-dimensional code; S04: Output the current offset and rotation.
5. A device for estimating the attitude of a drone camera based on an evolutionary algorithm and a QR code, characterized in that: The device includes: Judgment module: used to determine whether it is the first time to use the QR code to assist landing when the drone is landing. If it is the first time, the camera calibration module is used to calibrate the camera. If it is not the first time, the QR code assisted landing module is used directly to perform the QR code assisted landing. Camera calibration module: used for camera intrinsic parameter calibration and camera error calibration. The camera error calibration is to hover the drone directly above the QR code and collect the offset and rotation of the QR code at different heights to construct an error model to obtain an optimized data set. The two-dimensional code assisted landing module includes: Two-dimensional code recognition algorithm calculation module: used to calculate the offset and rotation of the two-dimensional code using the two-dimensional code recognition algorithm; Error model calculation module: used to convert height information into error value using error model; Drone landing module: It is used to combine the offset and rotation obtained by the QR code recognition algorithm with the error value obtained by the error model, calculate the precise offset and rotation and send them to the flight control system. The flight control system controls the drone to deflect and rotate left and right based on the information obtained to complete assisted landing.
6. The device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 5, characterized in that: The steps of camera error calibration are: S1: Start the camera, use aruco technology to recognize the QR code, and output the offset and rotation of the QR code; S2: Process the data and clean up the data with large filtering errors; S3: Hover the drone directly above the drone, collect the offset and rotation of the QR code at different heights, and build a data set for the model; S4: Construct an error model with height (z) as the independent variable, offset (x, y) and rotation (r, p, y) as the dependent variables. The transformation matrix between height and posture is as follows: S5: A multi-objective optimization algorithm is used to apply the constructed data set to the error model to improve the model accuracy. The multi-objective optimization algorithm adopts a multi-objective evolutionary algorithm based on dual populations, with model accuracy and algorithm complexity as the goals, and optimizes simultaneously.
7. The device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 6, characterized in that: The steps of the multi-objective optimization algorithm described in S5 are: S51: Constructing the initial population: Randomly generate 99 other individuals based on the individual, thus constructing a population of 100 individuals; S52: Calculate target value: use two target functions to calculate the target values of all individuals and define the maximum number of iterations; S53: Determine whether the maximum number of iterations has been reached. If so, exit. If not, perform non-dominated sorting on each solution and classify all non-dominated solutions into the optimal sub-population. S54: Traverse each individual and randomly select an individual from the optimal subpopulation as the parent; S55: Use particle swarm algorithm to learn the excellent performance of the parent generation and generate offspring; S56: Offspring mutation, calculate the target value of the offspring after enhancing randomness; S57: Environment selection: perform non-dominated sorting on all parents and offspring, select the best 100 individuals, and repeat steps S53-S57.
8. The device for estimating the attitude of a drone camera based on an evolutionary algorithm and a two-dimensional code according to claim 5, characterized in that: The two-dimensional code recognition algorithm calculation module includes: Data calculation module: used to enhance the camera image to obtain the optimized QR code image, and use the ARUCO technology to calculate the offset and rotation of the QR code; Data processing module: used to process data and clean up and filter data with large errors; Data synthesis module: if there are multiple QR codes in the acquired image, the data of each QR code is synthesized and averaged to obtain the offset and rotation of each QR code; Data output module: used to output the current offset and rotation.