Abstract
Aiming at the problem of camera calibration with multiple parameters, this paper proposes the fusion optimization algorithm of improved differential evolution and particle swarm in the calibration of the camera. Adaptive judgment factors is Introduced to control the improvement of differential evolution during each iteration (IDE) algorithm and particle swarm optimization (PSO) algorithm solve the multiple parameters of traditional camera calibration algorithm. The proposed algorithm can ensure the diversity and effectiveness of individual evolution of the population. Experimental results show that the algorithm has excellent global search capabilities and local optimizations ability. It can accurately calibrate the camera. The convergence precision, speed and robustness performance significantly is superior to PSO (Particle swarm optimization algorithm), DE (differential evolution algorithm), GA (Genetic algorithm) and Zhang’s method. It improves the precision and speed of the proposed calibration method. The root mean square error of the calibration algorithm proposed in this paper is only 0.182, the calibration error result is smaller than other several algorithms. The reprojection error of our method is 0.05938 (Ex/pixel) and 0.02988 (Ey/pixel). It is smaller than GA, PSO, DE, and Zhang’s method. So, the algorithm performance is excellent.
Introduction
Camera parameter calibration is a necessary process and key technology to achieve accurate target pose acquisition based on vision measurement. 1 Camera calibration needs to determine the internal orientation elements and external elements, and the reliability of calibration results directly affects the stability and accuracy of target position and attitude information measurement.2,3 Therefore, high precision calibration is an important guarantee to realize accurate vision measurement technology. The early direct linear transformation method 4 established the geometric linear model of camera imaging, and the imaging model can be obtained directly through the linear equation. On this basis, Tsai 5 proposed a two-step calibration method introducing lens distortion coefficient. Zhang’s calibration model was used to automatically calculate parameters, and a kind of automatic camera calibration algorithm was proposed. 6 The calibration method can reduce the complexity of the calibration process to some extent, but the calibration accuracy is not improved. The above three classical calibration methods lay the foundation for the development of current calibration technology.
Research on self-calibration method7–9 and camera calibration method based on active vision10,11 have also matured successively. Some calibration algorithms12,13 models with intelligent ideas have also begun to appear.
In recent years, scholars have applied the population optimization algorithm with intelligent optimization function to the camera parameter calibration. Particle swarm optimization and its improved algorithm are used to optimize the camera parameters to obtain accurate camera parameters. Zhou et al. 14 proposed a virtual three-dimensional calibration method of camera internal parameters based on mutation mechanism particle swarm optimization algorithm. Through the idea of phased optimization, the external parameters and some internal parameters of the camera imaging model were established for initial value estimation. Deng et al. 15 adopted hybrid particle swarm optimization algorithm to effectively calibrate camera parameters and it has good optimization ability, avoiding local convergence to a certain extent.
At the same time, the differential evolution (DE) algorithm is also applied to the camera parameter calibration.16–19 Zhang and Zhong 20 adopted the camera calibration method combining step-by-step method and improved differential evolution algorithm to solve the problem of multiple local extreme points of the objective function to be optimized. De la Fraga and Schütze 21 adopted an improved differential evolution algorithm to solve the optimization problem of highly nonlinear camera calibration, overcoming the disadvantages of poor convergence accuracy or non-convergence in conventional calibration process. However, the convergence rate of PSO algorithm is fast in the initial stage of solving the optimization problem, and in the later stage, because all the particles are close to the optimal particle, the diversity of the whole population is lost, and the particles are easy to fall into the local optimal. IDE algorithm has the ability to maintain population diversity and explore local search, but it has no mechanism to store previous processes and use global information about the search space, so it can easily lead to the waste of computing power.
Based on the above analysis, it can be found that the future focus will be on the development of intelligent calibration algorithms, so as to adapt the camera calibration parameters to the diversified practical application requirements. So this paper combine the advantages of PSO and IDE, the adaptive judgment factor is introduced to control the particle swarm optimization in the process of each iteration and proportion of improved differential evolution algorithm. Consider using PSO algorithm or IDE algorithm to update individuals according to probability rules, and guide the evolution process of individuals in PSO operation by using the individuals obtained from IDE operation through information exchange mechanism. In this way, the greater the crossover probability, the more information the new individual inherits from the mutant individual, and the richer the population diversity, thus ensuring the global solution accuracy and efficiency of the algorithm.
Camera calibration
Camera calibration is a process of establishing equations based on the corresponding relationship between the 3D physical coordinates of the known feature points and the image pixel coordinates, and obtaining the internal and external parameters of the camera model through solving and optimizing equations. The commonly used pinhole projection model is shown in Figure 1.

Pinhole imaging model of camera.
Under the ideal pinhole imaging model, a point in the world coordinate system can be converted to the pixel coordinate system of two-dimensional image by the following formula (1),
In the formula, R is the rotation matrix and t is the translation vector between the coordinate systems
Algorithm design
Particle swarm optimization algorithm
PSO algorithm based on population evolution has been widely used to solve multi-dimensional optimization problems. Each particle in the population is constructed by a D-dimensional vector. Let’s call it
The particle swarm optimization algorithm is expressed as follows:
Where,
C1 and C2 are acceleration coefficients, namely learning factors. R1 and R2 are random numbers in [0,1];
Particle trajectory analysis shows that if each particle converges to its local attractor
Improved differential evolution algorithm
Improved differential evolution (IDE) algorithm can find a balance between local search and global search in order to overcome the shortcomings of traditional differential evolution algorithms that are easy to fall into local optimal solutions,
Let the number of the population
In formula (5),
Improved differential evolution method must first randomly select
Where,
The objective function value of the randomly selected subpopulation
The weighted operation of the population produces a temporary population during each generation of evolution:
In formula (9),
In addition,
During the mutation process, the binary mapping matrix
Where,
If
Where, the operator
Where
In the improved differential evolution algorithm, the trial vector
According to the greedy selection rule,
The update of
The final global optimal solution:
Where,
It can be seen that the algorithm expands the scope of population search space and avoids the problems such as gradual singleness and falling into prematurity in the process of new population evolution.
Camera calibration algorithm
The evolution criterion of the differential evolution algorithm is based on adaptive information, and does not require additional conditions such as function derivation and continuity. In addition, differential evolution has inherent parallelism and is suitable for large-scale parallel sub-processing. But the differential evolution algorithm does not use the prior knowledge of the individual, that is, there is no mechanism to store the previous process and use the global information about the search space. The particle swarm optimization algorithm makes decisions based on the experience of itself and other particles, so it can effectively make up for the difference.
This section integrates IDE and PSO algorithms, and introduces adaptive judgment factors to control the proportion of particle swarm optimization and differential evolution algorithms used in each iteration process, and considers the use of PSO algorithm or IDE algorithm to update individuals according to the law of probability. It is ensured that the greater the crossover probability, the more information the new individual inherits from the mutated individual, and the richer the population diversity. The judgment factor is used to select the update method of the individual, and its calculation method is:
Where
Then when the ith individual generates a new individual, a random number of
According to the camera model analysis, the hybrid algorithm of IDE and PSO is proposed to obtain the camera calibration parameters. The obtained image 2D coordinates are compared with the actual measured image coordinates to verify the feasibility and superiority of the algorithm.
Suppose there are n planar template images, each with m calibration points, each of the same size, in the same noisy environment. The objective function is established as follows:
Where
Camera calibration experiment results analysis and performance comparison
Camera calibration test
Two CF1000C cameras are used, with an image resolution of 3664 × 2748 pixels. The experimental platform is the Windows 7 operating platform, the CPU clock speed is 4 GHz, and the running memory is 6 GHz. In the differential particle swarm optimization model, set the maximum number of iterations of 1000, the number of consecutive optimizations is 100, the number of particles is 100, and the acceleration factor is

Calibration target.
The calibration plate is fabricated by photographically, and a total of white circles, four relatively large white circles, each adjacent white circle spacing of 25 mm, used for camera calibration to match the corresponding spatial points and image points. The target production error is 1 mm, and the accuracy of this target can meet the requirements of the camera calibration on the calibration plate.
By changing the position angle of the calibration target, 10 sets of images of different positions and angles are taken as the detection image. The camera calibration calculation solution flow as shown.
Algorithm flow:
Step 1 Feature point center extraction
Step 2 Initialize population and individual parameters randomly
Step 3 Determine the minimum objective function.
Step 4 Initialize the individual optimal position and the global optimal position
Step 5 Determine whether the iteration termination condition is met
Step 6 If not, calculate the adaptive judgment factor
Step 7 Judge s < g? if yes, then improved algorithm to update individuals; If not, pso algorithm updates individuals
Step 8 Individual selection and update by calculating the objective function, then go to step 4
It can be seen from Table 1 that the algorithm starts from the maximum number of iterations of 600, and the iteration basically reaches convergence. Starting from the number of iterations of 800, the iteration basically begins to stabilize, and the required parameter values are the camera internal parameter values.
Experimental results of solving camera internal parameters based on differential particle swarm optimization.
According to the transformation relationship of the random calibration model, the corresponding 2D image coordinates
Reliability verification results.
Performance comparison of algorithms
In order to evaluate the iterative performance and average error of the calibration results of the proposed algorithm, the performance was compared with that of GA, PSO, DE, Zhang’s method and Improved Differential Evolution and Particle Swarm Optimization (IDE-PSO) respectively. As shown in Figure 3, improved algorithm in this paper converges quickly and has a small average error. Its iterative performance and average error are better than GA, PSO, DE, Zhang’s method. See also in Table 3.

Iteration and average error.
Comparison of camera calibration parameters for five algorithms.
In order to further verify the performance of the experimental results, the MSE (Maximum Mean Square Error) and RMS (Root Mean Square Error) of the entire test data are used as evaluation indicators, and the GA, PSO, DE , Zhang’s method are also compared, as shown in Table 4. The experimental results show that the algorithm in this paper converges prematurely and can improve the algorithm performance more effectively. The root mean square error of the calibration algorithm proposed in this paper is only 0.182, the calibration error result is smaller than other several algorithms, and the algorithm performance is excellent.
Comparison of calibration results of five algorithms (mm).
It can be seen from Table 5, Our method’s calibration time less than other method.
Calibration times comparison of five algorithms.
Comparison of reprojection errors
The reprojection errors of the proposed algorithm are compared with those of GA, PSO, and DE algorithms, and the results are shown in Table 5. It can be seen from Table 6 that EX and Ey represent the reprojection error in the X and Y directions respectively. The reprojection error of our method is smaller than GA, PSO, DE, Zhang’s method.
Comparison of reprojection errors.
Conclusions
In this paper, improved differential evolutionary particle swarm hybrid algorithm can solve the multiple parameters of traditional camera calibration algorithm, and is applied to camera calibration experiment, which can verify the practical feasibility and effectiveness of the new camera calibration algorithm. Experiments show that the camera calibration method proposed in this paper has better calibration performance compared with GA, PSO, DE, Zhang’s method and the calibration result data error iteration performance obtained by the new algorithm is better. Compared with GA, PSO, DE, and Zhang’s method, the image coordinates derived by the new algorithm are close to the actual image coordinates, and the difference values are all less than 0.10 pixels. This indicates that the calibration method proposed in this paper has good performance and has certain theoretical significance and research value. The root mean square error of the calibration algorithm proposed in this paper is only 0.182, the calibration error result is smaller than other several algorithms. The reprojection error of our method is 0.05938 (Ex/pixel) and 0.02988 (Ey/pixel). It is far smaller than GA, PSO, DE, and Zhang’s method, so the algorithm performance is excellent.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This article is supported by scientific research project of Jiangxi Department of Education.
