A camera calibration method based on particle swarm with integrated dynamic dispersal mechanism
By introducing an integrated dynamic dispersal mechanism particle swarm optimization algorithm in camera calibration, the problem that camera calibration is difficult to take into account between high precision and high efficiency in the prior art is solved, and more efficient and accurate camera calibration results are achieved.
Patent Information
- Application Number
- CN202411316562.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The existing camera calibration methods are difficult to balance between high precision and high efficiency, especially in vehicle calibration systems. The calibration accuracy and convergence speed are easily affected by the long iteration time of BP neural network, poor convergence speed and generalization ability, and cannot meet the actual needs of high efficiency and high precision.
A camera calibration method based on the integrated dynamic dispersion mechanism of particle swarm is proposed. By introducing a particle swarm optimization algorithm with integrated dynamic dispersion mechanism, it is easier to find the global optimal solution in a complex search space, and improve the efficiency and accuracy of calibration. The specific steps include obtaining multiple calibration board pictures, detecting Harris corner points and solving subpixel coordinates, estimating the camera internal parameter initial value, initializing the IDDE-PSO algorithm parameters, performing adaptive adjustment of inertial parameters and dynamic adjustment of learning factors, iteratively update the particle speed and position, using the greedy selection algorithm to update the individual and global optimal positions, and finally output the camera parameters corresponding to the global optimal solution of the particles.
This method has better optimization ability in the camera calibration optimization process, improves search efficiency and convergence speed, avoids falling into local optimal problems, and achieves high-precision and high-efficiency camera calibration results.
Smart Images

Figure CN119295555B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sensor internal parameter calibration, and more particularly to a camera calibration method based on an integrated dynamic dispersal mechanism particle swarm. Background Art
[0002] Sensor calibration is a key technology for high-precision visual measurement and a basic requirement for unmanned driving. The commonly mentioned calibration can be summarized into two parts: ① Calibration of error, that is, correcting the sensor error to obtain internal reference information; ② Calibration of position, that is, the relative position relationship between sensors to obtain external reference information. Camera calibration is to solve the mapping transformation relationship between the image pixel position coordinates and the scene point position by solving the internal and external parameters of the camera. In the process of three-dimensional reconstruction and depth information acquisition of stereoscopic vision, camera calibration is an indispensable key step to achieve the acquisition of three-dimensional spatial information from two-dimensional image information. The accuracy of its calibration results and the robustness of the algorithm directly affect the accuracy of subsequent measurement work. Since the development of camera calibration technology, the calibration methods widely accepted and applied in practice by researchers are mainly direct linear transformation method, Tsai two-step method and Zhang Zhengyou plane calibration method. The direct linear transformation method does not consider the distortion problem of camera imaging; the solution process of Tsai two-step method is cumbersome, and it is easy to fall into local optimality when the initial value is not good; Zhang Zhengyou plane calibration method overcomes the excessive dependence of calibration on high-precision equipment, but the calibration accuracy is still limited.
[0003] In recent years, Chinese and foreign scholars have continued to conduct research in the direction of camera calibration technology and made progress. Most of the existing calibration methods are divided into two categories: one is a nonlinear calibration method based on Zhang Zhengyou's calibration method, combined with MATLAB and OpenCV calibration toolbox, to further optimize the multi-target and nonlinear calibration parameters through machine learning methods and intelligent optimization algorithms. This type of method has strong adaptability to single camera calibration and high calibration accuracy, but the calibration process is cumbersome and time-consuming; the other is an implicit calibration method that directly establishes the mapping relationship between two-dimensional image pixel coordinates and three-dimensional world coordinates without the camera imaging model. For example, based on the powerful self-learning and nonlinear mapping capabilities of artificial neural networks to simplify the calibration process, the calibration accuracy and convergence speed of this method are easily affected by the long iteration time, poor convergence speed and generalization ability of BP neural networks, and cannot meet the actual needs of high efficiency and high precision of vehicle-mounted calibration systems. Based on the deep learning model, it is necessary to learn the internal and external parameters of the camera from a large amount of data, and a large amount of data needs to be collected for training, and it is very sensitive to data quality. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose a camera calibration method based on particle swarm with integrated dynamic dispersal mechanism. By introducing the particle swarm optimization algorithm with integrated dynamic dispersal mechanism, it is easier to find the global optimal solution in a complex search space, thereby improving the efficiency and accuracy of calibration.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A camera calibration method based on integrated dynamic dispersal mechanism particle swarm, comprising the following steps:
[0007] S1. Obtain multiple calibration plate images at different angles, convert them into grayscale images, detect Harris corner points and solve sub-pixel coordinates;
[0008] S2, using sub-pixel coordinates and the distorted camera model, estimate the initial value X0 of the camera intrinsic parameter by Zhang Zhengyou method;
[0009] S3, initialize the parameters of the IDDE-PSO algorithm, calibrate the camera intrinsic parameters based on the initial values of the camera intrinsic parameters, and calculate the fitness value of each particle;
[0010] S4. Determine whether the fitness value of each particle reaches the convergence condition. If not, perform adaptive nonlinear adjustment on the inertial parameters; use sine and cosine changes to adaptively adjust the learning factor, and iteratively update the speed and position of each particle; use the greedy selection algorithm to continuously update the individual optimal position and the global optimal position of the particle, and use the IDDE-PSO algorithm to optimize the camera internal parameters to determine whether the maximum number of iterations is met or a specific fitness threshold is met;
[0011] S5. When the fitness value of each particle in step S4 reaches the convergence condition, it is determined whether it falls into the local optimum. If so, the particle swarm algorithm with Cauchy perturbation is introduced to update the individual optimal position of each particle and re-evaluate the fitness value of each particle; the individual optimal position and the global optimal value are continuously updated by the greedy selection algorithm, and the camera internal parameters are optimized by the IDDE-PSO algorithm to determine whether the maximum number of iterations is met or the specific fitness threshold is met; if not, it is directly determined whether the maximum number of iterations is met or the specific fitness threshold is met;
[0012] S6. When the maximum number of iterations or a specific fitness threshold is met, the camera parameters corresponding to the global optimal solution of the particle are output; if not met, return to execute steps S3-S5 until the maximum number of iterations or the specific fitness threshold is met.
[0013] Furthermore, in step S1, the initial value X0 of the camera intrinsic parameter is estimated based on the Zhang Zhengyou method, specifically:
[0014] X0=(α,β,γ,u0,v0,k1,k2,p1,p2,k3);
[0015] In the above formula, (u0, v0) is the coordinate of the principal point of the image; (α, β) is the ratio of the focal length of the camera to the physical size of the unit pixel; γ, K1, K2 and K3 are radial distortion parameters; p1 and p2 are tangential distortion parameters.
[0016] Furthermore, the parameters of the IDDE-PSO algorithm initialized in step S3 include: population size N, maximum number of iterations T, stagnation threshold s T =15, the maximum and minimum values of inertia weight w, learning factors c1 and c2.
[0017] Furthermore, the fitness value of each particle is calculated in step S3, specifically:
[0018] Calculate the average reprojection error X of the M corner points minimized in each calibration plate image best , as the optimization target;
[0019] Take the current position of each particle as the individual optimal position;
[0020] The individual optimal solution of the current particle is the fitness value corresponding to the current particle.
[0021] Furthermore, the calculation of the average reprojection error of the M corner points minimized in the image of each calibration plate is specifically as follows:
[0022] The average reprojection error function of each calibration plate image is as follows:
[0023]
[0024] In the above formula, M is the number of corner points of the calibration plate, K(X)[RT]P i is the coordinate point P corresponding to the i-th target point in the world coordinate system i The coordinates of the reprojected points projected back to the image plane by the nonlinear camera imaging model, q i is the sub-pixel corner point coordinates actually detected for the i-th corner point;
[0025] The average reprojection error of the M corner points minimized in each image is as follows:
[0026]
[0027] Furthermore, the particle swarm algorithm of the Cauchy perturbation in step S5 is specifically:
[0028]
[0029] in represents the Cauchy perturbation generated by particle i at the tth iteration; u represents the mean; r3 and r4 are random numbers between [0, 1]; is the variance; σ0 is the initial standard deviation; t, T represent the current number of iterations and the maximum number of iterations respectively.
[0030] Furthermore, in step S4, the inertia parameter is adaptively nonlinearly adjusted, and the expression is:
[0031]
[0032]
[0033]
[0034] Where: w max =0.9 is the maximum value of inertia parameter; w min =0.4 is the minimum value of inertia parameter; is the fitness value of the current particle at the tth iteration, and They represent the average and minimum fitness values of all particles respectively.
[0035] Furthermore, in step S4, the learning factor is adaptively adjusted using sine and cosine changes, and the expression is:
[0036]
[0037]
[0038] In the above formula: c 1_max 、c 1_min ;c 2_max 、c 2_min are the upper and lower limits of the learning factors c1 and c2, which are 1.5, 1, 1.5, and 1 respectively; t represents the current number of iterations, and T represents the total number of iterations.
[0039] Furthermore, in step S4, the speed and position of each particle are updated, specifically:
[0040] The positions corresponding to all particles are taken as the global optimal positions;
[0041] Compare the current state of each particle with the historical and global optimal states, and screen by minimizing the average reprojection error function. When the current fitness value of each particle is less than the individual optimal value, the current fitness value and the corresponding particle position are used as the updated individual optimal value of the particle.
[0042] Calculate the minimum of all individual optimal values of particles and compare it with the global optimal value. If it is less than the global optimal value, that is, the particle state is better than the global optimal state, then update the global optimal state.
[0043] Furthermore, in step S5, the individual optimal position of each particle is updated and the fitness value of each particle is re-evaluated, and the expression is:
[0044]
[0045]
[0046] In the above formula, the velocity of the particle is expressed as Where the superscript t represents the current iteration number, the subscripts i and d represent the particle index and dimension respectively; X and p represent the position of the i-th particle and the individual optimal position Pbest respectively, and g represents the global optimal value searched by the particle swarm; the inertia weight w is used to balance the global search and local development capabilities; c1 and c2 are acceleration coefficients, i.e., learning rate factors; r1 and r2 are random numbers in [0,1].
[0047] According to the specific embodiment provided by the present invention, the present invention proposes a simple calibration method, which extracts corner points from the original chessboard image and then performs further sub-pixel refinement; improves the camera imaging model, and takes into account the functional relationship of the internal distortion coefficient and performs fitting to obtain a more accurate imaging model; adopts the nonlinear adaptive adjustment mechanism of inertial parameters, the dynamic self-adjustment strategy of sine and cosine changes, and the particle swarm with improved dispersion mechanism to optimize the algorithm to improve the search efficiency, global search capability and local development capability. The proposed camera calibration method based on the Integrated Dynamic and Dispersion-Enhanced PSO (IDDE-PSO) algorithm has a better optimization capability than the Levenberg-Marquardt method used in the nonlinear optimization process of camera calibration. Therefore, the technical solution of the present invention has the advantages of high search efficiency, fast convergence speed, not easy to fall into local optimum, and accurate and reliable calibration results when solving the nonlinear problem of camera calibration optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0049] The camera calibration method based on the integrated dynamic dispersal mechanism particle swarm of the present invention is further described below in conjunction with the accompanying drawings;
[0050] Figure 1 It is a flow chart of the camera calibration method based on integrated dynamic dispersal mechanism particle swarm provided by the present invention. DETAILED DESCRIPTION
[0051] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0052] In order to better understand the purpose, structure and function of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0053] In the study of existing calibration methods, corner detection technology and the use of intelligent algorithms to find the optimal solution for nonlinear optimization of camera models are key technical points in the field of camera calibration to simplify calibration models, improve calibration result accuracy and algorithm robustness. Therefore, the present invention adopts a suitable optimization algorithm to improve the camera calibration accuracy while ensuring the calibration speed and stability of the calibration results, which is the key to achieving an ideal camera calibration.
[0054] like Figure 1 As shown, the present invention provides a camera calibration method based on an integrated dynamic dispersal mechanism particle swarm, S1, obtaining multiple calibration plate images at different angles, converting them into grayscale images, detecting Harris corner points and solving sub-pixel coordinates;
[0055] S2, using sub-pixel coordinates and the distorted camera model, estimate the initial value X0 of the camera intrinsic parameter by Zhang Zhengyou method;
[0056] S3, initialize the parameters of the IDDE-PSO algorithm, calibrate the camera intrinsic parameters based on the initial values of the camera intrinsic parameters, and calculate the fitness value of each particle;
[0057] S4. Determine whether the fitness value of each particle reaches the convergence condition. If not, perform adaptive nonlinear adjustment on the inertial parameters; use sine and cosine changes to adaptively adjust the learning factor, and iteratively update the speed and position of each particle; use the greedy selection algorithm to continuously update the individual optimal position and the global optimal position of the particle, and use the IDDE-PSO algorithm to optimize the camera internal parameters to determine whether the maximum number of iterations is met or a specific fitness threshold is met;
[0058] S5. When the fitness value of each particle in step S4 reaches the convergence condition, it is determined whether it falls into the local optimum. If so, the particle swarm algorithm with Cauchy perturbation is introduced to update the individual optimal position of each particle and re-evaluate the fitness value of each particle; the individual optimal position and the global optimal value are continuously updated by the greedy selection algorithm, and the camera internal parameters are optimized by the IDDE-PSO algorithm to determine whether the maximum number of iterations is met or the specific fitness threshold is met; if not, it is directly determined whether the maximum number of iterations is met or the specific fitness threshold is met;
[0059] It should be noted that the IDDE-PSO algorithm is an improvement on the standard particle swarm (PSO). On the basis of PSO, the mutation, crossover and selection operations of DE are introduced. The optimization method is as follows: First, take pictures of the calibration plate at multiple angles, convert them into grayscale images and detect Harris corner points to obtain sub-pixel coordinates. Subsequently, the camera intrinsic parameters are preliminarily estimated by Zhang Zhengyou method using these coordinates and the distorted camera model. Then, the calculated camera intrinsic parameters are input into the IDDE-PSO algorithm for fine optimization of the camera intrinsic parameters. The algorithm iteratively updates the velocity and position of the particle swarm, combines nonlinear adaptive strategies to adjust inertial parameters and dynamically adjust learning rates, with the goal of minimizing the average reprojection error. In the optimization process, a local optimal detection and dispersal mechanism is introduced to avoid falling into the local optimum. Finally, when the algorithm iteration terminates, the camera intrinsic parameters represented by the global optimal particle are output as the calibration result, achieving high-precision calibration of the camera intrinsic parameters.
[0060] S6. When the maximum number of iterations or a specific fitness threshold is met, the camera parameters corresponding to the global optimal solution of the particle are output; if not met, return to execute steps S3-S5 until the maximum number of iterations or the specific fitness threshold is met.
[0061] It should be noted that: fitness function and IDDE-PSO optimization: the average reprojection error function is used as the fitness function of this algorithm; and the camera internal parameters are optimized according to the IDDE-PSO algorithm; the particle swarm algorithm is inspired by the foraging behavior of birds in nature and aims to find the global optimal solution. Its algorithm is simple and efficient, with few parameters, so it is widely used in solving multi-dimensional optimization problems. Each particle in the group is constructed by a D-dimensional vector, that is, X i =[x i1 ,x i2 ,…,x iD ], i = 1, 2, ..., N, N represents the size of the population, which directly affects the search ability of the PSO algorithm and the amount of calculation required to search for the optimal value. The individual optimal position (Pbest) of the particle in the search space is iteratively updated by the velocity vector and approaches the global optimal region (Gbest).
[0062] The individual optimal position Pbest and the global optimal value Gbest are continuously updated through the greedy selection algorithm. This mechanism enables the particle swarm to quickly converge to the vicinity of the optimal solution and effectively avoid falling into the local optimum.
[0063] In step S1, the initial value X0 of the camera intrinsic parameter is estimated based on the Zhang Zhengyou method, specifically:
[0064] X0=(α,β,γ,u0,v0,k1,k2,p1,p2,k3);
[0065] In the above formula, (u0, v0) is the coordinate of the principal point of the image; (α, β) is the ratio of the focal length of the camera to the physical size of the unit pixel; γ, K1, K2 and K3 are radial distortion parameters; p1 and p2 are tangential distortion parameters.
[0066] The parameters of the IDDE-PSO algorithm initialized in step S3 include: population size N, maximum number of iterations T, stagnation threshold s T =15, the maximum and minimum values of inertia weight w, learning factors c1 and c2.
[0067] The fitness value of each particle is calculated in step S3, specifically:
[0068] Calculate the average reprojection error X of the M corner points minimized in each calibration plate image best , as the optimization target;
[0069] Take the current position of each particle as the individual optimal position;
[0070] The individual optimal solution of the current particle is the fitness value corresponding to the current particle.
[0071] It should be noted that the individual optimal solution is the fitness of the individual optimal position, and the fitness (optimization target) is a function of the position.
[0072] Take the minimum fitness value of all particles As the global optimal solution X best .
[0073] It should be noted that: Calculate the fitness value of each particle: calculate f(X0), and calculate the minimum average reprojection error X of M corner points best , as the optimization target; the current position of each particle is taken as the individual optimal position p d , and take its corresponding fitness value as the individual optimal solution of the current particle; take the minimum value of the fitness value of all particles As the global optimal solution X best , and the corresponding particle position is taken as the global optimal position g d , when initializing the population, the optimal position of the initial individual pd =X0. Global optimal position g d is the initial value obtained by Zhang Zhengyou calibration method after sub-pixel optimization, and the obtained particles are the 0th generation particles.
[0074] The calculation of the average reprojection error of the M corner points minimized in each calibration plate image is specifically:
[0075] The average reprojection error function of each calibration plate image is as follows:
[0076]
[0077] In the above formula, M is the number of corner points of the calibration plate, K(X)[RT]P i is the coordinate point P corresponding to the i-th target point in the world coordinate system i The coordinates of the reprojected points projected back to the image plane by the nonlinear camera imaging model, q i is the sub-pixel corner point coordinates actually detected for the i-th corner point;
[0078] The average reprojection error of the M corner points minimized in each image is as follows:
[0079]
[0080] The particle swarm algorithm of Cauchy perturbation in step S5 is specifically:
[0081]
[0082] in represents the Cauchy perturbation generated by particle i at the tth iteration; u represents the mean; r3 and r4 are random numbers between [0, 1]; is the variance; σ0 is the initial standard deviation; t, T represent the current number of iterations and the maximum number of iterations respectively.
[0083] In step S4, the inertia parameter is adjusted adaptively and nonlinearly, and the expression is:
[0084]
[0085]
[0086]
[0087] Where: w max =0.9 is the maximum value of inertia parameter; w min =0.4 is the minimum value of inertia parameter; is the fitness value of the current particle at the tth iteration, and They represent the average and minimum fitness values of all particles respectively.
[0088] The adjustment learning factor is expressed as:
[0089]
[0090] In the above formula: c 1_max 、c 1_min ;c 2_max 、c 2_min are the upper and lower limits of the learning factors c1 and c2, which are 1.5, 1, 1.5, and 1 respectively. t represents the current iteration number, and T represents the total iteration number.
[0091] It should be noted that the learning rate factor can be adaptively adjusted as the iteration process proceeds, thereby improving the search efficiency of the algorithm.
[0092] In step S4, the speed and position of the particle are updated, specifically:
[0093] The positions corresponding to all particles are taken as the global optimal position g d ;
[0094] Compare the current state of each particle with the historical and global optimal states, and screen by minimizing the average reprojection error function. When the current fitness value of each particle is less than the individual optimal value, the current fitness value and the corresponding particle position are used as the updated individual merit of the particle.
[0095] It should be noted that the individual optimal value refers to the minimum value of the fitness of a particle during the iteration process. If the fitness of the particle is smaller after a certain iteration, its fitness is the optimal value, and the original optimal value will be replaced.
[0096] Calculate the minimum of all individual optimal values of particles and compare it with the global optimal value. If it is less than the global optimal value, that is, the particle state is better than the global optimal state, then update the global optimal state.
[0097] It should be noted that the global optimal value is the minimum value of all particle fitness (individual optimal value) in each iteration.
[0098] In step S5, the individual optimal position of each particle is updated and the fitness value of each particle is re-evaluated, and the expression is:
[0099]
[0100]
[0101] In the above formula, the velocity of the particle is expressed as Where the superscript t represents the current iteration number, the subscripts i and d represent the particle index and dimension respectively; X and p represent the position of the i-th particle and the individual optimal position Pbest respectively, and g represents the global optimal value searched by the particle swarm; the inertia weight w is used to balance the global search and local development capabilities; c1 and c2 are acceleration coefficients, i.e., learning rate factors; r1 and r2 are random numbers in [0,1].
[0102] It should be noted that: Get the camera parameters X corresponding to the optimal solution best =f(g d ): When the algorithm iteration terminates, the camera internal parameters represented by the global best particle are output as the optimization result.
[0103] Table 1 shows the key steps of the integrated dynamic dispersal mechanism particle swarm (IDDE-PSO) algorithm
[0104]
[0105]
[0106] The present invention also has the following beneficial effects:
[0107] Corner sub-pixel refinement
[0108] In a black and white chessboard, the corner point is the intersection of the black and white edges of the chessboard. The present invention first uses the Harris detector to preliminarily determine the pixel-level coordinates of the corner point. In order to further improve the accuracy of the corner point, the mathematical property of the corner point is used - the dot product of a vector and its orthogonal vector is 0, to set up the equation and solve the sub-pixel corner point q. The specific method is to take the initial corner point q0 as the center, select a window of appropriate size, such as (11,11), and calculate each integer coordinate p in the window i The gradient information G i When the coordinate p i When it is at the edge of the chessboard, its gradient vector G i With edge p i -q orthogonal, that is, G i (p i -q)=0. By calculating the pseudo-inverse, the new sub-pixel coordinate q1 is obtained. Its expression is
[0109]
[0110] In order to obtain more accurate sub-pixel coordinates, the coordinate values are continuously updated using an iterative method. In order to avoid missing corner points and generating pseudo corner points, an accuracy threshold is specified as ε as the iteration termination condition. When the coordinate update amount is less than this threshold, the iteration process ends, and the sub-pixel coordinates obtained at this time are the desired results.
[0111] ||q t-q t-1 ||2≤ε
[0112] Sub-pixel refinement experiment
[0113] The sub-pixel accuracy threshold ε is set to 0.0001, and the average reprojection error of all images is calculated. The results are shown in Table 2. Comparing the errors under different numbers of images, it can be seen that the increase in the number of images will lead to an increase in the corner measurement error. However, it is worth noting that after sub-pixel refinement, the error is significantly lower than the unrefined result. For example, the error of 20 images after refinement is reduced by 0.092 pixels, which verifies the effect of sub-pixel refinement on improving calibration accuracy.
[0114] Table 2 Average reprojection error when ε = 0.0001
[0115]
[0116] Comparative experiments of different calibration algorithms
[0117] 20 collected calibration plate images are selected as experimental data, where the experimental data of the original image and the original + refined experiment are the calibration plate images without sub-pixel corner detection and the calibration plate images after sub-pixel corner detection respectively; Zhang' refers to Zhang Zhengyou calibration method. The experimental results of the camera intrinsic parameter calibration algorithm (Ours) with integrated dynamic dispersal mechanism particle swarm proposed in the present invention compared with Zhang', matlab toolbox, traditional PSO calibration method and QPSO method are shown in the following table. Among them, PSO, QPSO and Ours use the original + refined experimental results as initial data for nonlinear optimization.
[0118] Table 3 Comparison of experimental results of different calibration algorithms
[0119]
[0120]
[0121] The experimental results in Table 3 show that the calibration algorithm proposed in the present invention can not only effectively calibrate the internal and external parameters of the camera, but also successfully correct the radial distortion of the camera, especially in environments with obvious radial distortion. The analysis of the reprojection error shows that the calibration algorithm improved based on the intelligent optimization algorithm has a certain improvement in the calibration accuracy compared with Zhang Zhengyou's calibration method and MATLAB toolbox when the camera distortion is large. Specifically, among the three calibration optimization algorithms, the average reprojection error of the algorithm of the present invention is reduced by 0.1658 pixels compared with the PSO algorithm and by 0.1804 pixels compared with the QPSO algorithm. Compared with the MATLAB toolbox, the accuracy of the algorithm of the present invention is improved by about 53%; compared with the Zhang calibration method, the accuracy improvement is about 56%. This significant advantage fully proves the effectiveness of the integrated dynamic dispersal mechanism particle swarm camera intrinsic parameter calibration algorithm proposed in the present invention in improving the camera calibration accuracy.
[0122] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A camera calibration method based on particle swarm with integrated dynamic dispersal mechanism, characterized in that: The following steps are involved: S1. Obtain multiple calibration plate images at different angles, convert them into grayscale images, detect Harris corner points and solve sub-pixel coordinates; S2, using sub-pixel coordinates and the distorted camera model, estimate the initial value X0 of the camera intrinsic parameter by Zhang Zhengyou method; S3, initialize the parameters of the IDDE-PSO algorithm, calibrate the camera intrinsic parameters based on the initial values of the camera intrinsic parameters, and calculate the fitness value of each particle; S4. Determine whether the fitness value of each particle reaches the convergence condition. If not, perform adaptive nonlinear adjustment on the inertial parameters; use sine and cosine changes to adaptively adjust the learning factor, and iteratively update the speed and position of each particle; use the greedy selection algorithm to continuously update the individual optimal position and the global optimal position of the particle, and use the IDDE-PSO algorithm to optimize the camera internal parameters to determine whether the maximum number of iterations is met or a specific fitness threshold is met; S5. When the fitness value of each particle in step S4 reaches the convergence condition, it is determined whether it falls into the local optimum. If so, the particle swarm algorithm with Cauchy perturbation is introduced to update the individual optimal position of each particle and re-evaluate the fitness value of each particle; the individual optimal position and the global optimal value are continuously updated by the greedy selection algorithm, and the camera internal parameters are optimized by the IDDE-PSO algorithm to determine whether the maximum number of iterations is met or the specific fitness threshold is met; if not, it is directly determined whether the maximum number of iterations is met or the specific fitness threshold is met; S6. When the maximum number of iterations or a specific fitness threshold is met, the camera parameters corresponding to the global optimal solution of the particle are output; if not met, return to execute steps S3-S5 until the maximum number of iterations or the specific fitness threshold is met.
2. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: In step S1, the initial value X0 of the camera intrinsic parameter is estimated based on the Zhang Zhengyou method, specifically: X0=(α,β,γ,u0,v0,k1,k2,p1,p2,k3); In the above formula, (u0, v0) is the coordinate of the principal point of the image; (α, β) is the ratio of the focal length of the camera to the physical size of the unit pixel; γ, K1, K2 and K3 are radial distortion parameters; p1 and p2 are tangential distortion parameters.
3. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: The parameters of the IDDE-PSO algorithm initialized in step S3 include: population size N, maximum number of iterations T, stagnation threshold s T =15, the maximum and minimum values of inertia weight w, learning factors c1 and c2.
4. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: The fitness value of each particle is calculated in step S3, specifically: Calculate the average reprojection error X of the M corner points minimized in each calibration plate image best , as the optimization target; Take the current position of each particle as the individual optimal position; The individual optimal solution of the current particle is the fitness value corresponding to the current particle.
5. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 4, characterized in that: The calculation of the average reprojection error of the M corner points minimized in each calibration plate image is specifically: The average reprojection error function of each calibration plate image is as follows: In the above formula, M is the number of corner points of the calibration plate, K(X)[RT]P i is the coordinate point P corresponding to the i-th target point in the world coordinate system i The coordinates of the reprojected points projected back to the image plane by the nonlinear camera imaging model, q i is the sub-pixel corner point coordinates actually detected for the i-th corner point; The average reprojection error of the M corner points minimized in each image is as follows:
6. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: The particle swarm algorithm of Cauchy perturbation in step S5 is specifically: in represents the Cauchy perturbation generated by particle i at the tth iteration; u represents the mean; r3 and r4 are random numbers between [0, 1]; is the variance; σ0 is the initial standard deviation; t, T represent the current number of iterations and the maximum number of iterations respectively.
7. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: In step S4, the inertia parameter is adaptively nonlinearly adjusted, and the expression is: Where: w max =0.9 is the maximum value of inertia parameter; w min =0.4 is the minimum value of inertia parameter; is the fitness value of the current particle at the tth iteration, and They represent the average and minimum fitness values of all particles respectively.
8. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: In step S4, the learning factor is adaptively adjusted by using sine and cosine changes, and the expression is: In the above formula: c 1_max 、c 1_min ;c 2_max 、c 2_min are the upper and lower limits of the learning factors c1 and c2, which are 1.5, 1, 1.5, and 1 respectively; t represents the current number of iterations, and T represents the total number of iterations.
9. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: In step S4, the speed and position of each particle are updated, specifically: The positions corresponding to all particles are taken as the global optimal positions; Compare the current state of each particle with the historical and global optimal states, and screen by minimizing the average reprojection error function. When the current fitness value of each particle is less than the individual optimal value, the current fitness value and the corresponding particle position are used as the updated individual optimal value of the particle. Calculate the minimum of all individual optimal values of particles and compare it with the global optimal value. If it is less than the global optimal value, that is, the particle state is better than the global optimal state, then update the global optimal state.
10. The camera calibration method based on integrated dynamic dispersal mechanism particle swarm according to claim 1, characterized in that: In step S5, the individual optimal position of each particle is updated and the fitness value of each particle is re-evaluated, and the expression is: In the above formula, the velocity of the particle is expressed as Where the superscript t represents the current iteration number, the subscripts i and d represent the particle index and dimension respectively; X and p represent the position of the i-th particle and the individual optimal position Pbest respectively, and g represents the global optimal value searched by the particle swarm; the inertia weight w is used to balance the global search and local development capabilities; c1 and c2 are acceleration coefficients, i.e., learning rate factors; r1 and r2 are random numbers in [0,1].
Citation Information
Patent Citations
Robot camera calibration method based on multi-population particle parallel structure algorithm
CN112381885A
Method for optimizing support vector machine on basis of particle swarm optimization algorithm
WO2018072351A1