# Multicamera Calibration Optimization Method Based on Improved Seagull Algorithm

Authors: Shuai Du; Jianyu Wang; Jia Guo
Journal: Security and Communication Networks
 (2021)

---

## Abstract

There are some problems in the process of camera calibration, such as insufficient accuracy and poor accuracy. Based on the seagull algorithm, the adaptive differential evolution algorithm is combined with the seagull algorithm to optimize the multicamera calibration. The seagull algorithm can achieve good results on multiparameter problems and effectively avoid falling into local optima. In this paper, the adaptive differential search algorithm is adopted to improve the local search ability and optimize the local search and global search ability. According to Zhang Zhengyou's method, the calibrated parameter is obtained, in which the parameter is used as the initial value. Then, taking the minimum mean error as the criterion, the improved seagull algorithm (SOA-SaDE) is used to establish the objective function, and the internal parameters and distortion coefficient of the camera are further solved. Verification experiments showed that the fusion algorithm has less reprojection error and higher calibration accuracy gull algorithm.


---

## Body

## 1. Introduction

Multiple cameras are widely used in various fields. Multicamera fusion can provide a wider range of real-time scene information. As an important tool of machine vision, improving camera calibration accuracy is the focus of its research. It has more accurate camera calibration and is more conducive to the camera image matching, recognition positioning, and other follow-up operation accuracy.At present, the field of deep-sea exploration is developing in a deeper and farther direction. Underwater robots are widely used in underwater exploration due to their wide range of activities and strong autonomy. Compared with other underwater detection methods, robot visual observation is at a close range. Object detection has unparalleled advantages. It can not only track and detect underwater targets in real time but also record underwater video materials for researchers to study deep-sea objects after landing. Therefore, improving the accuracy of camera calibration and eliminating image distortion are of great significance to the research in the deep-sea field.The camera calibration uses the calibration object in the space and obtains the calibration object different space positions through the position change. The mathematical model can be constructed by the relation between the object space coordinate system and the camera image coordinate system, Then, the internal parameters and distortion coefficients of the camera are calculated and solved.Camera calibration is a multidimensional nonlinear problem. Each calibration image corresponds to different external parameters. Therefore, it is very difficult to find the concrete calculation equation in the process of backprojection to the calibration point. Common optimization algorithms, such as the pseudo-Newton method, cannot be applied to the optimization of camera calibration because they must depend on the specific functional form. Therefore, the researchers focus on using optimization algorithm to optimize the camera calibration results. Huang et al. [1] used the classical particle swarm optimization (PSO) algorithm to optimize the camera calibration results, took the absolute value of average relative error as the objective function, optimized the camera parameters, and improved the calibration accuracy. Qin et al. [2] proposed a full-parameter adaptive mutation PSO. They used the algorithm to optimize the camera intrinsic parameters and improve the adaptive mutation rate of the particles according to the average particle distance of the particle swarm to optimize the camera calibration results. Xu et al. [3] introduced a diffusion mechanism to improve the local optimal solution problem of particle swarm optimization. Xiang et al. [4] proposed a calibration method based on depth learning. It can be calibrated by inputting the coordinates of the original image by improving the approximation ability of the DNN network. It can be used in large areas, multiple camera angles, and other complex environments. However, deep learning network training requires GPU acceleration and requires high computer configuration, and training takes time, so it is difficult to calibrate quickly. Lei et al. [5] combined PSO with simulated annealing (SA) algorithm, obtained the initial parameters of camera calibration by least squares, and optimized the camera parameters by the hybrid algorithm. This method improves the calibration accuracy of the camera. Based on the Levenberg–Marquardt algorithm, Liu Jiachen [6] corrected the reprojection error by using the improved beam adjustment method to reduce the error of 3D reconstruction. However, in this process, the formula is tedious and the computation is complex.The seagull algorithm is a kind of metaheuristic, which is suitable for solving multiparameter optimization problems. When the traditional seagull algorithm is used, the initial seagull swarm has strong randomness, but the optimization process is inefficient and easy to fall into local optimization. A hybrid optimization algorithm is proposed in [7]. The algorithm is based on chaotic differential evolution and distribution estimation, which can obtain a high-precision solution. A hybrid algorithm of adaptive gravity search and differential evolution (DE) is proposed in [8], which keeps the diversity of the population. The DE is used for local search and plays a big role. Inspired by the successful application of the above hybrid algorithm, seagull algorithm used in this paper, and seagulls algorithm compared to traditional optimization algorithm, the principle is simple and easy to implement, is suitable for multiobjective optimization, and does not coincide with the position of the population in an iterative process, reducing repetitive iterations and improving the effectiveness of iterations. To avoid the local optimization in the calibration calculation, this paper combines the seagull algorithm and the adaptive differential evolution algorithm and improves the seagull algorithm by absorbing the strong local searching ability of ADE, improving the accuracy and stability of camera calibration.This article focuses on the key issues that need to be solved for camera calibration. Aiming at the problem of low calibration accuracy and obvious reprojection errors, a fusion algorithm (SOA-SaDE) is proposed based on the seagull algorithm and the adaptive differential algorithm. The internal parameters and distortion coefficients calibrated based on the pinhole camera model are optimized by the SOA-SaDE algorithm. Experiments show that the algorithm proposed in this paper effectively reduces the error of camera reprojection; the reprojection error is reduced by 63.03%, which is 16.75% higher than the effect of the seagull algorithm, and provides a feasible method for reducing the camera reprojection error.


## 2. Basic Principles of the Seagull Algorithm

In 2018, the seagull algorithm (SOA) proposed a new population-based intelligent optimization algorithm, which simulates the migrating and foraging behavior of seagulls to optimize the target [9].The seagull algorithm is divided into two parts; they are migration and foraging. Migration is the behavior that is the movement of seagulls from their current position to a more livable position. Migration behavior affects the global exploration ability of the seagull algorithm. Foraging is the behavior of seagulls attacking the food in the current sea area during the flight. The foraging behavior affects the ability of the seagull algorithm for local exploitation.There are three important points to be paid attention to during a Gull’s migration from one place to another: avoiding collisions between individuals, the best orientation of its position, and its proximity to the best position. To avoid the collision with the seagulls, the algorithm uses the additional variable A to adjust the seagulls’ position:(1)Cs⟶=A×Psx⟶,where A represents the migration behavior of seagulls in each given search space The size of A is controlled by B:(2)A=fc−t×fcMaxiteration.The final size ofA decreases linearly from 2⟶0 according to the number of iterations. After ensuring that individual gulls do not collide with each other, move all gulls closer to the best:(3)Ms⟶=B∗Pbestx⟶−Psx⟶,where Ms represents the convergence direction of the individual toward the optimal seagull and B is an important parameter for balancing the exploration and development capability of the algorithm. It changes according to(4)B=2∗A2∗rand,where rand is a random number in the range [0,1].After calculating the direction of convergence of each gull, each gull began to move toward this position:(5)Ds⟶=Cs⟶+Ms⟶,where Ds⟶ is the position of the seagull.Seagulls can constantly change their angle and speed of attack during the migration, when attacking prey, seagulls will carry out the spiral movement. The position of the seagull in the 3D is(6)x=r∗cosk,(7)y=r∗sink,(8)z=r∗k,(9)r=u∗ekv,where k is a random number at 0,2π. The algorithm controls the spiral radius r by u and v, and they are usually 1. According to the new position of seagull, the updated formula of the whole position of the seagull is as follows:(10)Psx⟶=Ds⟶×x×y×z+Pbestx⟶,where Psx⟶ is the attack position of the seagull.SOA: the flow of the algorithm is as follows:Step 1:
initialization parameterStep 2:
calculate the fitness value for each seagull and the objective function valueStep 3:
calculateDs⟶ according to formulas (1)–(5)Step 4:
calculate according to formulas (6)–(10)Step 5:
update position information and fitness values for the best seagull,internation=internation+1Step 6:
ifinternation>Maxinteration, skip to Step 7, or slip to Step 3Step 7:
output the optimal seagull position and fitness value


## 3. Adaptive Differential Evolution Algorithm

### 3.1. Differential Evolution

Differential evolution algorithm (DE) is a kind of evolutionary algorithm (EA), which is a search strategy for solving polynomial fitting problems put forward by R. Storn and K. Price. This algorithm is based on genetic algorithm and other evolutionary ideas; its essence is to optimize the multiobjective and multidimensional space to achieve the overall optimal solution of the goal. The differential evolution algorithm retains the crossover, mutation, and copy operations in the genetic algorithm. It differs from GA in which the variation vector is generated by the parent difference vector, which crosses with the incidental individuals to generate new individuals and then selects among them. Therefore, it has a better iterative approximation effect than GA. The differential algorithm is divided into two stages: population initialization and iteration [10].


#### 3.1.1. Population Initialization

Suppose thatG=0,1,2…Gmax stands for evolution algebra. Then, the 1st individual in the population under the current algebra is represented as(11)X⟶i,G=xi,G1,xi,G2,…,xi,Gj,j=1,2,…,D,where D is the dimension of the individuals of the population. In population initialization, the initial population is required to cover the entire search space RD, and the initialization formula is shown in (8):(12)xj,i,0=xj,min+randi,j0,1∗xj,max−xj,min,where randi,j0,1 is a uniformly distributed random number in the interval 0,1 and xj,min and xj,max are the lower and upper bounds of the individual optimization variables X⟶, j, respectively.


#### 3.1.2. Differential Mutation Operation

In each iteration, three individual vectors are randomly selected from the populationX⟶r1,G,X⟶r2,G, and X⟶r3,G, and r1≠r2≠r3, according to (13), a new individual V⟶i,G can be created; this individual is a variation vector:(13)V⟶i,G=X⟶r1,G+F∗X⟶r1,G−X⟶r3,G,where F is the variation scale factor, which is used to scale the difference vector to control the search step. In general, the variation scale factor F is in the [0,2] interval.


#### 3.1.3. Cross Operation

In the crossover step, the algorithm adopts discrete crossover. The test vectorU⟶i,G is generated by crossing mutation vector V⟶i,G and target vector X⟶r1,G according to the binomial method. The specific operation is shown in(14)ui,Gi=vi,Gj,ifrandi,j0,1≤Cr,xi,Gj,otherwise,where Cr is the crossover probability factor, and the crossover operator can enhance the diversity of the population. The value of Cr is generally in the interval [0,1], which is a random number uniformly distributed in the interval [0,1]. In the j dimension, if the random generating number is less than Cr, the test vector inherits the variation vector and vice versa.


#### 3.1.4. Select Operation

The selection process selects the more adaptable child from each iteration as the next generation by comparing the child with the corresponding parent based on the value of the fitness function; its selection method is shown as(15)X⟶i,G=U⟶i,G,ifU⟶i,G≤fX⟶i,G,X⟶i,G,otherwise.


### 3.2. Adaptive Differential Evolution

According to formulas (13) and (14), F and Cr are two important parameters in DE, and the choice of their values will affect the optimization effect. However, in the DE algorithm, the values are all constant and cannot be well adapted to various problems, especially, for complex high-dimensional problems. Therefore, Janez Brest introduced adaptive control parameters in 2006. The improved algorithm is called the adaptive differential evolution algorithm (SaDE) [11]. The adaptive control parameters F and Cr are represented as(16)Fit+1=Fl+rand1×Fu,ifrand2≤τ1,Fit,otherwise,CRit+1=rand3,ifrand4<τ2,CRit,ifrand4≥τ2,where rand1, rand2, rand3, and rand4 is the random number in [0, 1], τ1 and τ2 indicate the probability of conversion, and Fl and Fu are the boundary scaling factor.


## 3.1. Differential Evolution

Differential evolution algorithm (DE) is a kind of evolutionary algorithm (EA), which is a search strategy for solving polynomial fitting problems put forward by R. Storn and K. Price. This algorithm is based on genetic algorithm and other evolutionary ideas; its essence is to optimize the multiobjective and multidimensional space to achieve the overall optimal solution of the goal. The differential evolution algorithm retains the crossover, mutation, and copy operations in the genetic algorithm. It differs from GA in which the variation vector is generated by the parent difference vector, which crosses with the incidental individuals to generate new individuals and then selects among them. Therefore, it has a better iterative approximation effect than GA. The differential algorithm is divided into two stages: population initialization and iteration [10].


### 3.1.1. Population Initialization

Suppose thatG=0,1,2…Gmax stands for evolution algebra. Then, the 1st individual in the population under the current algebra is represented as(11)X⟶i,G=xi,G1,xi,G2,…,xi,Gj,j=1,2,…,D,where D is the dimension of the individuals of the population. In population initialization, the initial population is required to cover the entire search space RD, and the initialization formula is shown in (8):(12)xj,i,0=xj,min+randi,j0,1∗xj,max−xj,min,where randi,j0,1 is a uniformly distributed random number in the interval 0,1 and xj,min and xj,max are the lower and upper bounds of the individual optimization variables X⟶, j, respectively.


### 3.1.2. Differential Mutation Operation

In each iteration, three individual vectors are randomly selected from the populationX⟶r1,G,X⟶r2,G, and X⟶r3,G, and r1≠r2≠r3, according to (13), a new individual V⟶i,G can be created; this individual is a variation vector:(13)V⟶i,G=X⟶r1,G+F∗X⟶r1,G−X⟶r3,G,where F is the variation scale factor, which is used to scale the difference vector to control the search step. In general, the variation scale factor F is in the [0,2] interval.


### 3.1.3. Cross Operation

In the crossover step, the algorithm adopts discrete crossover. The test vectorU⟶i,G is generated by crossing mutation vector V⟶i,G and target vector X⟶r1,G according to the binomial method. The specific operation is shown in(14)ui,Gi=vi,Gj,ifrandi,j0,1≤Cr,xi,Gj,otherwise,where Cr is the crossover probability factor, and the crossover operator can enhance the diversity of the population. The value of Cr is generally in the interval [0,1], which is a random number uniformly distributed in the interval [0,1]. In the j dimension, if the random generating number is less than Cr, the test vector inherits the variation vector and vice versa.


### 3.1.4. Select Operation

The selection process selects the more adaptable child from each iteration as the next generation by comparing the child with the corresponding parent based on the value of the fitness function; its selection method is shown as(15)X⟶i,G=U⟶i,G,ifU⟶i,G≤fX⟶i,G,X⟶i,G,otherwise.


## 3.1.1. Population Initialization

Suppose thatG=0,1,2…Gmax stands for evolution algebra. Then, the 1st individual in the population under the current algebra is represented as(11)X⟶i,G=xi,G1,xi,G2,…,xi,Gj,j=1,2,…,D,where D is the dimension of the individuals of the population. In population initialization, the initial population is required to cover the entire search space RD, and the initialization formula is shown in (8):(12)xj,i,0=xj,min+randi,j0,1∗xj,max−xj,min,where randi,j0,1 is a uniformly distributed random number in the interval 0,1 and xj,min and xj,max are the lower and upper bounds of the individual optimization variables X⟶, j, respectively.


## 3.1.2. Differential Mutation Operation

In each iteration, three individual vectors are randomly selected from the populationX⟶r1,G,X⟶r2,G, and X⟶r3,G, and r1≠r2≠r3, according to (13), a new individual V⟶i,G can be created; this individual is a variation vector:(13)V⟶i,G=X⟶r1,G+F∗X⟶r1,G−X⟶r3,G,where F is the variation scale factor, which is used to scale the difference vector to control the search step. In general, the variation scale factor F is in the [0,2] interval.


## 3.1.3. Cross Operation

In the crossover step, the algorithm adopts discrete crossover. The test vectorU⟶i,G is generated by crossing mutation vector V⟶i,G and target vector X⟶r1,G according to the binomial method. The specific operation is shown in(14)ui,Gi=vi,Gj,ifrandi,j0,1≤Cr,xi,Gj,otherwise,where Cr is the crossover probability factor, and the crossover operator can enhance the diversity of the population. The value of Cr is generally in the interval [0,1], which is a random number uniformly distributed in the interval [0,1]. In the j dimension, if the random generating number is less than Cr, the test vector inherits the variation vector and vice versa.


## 3.1.4. Select Operation

The selection process selects the more adaptable child from each iteration as the next generation by comparing the child with the corresponding parent based on the value of the fitness function; its selection method is shown as(15)X⟶i,G=U⟶i,G,ifU⟶i,G≤fX⟶i,G,X⟶i,G,otherwise.


## 3.2. Adaptive Differential Evolution

According to formulas (13) and (14), F and Cr are two important parameters in DE, and the choice of their values will affect the optimization effect. However, in the DE algorithm, the values are all constant and cannot be well adapted to various problems, especially, for complex high-dimensional problems. Therefore, Janez Brest introduced adaptive control parameters in 2006. The improved algorithm is called the adaptive differential evolution algorithm (SaDE) [11]. The adaptive control parameters F and Cr are represented as(16)Fit+1=Fl+rand1×Fu,ifrand2≤τ1,Fit,otherwise,CRit+1=rand3,ifrand4<τ2,CRit,ifrand4≥τ2,where rand1, rand2, rand3, and rand4 is the random number in [0, 1], τ1 and τ2 indicate the probability of conversion, and Fl and Fu are the boundary scaling factor.


## 4. Camera Internal Parameter Optimization Design and Application Based on the Hybrid Algorithm

### 4.1. Design of Hybrid Algorithms

This paper proposes a combination of the SOA algorithm and the SaDE algorithm. It aims to improve the search precision, avoid the population falling into the local extremum, and maintain the population diversity in the later iteration. In the minimization problem, if the fitness of the iteration is greater than that of the previous generation, the location region of the iteration is not good, so the randomness of the population should be strengthened to improve the search range. If the fitness intelligence of the iterated individuals is less than that of the optimal individuals of the previous generation, then the region has the potential value, so we should continue searching along the region.Combining the SOA algorithm with the SaDE algorithm to realize the internal parameter optimization, in each population iteration, the minimum fitness value of the population is calculated asfmini. In the i+1 iteration, when fmini+1<fmini, SOA is used for optimization, when fmini+1>fmini, SaDE is used for optimization.


### 4.2. Establishment of the Objective Function

The objective function of the camera calibration problem is established as follows:(17)f=∑i=1Npij−pfx,fy,u0,v0,k1,k2,k3,p1,p2,R,T,where pij is the actual pixel coordinates of the j corner, N is the number of corners, P is the calculated pixel coordinates, fx,fy,u0,andv0 are the camera’s internal parameter, k1,k2,k3,p1,andp2 are the radial distortion coefficient and the tangential distortion coefficient, and R and T are the rotation translation matrix of the image.


### 4.3. Parameter Initial Value Solution

The camera imaging relationship is(18)zcxdyd1=fc1dx0u000fc2dyv000010R3×3T3×101xwywzw1.The above formula represents the transformation of pointxwywzw1T in the world coordinate system to point xd,yd,1T in the pixel coordinate system in the linear model. MA is the internal parameter matrix which represents the intrinsic geometry of the camera. The mathematical model is(19)MA=fx0u00fyv0001,where fx=fc1/dxandfy=fc2/dy,fc1andfc2 are the focal length of the camera, dx and dy are the physical lengths of the pixels, and u0 and v0 are the intersections of the camera’s optical axis and the image plane.According to the above expression, the camera internal parameters can mainly solve 4 parameters. They arefx,fy,u0,andv0. We can obtain the initial value of fx,fy,u0,andv0 by the imaging relation. The initial value is obtained under the ideal condition, but the actual lens has distortion, so it needs to introduce distortion coefficient k1,k2,k3,p1,andp2 to correct it.The mathematical model of radial distortion is(20)xd=xu1+k1r2+k2r4+k3r6,yd=yu1+k1r2+k2r4+k3r6.The mathematical model of tangential distortion is(21)xd=xu+2p1yu+p2r2+2xu2,yd=yu+2p2xu+p1r2+2yu2.In the above formula,(22)r2=xu2+yu2.Contacting formulas (20)–(22), we can obtain(23)xd=xu1+k1r2+k2r4+k3r6+2p1xuyu+p23xu2+yu2,yd=yu1+k1r2+k2r4+k3r6+2p2xuyu+p13xu2+yu2,where xd,yd is the image coordinate of the ideal camera model and xu,yu is the real image coordinate of the nonlinear camera model. The initial value under the distortion is obtained by formula (23).


### 4.4. Hybrid Algorithm Application

First, the initial value of the internal parameterfx,fy,u0,v0,k1,k2,k3,p1,andp2 then initializes the seagull population to generate N different seagull individuals. Initializing population position, parameters A, B, and Maxinternation, set the appropriate parameters fc  = 2, u=1,v=1, and initialize the current iteration number t = 0. The fitness function is obtained from the objective function and is defined as(24)fitness=min∑i=1mx−u2+y−v2,where (x, y) is the actual pixel coordinates obtained by the corner extraction algorithm, (u, v) is the pixel coordinates calculated by camera imaging relations, and m is the total number of corners.The algorithm flow of camera internal parameter optimization using the hybrid algorithm is shown in Figure1.Figure 1
The biological principle of the seagull algorithm.


## 4.1. Design of Hybrid Algorithms

This paper proposes a combination of the SOA algorithm and the SaDE algorithm. It aims to improve the search precision, avoid the population falling into the local extremum, and maintain the population diversity in the later iteration. In the minimization problem, if the fitness of the iteration is greater than that of the previous generation, the location region of the iteration is not good, so the randomness of the population should be strengthened to improve the search range. If the fitness intelligence of the iterated individuals is less than that of the optimal individuals of the previous generation, then the region has the potential value, so we should continue searching along the region.Combining the SOA algorithm with the SaDE algorithm to realize the internal parameter optimization, in each population iteration, the minimum fitness value of the population is calculated asfmini. In the i+1 iteration, when fmini+1<fmini, SOA is used for optimization, when fmini+1>fmini, SaDE is used for optimization.


## 4.2. Establishment of the Objective Function

The objective function of the camera calibration problem is established as follows:(17)f=∑i=1Npij−pfx,fy,u0,v0,k1,k2,k3,p1,p2,R,T,where pij is the actual pixel coordinates of the j corner, N is the number of corners, P is the calculated pixel coordinates, fx,fy,u0,andv0 are the camera’s internal parameter, k1,k2,k3,p1,andp2 are the radial distortion coefficient and the tangential distortion coefficient, and R and T are the rotation translation matrix of the image.


## 4.3. Parameter Initial Value Solution

The camera imaging relationship is(18)zcxdyd1=fc1dx0u000fc2dyv000010R3×3T3×101xwywzw1.The above formula represents the transformation of pointxwywzw1T in the world coordinate system to point xd,yd,1T in the pixel coordinate system in the linear model. MA is the internal parameter matrix which represents the intrinsic geometry of the camera. The mathematical model is(19)MA=fx0u00fyv0001,where fx=fc1/dxandfy=fc2/dy,fc1andfc2 are the focal length of the camera, dx and dy are the physical lengths of the pixels, and u0 and v0 are the intersections of the camera’s optical axis and the image plane.According to the above expression, the camera internal parameters can mainly solve 4 parameters. They arefx,fy,u0,andv0. We can obtain the initial value of fx,fy,u0,andv0 by the imaging relation. The initial value is obtained under the ideal condition, but the actual lens has distortion, so it needs to introduce distortion coefficient k1,k2,k3,p1,andp2 to correct it.The mathematical model of radial distortion is(20)xd=xu1+k1r2+k2r4+k3r6,yd=yu1+k1r2+k2r4+k3r6.The mathematical model of tangential distortion is(21)xd=xu+2p1yu+p2r2+2xu2,yd=yu+2p2xu+p1r2+2yu2.In the above formula,(22)r2=xu2+yu2.Contacting formulas (20)–(22), we can obtain(23)xd=xu1+k1r2+k2r4+k3r6+2p1xuyu+p23xu2+yu2,yd=yu1+k1r2+k2r4+k3r6+2p2xuyu+p13xu2+yu2,where xd,yd is the image coordinate of the ideal camera model and xu,yu is the real image coordinate of the nonlinear camera model. The initial value under the distortion is obtained by formula (23).


## 4.4. Hybrid Algorithm Application

First, the initial value of the internal parameterfx,fy,u0,v0,k1,k2,k3,p1,andp2 then initializes the seagull population to generate N different seagull individuals. Initializing population position, parameters A, B, and Maxinternation, set the appropriate parameters fc  = 2, u=1,v=1, and initialize the current iteration number t = 0. The fitness function is obtained from the objective function and is defined as(24)fitness=min∑i=1mx−u2+y−v2,where (x, y) is the actual pixel coordinates obtained by the corner extraction algorithm, (u, v) is the pixel coordinates calculated by camera imaging relations, and m is the total number of corners.The algorithm flow of camera internal parameter optimization using the hybrid algorithm is shown in Figure1.Figure 1
The biological principle of the seagull algorithm.


## 5. Experiment

### 5.1. Experimental Design

The experiment uses camera RealSense D435i as the hardware platform and usesPython as the software development platform. In this experiment, 16 images were taken, and the camera internal parameters and distortion coefficients were calibrated based on these images. The pictures are shown in Figure 2.Figure 2
Calibration pictures.


#### 5.1.1. Specific Calibration Steps

Step 1:
the camera calibration is realized based on OpenCV-PythonStep 2:
according to the calibration parameters obtained by the traditional method, the upper and lower interval of the parameters are set, the scope is limited, and the parameters are initializedStep 3:
the results of 300, 500, and 1000 iterations in the seagull algorithm are brought inStep 4:
the initial parameters are brought into the SOA-SaDE fusion algorithm to calculate the iterative results of 300 times, 500 times, and 1000 times, respectivelyStep 5:
compare the results of the traditional method and the improved algorithm


### 5.2. Analysis of Experimental Results

Figures3(a)–3(d) show the results of 500 and 1000 iterations of the general SOA algorithm and the SOA-SaDE algorithm. As can be seen from the graph that the SOA algorithm converges fast, but it is easy to fall into the local optimum. However, the SOA-SaDE algorithm is effective in dealing with the local optimum and can jump out of the local optimum and continue to converge toward the global optimum. When the image curve is flat, it is close to the optimal target value.Figure 3
Object function curve. (a) SOA iterates 500 objective function curves. (b) SOA iterates 1000 objective function curves. (c) SOA-SaDE iterates 500 objective function curves. (d) SOA-SaDE iterates 1000 objective function curves.
(a)(b)(c)(d)Table1 is the calibration result of Zhang Dingyou’s method; Tables 2–4 are the optimization results of the SOA algorithm and SOA-SaDE fusion algorithm after 500 and 1000 iterations, respectively. According to the reprojection error after optimization is calculated, the results of Zhang’s method can be well optimized by these two optimization algorithms. Moreover, the SOA-SaDE algorithm proposed in this paper is generally superior to the SOA algorithm. The fusion algorithm proposed in this paper is robust and reusable and can improve the local convergence of the SOA algorithm and get better results, as shown in Figure 4.Table 1
Calibration results of the Zhang Zhengyou calibration method.
ParameterZhang Zhengyou calibration methodfx3575.57253fy3558.46976u01541.29510v01885.83655k10.14037782k2−1.12437053p10.0079399p2−0.00243523k31.45905723Error0.828057702Table 2
Calibration results of camera internal parameters for 500 iterations.
ParameterMethodSOASOA-SaDEfx3572.852913640.19021fy3556.140083614.61743u01546.410001540.28375v01886.402991888.24897k1−0.00130089−0.25517776k20.020470080.96152329p1−0.001140370.00163706p2−0.00115161−0.00013975k3−2.724484361.34834219Table 3
Iterative calibration results of 1000 camera internal parameters.
ParameterMethodSOASOA-SaDEfx3581.178743623.59017fx3564.412443601.84834u01544.833541538.79344v01886.528391888.07675k10.00972433−0.23023645k2−0.002647051.33036931p10.000507380.00148013p2−1.099684860.00344624k30.00202380−0.75344467Table 4
Reprojection errors.
Number of iterationsMethodSOASOA-SaDE5000.367745330.3061507410000.320569680.29615753Figure 4
Algorithm flow of internal parameter optimization.


## 5.1. Experimental Design

The experiment uses camera RealSense D435i as the hardware platform and usesPython as the software development platform. In this experiment, 16 images were taken, and the camera internal parameters and distortion coefficients were calibrated based on these images. The pictures are shown in Figure 2.Figure 2
Calibration pictures.


### 5.1.1. Specific Calibration Steps

Step 1:
the camera calibration is realized based on OpenCV-PythonStep 2:
according to the calibration parameters obtained by the traditional method, the upper and lower interval of the parameters are set, the scope is limited, and the parameters are initializedStep 3:
the results of 300, 500, and 1000 iterations in the seagull algorithm are brought inStep 4:
the initial parameters are brought into the SOA-SaDE fusion algorithm to calculate the iterative results of 300 times, 500 times, and 1000 times, respectivelyStep 5:
compare the results of the traditional method and the improved algorithm


## 5.1.1. Specific Calibration Steps

Step 1:
the camera calibration is realized based on OpenCV-PythonStep 2:
according to the calibration parameters obtained by the traditional method, the upper and lower interval of the parameters are set, the scope is limited, and the parameters are initializedStep 3:
the results of 300, 500, and 1000 iterations in the seagull algorithm are brought inStep 4:
the initial parameters are brought into the SOA-SaDE fusion algorithm to calculate the iterative results of 300 times, 500 times, and 1000 times, respectivelyStep 5:
compare the results of the traditional method and the improved algorithm


## 5.2. Analysis of Experimental Results

Figures3(a)–3(d) show the results of 500 and 1000 iterations of the general SOA algorithm and the SOA-SaDE algorithm. As can be seen from the graph that the SOA algorithm converges fast, but it is easy to fall into the local optimum. However, the SOA-SaDE algorithm is effective in dealing with the local optimum and can jump out of the local optimum and continue to converge toward the global optimum. When the image curve is flat, it is close to the optimal target value.Figure 3
Object function curve. (a) SOA iterates 500 objective function curves. (b) SOA iterates 1000 objective function curves. (c) SOA-SaDE iterates 500 objective function curves. (d) SOA-SaDE iterates 1000 objective function curves.
(a)(b)(c)(d)Table1 is the calibration result of Zhang Dingyou’s method; Tables 2–4 are the optimization results of the SOA algorithm and SOA-SaDE fusion algorithm after 500 and 1000 iterations, respectively. According to the reprojection error after optimization is calculated, the results of Zhang’s method can be well optimized by these two optimization algorithms. Moreover, the SOA-SaDE algorithm proposed in this paper is generally superior to the SOA algorithm. The fusion algorithm proposed in this paper is robust and reusable and can improve the local convergence of the SOA algorithm and get better results, as shown in Figure 4.Table 1
Calibration results of the Zhang Zhengyou calibration method.
ParameterZhang Zhengyou calibration methodfx3575.57253fy3558.46976u01541.29510v01885.83655k10.14037782k2−1.12437053p10.0079399p2−0.00243523k31.45905723Error0.828057702Table 2
Calibration results of camera internal parameters for 500 iterations.
ParameterMethodSOASOA-SaDEfx3572.852913640.19021fy3556.140083614.61743u01546.410001540.28375v01886.402991888.24897k1−0.00130089−0.25517776k20.020470080.96152329p1−0.001140370.00163706p2−0.00115161−0.00013975k3−2.724484361.34834219Table 3
Iterative calibration results of 1000 camera internal parameters.
ParameterMethodSOASOA-SaDEfx3581.178743623.59017fx3564.412443601.84834u01544.833541538.79344v01886.528391888.07675k10.00972433−0.23023645k2−0.002647051.33036931p10.000507380.00148013p2−1.099684860.00344624k30.00202380−0.75344467Table 4
Reprojection errors.
Number of iterationsMethodSOASOA-SaDE5000.367745330.3061507410000.320569680.29615753Figure 4
Algorithm flow of internal parameter optimization.


## 6. Conclusion

In order to solve the local convergence problem, SaDE algorithm is not easy to fall into local convergence. When the optimal individual fitness of each iteration is less than the value of the last iteration, local convergence may have occurred. SaDE was used to optimize population parameters and increase population diversity. This paper presents a new optimization method for camera internal parameters. The algorithm is based on seagull algorithm and adaptive parametric differential evolution algorithm. In this paper, the two are integrated into a framework according to certain mechanisms. By comparing the reprojection errors of Zhang Zhengyou’s calibration algorithm, SOA algorithm, and SOA-SADE fusion algorithm, it can be seen that the gull differential evolution algorithm can get smaller errors. The calibration accuracy is improved to a certain extent. The experimental results show that the gull difference algorithm has good accuracy and feasibility for camera internal parameters optimization. The algorithm can be combined with practical engineering cases to solve multidimensional nonlinear optimization problems accurately and effectively. There are many similar bionic algorithms, such as monarch butterfly optimization (MBO), earthworm optimization algorithm (EWA), elephant herding optimization (EHO), moth search (MS) algorithm, slime mould algorithm (SMA), and Harris hawks optimization (HHO). [12, 13] These bionic algorithms have their own unique characteristics and can play a very good role in specific engineering fields. We believe that, in the follow-up research, we can comprehensively consider the advantages and disadvantages of each algorithm, merge different algorithms, learn from each other, apply it to the vision of underwater robots for deep-sea exploration, and provide a solution for improving the accuracy of underwater robot vision detection. The underwater environment is complicated. How to solve the problem of underwater imaging should consider the refraction of light brought by water, and the problem of floating objects in the water affecting image clarity is the next issue we need to consider.



---

*Source: 6974757-2021-12-21.xml*