Underwater Camera Calibration Based on Double Refraction

: Underwater camera calibration plays a pivotal role in underwater positioning and under‑ water mapping reconstruction, making it crucial for achieving precise spatial measurements in un‑ derwater environments. To elevate measurement accuracy, we have refined the calibration method‑ ology for underwater cameras. Firstly, we conducted an in‑depth investigation into the intricate challenges posed by double refraction errors arising from light passing through water–glass–air inter‑ faces. To address this issue, we established a double refraction model based on the actual underwater light paths, laying the groundwork for our calibration efforts. Furthermore, to tackle the problem of determining multiple camera parameters, we proposed a parameter optimization method based on genetic algorithms, capable of navigating the complex parameter space. Finally, compared with other algorithms, our method enables more precise determination of underwater camera parameters.


Introduction
Computer vision has been widely applied across various domains, including the medical field [1], industrial sector [2], military applications, and beyond.In recent times, with advancements in underwater equipment, such as autonomous underwater vehicles (AUVs) [3], remotely operated vehicles (ROVs) [4], etc., underwater vision has become an indispensable component of underwater exploration [5], aquaculture [6], underwater archaeology [7,8], and various other applications such as underwater target recognition [9,10], underwater target localization [11], underwater object reconstruction [12], and underwater simultaneous localization and mapping (SLAM) [13].In these applications, the accuracy of camera calibration is paramount for tasks like underwater positioning and map reconstruction.
To establish the relationship between the three-dimensional geometric position of a point on the surface of an object and its corresponding point in the image, it is necessary to build a geometric model of camera imaging.The process of solving these parameters is called camera calibration.Due to the unique characteristics of the underwater environment, underwater cameras typically consist of camera components, a closed shell, and a glass cover, causing the underwater light path to pass through three media: water, glass, and air.This inevitably leads to refraction, which introduces errors in subsequent measurement processing.
In previous studies, some researchers [14,15] directly overlooked the influence of refraction and applied calibration algorithms designed for air environments [16,17] directly in underwater settings, inevitably leading to errors.Some scholars addressed the refraction effect by approximating it as changes in focal length and distortion: Lavest [18] suggests that if calibration methods designed for air are directly applied to underwater environments, the focal length needs to be multiplied by the water index; and Qin [19] utilized advanced camera distortion models to compensate for deviations caused by light refraction through water and air media.Li [20] equivalently treats the underwater camera model as a pinhole model with changes in focal length, and provides the corresponding process for calculating camera parameters.Sun [21] proposed a rapid underwater calibration method based on two sets of mutually orthogonal parallel lines, optimizing the vanishing point to determine its focal length, which is based on an air-water equivalent focal length model.Bashar [22] proposed the theory of refraction invariance, dividing the calculation of imaging parameters into refractive and non-refractive related sets, and utilizing an approximate linear model to compute camera parameters.In such algorithms, due to the complexity of simulating refraction, there are issues with low calibration accuracy.Fortunately, recently some scholars have conducted research on underwater cameras based on real light path models: Treibitz [23] derived forward projection based on Snell's Law, and calibrated the distance between the camera optical centre and the nearest interface, and the intrinsic parameters and distortion of the camera need to be calculated through prior calibration in air.Agrawal [24] proposed an axial camera model based on flat refraction constraints and coplanarity constraints, and presented corresponding methods to solve the high-order forward projection equations.Gu [25] formulated the refractive projection function and calibrated the interface parameters with a quaternion-based optimal solution.However, due to the complexity of parameters in the real underwater camera model, there are the following issues: 1. parameter-solving conditions rely on strict imaging conditions; and 2. constraint adjustment cannot be accurately solved.With the advancement of research, recent studies have shown the potential of intelligent optimization algorithms in solving camera parameters.Tian [26] developed a monocular camera calibration algorithm for land-based applications using an improved particle swarm optimization algorithm.Du [27] utilized an enhanced slime mold algorithm for the calibration of underwater cameras, yet the imaging model remains based on the pinhole model.
To address these challenges, we propose a correction algorithm based on the real light path's double refraction model and demonstrate its necessity in underwater camera usage.Furthermore, due to the need for properties such as high-pressure resistance in underwater cameras, many modern underwater camera structures are relatively integrated and difficult to disassemble and reassemble.As a result, measuring the thickness of the glass becomes relatively challenging.Our model algorithm addresses the issue of glass thickness.Subsequently, we employ a genetic algorithm to solve the parameters, incorporating various strategies during the algorithm's iterations to overcome local optima.Experimental results demonstrate the accurate calculation of camera parameters using our algorithm, making the imaging calibration process straightforward, thus presenting a feasible method for underwater camera calibration.
For the remaining sections, we first introduce the double refraction model and derive the coordinate transformation of the real light path using our method in Section 2. In Section 3, we provide the mathematical proof of the necessity of considering double refraction in underwater camera calibration.This part discusses the impact of neglecting this factor and the resulting spatial measurement errors.In Section 4, we describe our underwater calibration algorithm in detail, including the calibration process using genetic algorithms and checkerboard pattern images.Experimental validation is presented in Section 5. Finally, in Section 6, we summarize the conclusions and propose future work.

Underwater Camera Model
Due to the existence of water medium in the underwater environment, to prevent the camera from entering the water and short-circuiting, the underwater camera is usually placed in a watertight and sealed pressure-resistant shell, and a transparent medium such as glass is used as a light-transmitting material.This causes the light reflected to pass through the three mediums of water-glass-air before the camera can capture it.
According to Fermat's principle, light rays travel in a straight line in the same homogeneous medium, but they are refracted when passing through a different medium.Therefore, the camera will capture the light rays of underwater objects after two refractions.As shown in Figure 1, we have to model the light path propagation model according to the real light path.According to Fermat's principle, light rays travel in a straight line in the same homogeneous medium, but they are refracted when passing through a different medium.Therefore, the camera will capture the light rays of underwater objects after two refractions.As shown in Figure 1, we have to model the light path propagation model according to the real light path.In the real light path, we propagate ( ) in the world coordinate system to 2 ( , v) A u in the pixel coordinate system.The method regards the process as two refractions: (1) coordinates derived from A to 1 A according to the refraction relation; and (2) coordinates derived from 1 A to 2 A according to the imaging principle.
First, we convert A from the world coordinate system ( ) x y z to the camera coordinate system ( ) , , w w w x y z : where where φ ψ θ represents the rotation angle of the camera coordinate system relative to the world coordinate system; and x y z represents the position of the camera's optical center in the world coordinate system.In the real light path, we propagate A(x G , y G , z G ) in the world coordinate system to A 2 (u, v) in the pixel coordinate system.The method regards the process as two refractions: (1) coordinates derived from A to A 1 according to the refraction relation; and (2) coordinates derived from A 1 to A 2 according to the imaging principle.
First, we convert A from the world coordinate system (x G , y G , z G ) to the camera coordinate system (x w , y w , z w ): where R 3×3 represents a 3 × 3 rotation transformation matrix, and its value is associated with the orientation of the camera coordinate system relative to the world coordinate system.
Its specific definition is provided in Equation (2).
→ T represents a 3 × 1 translation vector, indicating the displacement of the camera coordinate system origin relative to the world coordinate system.Its specific definition is given in Equation (3).R =   cos ψ cos θ cos ψ sin θ sin ϕ − sin ψ cos ϕ cos ψ sin θ sin ϕ + sin ψ sin ϕ sin ψ cos θ sin ψ sin θ sin ϕ + cos ψ cos ϕ sin ψ sin θ sin ϕ − cos ψ sin ϕ where ϕ, ψ, θ represents the rotation angle of the camera coordinate system relative to the world coordinate system; and (x O , y O , z O ) represents the position of the camera's optical center in the world coordinate system.A → A 1 : in the camera coordinate system, let the distance between a point A and the optical axis be r w , and the distance between a point A 1 and the optical axis be r a , and meet the following requirements: The relation between point A 1 and point A can be obtained by geometric knowledge: According to Snell's law of refraction: where h is the distance between the optical center and the lower surface of the glass; t is the thickness of glass; z is the depth of the target point in camera coordinates; n w , n g , and n a represent the refractive index of water, glass, and air, respectively; θ g is the refractive angle of light rays in the glass; θ w is the incident angle of the ray in water; and θ a is the refractive angle of the ray in air, and its value is arctan r f .For a triangle, we can easily obtain the following equations: At 20 • C and pressure 1 atmosphere, the refractive index of air is 1.00027, which we approximate to 1.Then, the following equation can be deduced from Equations ( 6) and ( 7): To obtain r a according to r w , direct derivation is not feasible.Therefore, we opt to employ Newton's method for iteration: The zero point of function, g(r a ), corresponds to the solution of Equation ( 9).The iterative formula of Newton's method is as follows: We initiate the iterative process by substituting the projection position of the target point, under the condition of no refraction, as the initial point r a (0) = r w h z into Equation (11).This iterative calculation allows us to derive the solution for Equation (9).
The proof of the iterative convergence of Equation ( 10) is as follows: In the above Equation ( 12), both n a and n g are constants greater than 0. It can be easily obtained from Equation (11): within the interval of r a > 0, g ′ (r a ) is a monotonic decreasing function, and when r a → ∞ , g ′ (r a ) is the minimum value of 1.Therefore, when r a > 0, g ′ (r a ) ̸ = 0 is constantly established.In the interval of r a > 0, the second derivative of g(r a ) to r a exists and is continuous, according to the local convergence theorem of Newton iteration, for the initial iteration point, r a (0) , close to the true value, r * a , the sequence r a (k) generated by Equation (11) always converges to r * a at a rate of no less than second order.After obtaining r a , the coordinate of A 1 in the camera coordinate system (x a , y a , h) can be obtained according to Equation (4).
A 1 → A 2 : the coordinate (x pic , y pic ) in the imaging plane coordinate system can be obtained from the pinhole imaging principle: In actual use, we have to consider the influence of distortion.We use Equation ( 14) to address the distortion effects.
where x c and y c are real position coordinates, and k 1 , k 2 , k 3 , p 1 , p 2 are distortion parameters.Due to the fact that computers typically utilize the pixel coordinate system when processing images, the corrected coordinates are converted into coordinates within the pixel coordinate system: where dx and dy are the actual physical dimensions of a single photosensitive unit in the camera along the height and width directions, respectively; and (u 0 , v 0 ) is the position coordinate of origin O pic in the planar pixel coordinate system of the imaging plane.

Model Necessity Proof
To prove the necessity of the model, we set the "true point", which ignores the first refraction effect, as point A ′ , and the mapping position of A and A ′ to the image is the same as shown in Figure 2. According to the geometric knowledge, we can find the distance r w from point A to the central optical axis.
where dx and dy are the actual physical dimensions of a single photosensitive unit in the camera along the height and width directions, respectively; and 0 0 ( , ) u v is the position coordinate of origin pic O in the planar pixel coordinate system of the imaging plane.

Model Necessity Proof
To prove the necessity of the model, we set the "true point", which ignores the first refraction effect, as point where r is the distance between the imaging point and the central optical axis in the imaging plane.Equation ( 17) can be obtained by substituting Equation ( 8) into Equation (16).
According to Snell's law of refraction, glass in the air does not change the incident angle of the external light rays, and there is only a tiny steady-state translation.This paper ignores this small quantity, and glass does not affect the transmission of light rays when used in the air.As shown in Figure 2, we can calculate the deviation, ∆r, between the target position in the air and the underwater environment based on the above derivation.
To see the influence of the distance of the target point from the central optical axis on ∆r, we will obtain the partial derivative of Equation (18) to r: In the above formula, t and f are constants greater than 0, n g and n w are constants greater than 1, and z is a variable greater than t + h.r is the variable greater than 0.
From Equation (19), it is easy to see that ∂∆r ∂r is the increment function of r, and the minimum value of Equation ( 19) is obtained when r is 0.
In the above formula, n g and n w are constants greater than 1, and z is a value greater than t + h.It is easy to see that Equation (20) is greater than 0 and always holds.
From the nature of the increasing function, we can see that the value of Equation ( 20) is always greater than 0.
We know from the properties of derivatives that, for the z given value, ∆r is an increment of r, and the bigger r is, the bigger ∆r is.According to the principle of optical path reversible, it can be easily deduced that, when the z value is constant, the greater the distance from the target point to the central optical axis is, the greater is the distortion deviation.
To see the influence of the depth of the target point on ∆r, we will obtain the partial derivative of Equation ( 18) with respect to z: In the above Equation ( 21), t and f are constants greater than 0 and n w are constants greater than 1.It is easy to see that Equation ( 21) is always greater than 0. We know from the property of the derivative that, at a given value of r, ∆r is an increment of z, and the bigger z is, the bigger ∆r is.According to the principle of optical path reversible, it can be easily deduced that, when the r value is constant, the farther the target point is from the camera, the greater is the distortion deviation.It is necessary to study the camera imaging model in the underwater environment because the camera imaging model in the underwater environment is bound to cause the deviation of the target location.

Underwater Camera Calibration Based on Double Refraction
The accuracy of parameter calibration of the underwater camera-imaging model directly affects the accuracy of underwater light vision positioning.In this paper, we propose to use planar checkerboard pattern images and a genetic algorithm to calibrate the underwater camera model above and carry out calibration experiments.In the underwater camera model established above, there are parameters to be calibrated, as shown in Table 1.

Refraction Parameters
h is the distance from the optical centre to the lower surface of the glass; t is the thickness of the glass; n g is the refractive index of light rays in the glass; n w is the refractive index of light rays in the water.
Due to the speciality of the underwater environment, our calibration parameters are compared to air more out of refraction parameters, and this is our focus of calibration.The distortion parameters and intrinsic camera parameters can be calibrated in the air by Zhang's calibration [17].For an image, the actual parameters that need to be calibrated in an underwater environment are only the six external parameters of the camera and four refraction parameters.
The calibration process of parameters is shown in Figure 3. Firstly, we use an underwater camera to take planar checkerboard pattern images in the underwater environment in the calibration process, and establish the world coordinate system on the checkerboard pattern.The distance between the corner points we can measure with a ruler, so the position of the corners in the world coordinate system is fixed, and we can obtain the coordinates of the corner points in the world coordinate system from the calibration plate.We use the external parameter matrix to transform the coordinate system to obtain the coordinates of the corners in the camera coordinate system, and use the double refraction model to predict the position of the corners on the image (expected position).At the same time, the position of the corresponding corners in the image (real position) is obtained through vision processing.In the initial state, the parameters in the camera model were inaccurate, so there was a deviation between the predicted position and the real position.We take the deviation as the optimization target, and the calibrated parameters are used as the variables to be optimized.The genetic algorithm is used to optimize the parameters continuously.The closer the parameter is to the accurate value, the smaller is the deviation between the predicted position and the true position, and accurate model parameters can be obtained after multiple iterations of calculations.The position vector of the corners in the world coordinate system is G G G G ( , , ) x y z = X ; after the coordinate change in Section 2, we can obtain the position vector of the corners in the camera coordinate system: ; and, finally, we can obtain the position vector of the corners in the pixel coordinate system: pix ( , v) u = X . Equation (22) can express this process: , , , , , , , , , )   ( , , , , , , , , , , ) (22) We use vision processing to process images to obtain the true position of each corner: . It can be seen from Equation ( 21) that two equations can be established for each corner, and a total of 10 parameters need to be calibrated.Therefore, in theory, only five corners' information is needed to determine the undetermined parameters.The actual calibration process, due to the existence of uncertain factors such as image noise using only five corners for calibration parameters, is inappropriate, and, therefore, the checkerboard pattern used in this article has dozens of corners, establishes an overdetermined equation set, calculates the sum of square errors of the corners according to the calculated value and the true value of the position of corners, and uses it as the evaluation function.As shown in Equation ( 23), we use the genetic algorithm to search for underwater camera parameters that minimize the sum of the squares of all corners' errors.
( ) In the above formula, n represents the number of corners on the checkerboard pattern.
Optimization strategy.Since each picture has six external parameters, if m pictures are passed in, there are a total of 6m external parameters and 4 camera refraction parameters (camera refraction parameters are iteratively optimized in each optimization strategy), and the number of optimized parameters is 6m + 4.There will be too many parameters, and it is easy to encounter local optimization.So here, we use three strategies to carry out, and analyze them.The position vector of the corners in the world coordinate system is X G = (x G , y G , z G ); after the coordinate change in Section 2, we can obtain the position vector of the corners in the camera coordinate system: X cam = (x w , y w , z); and, finally, we can obtain the position vector of the corners in the pixel coordinate system: X pix = (u, v).Equation (22) can express this process: We use vision processing to process images to obtain the true position of each corner: It can be seen from Equation ( 21) that two equations can be established for each corner, and a total of 10 parameters need to be calibrated.Therefore, in theory, only five corners' information is needed to determine the undetermined parameters.The actual calibration process, due to the existence of uncertain factors such as image noise using only five corners for calibration parameters, is inappropriate, and, therefore, the checkerboard pattern used in this article has dozens of corners, establishes an overdetermined equation set, calculates the sum of square errors of the corners according to the calculated value and the true value of the position of corners, and uses it as the evaluation function.As shown in Equation ( 23), we use the genetic algorithm to search for underwater camera parameters that minimize the sum of the squares of all corners' errors.
In the above formula, n represents the number of corners on the checkerboard pattern.Optimization strategy.Since each picture has six external parameters, if m pictures are passed in, there are a total of 6m external parameters and 4 camera refraction parameters (camera refraction parameters are iteratively optimized in each optimization strategy), and the number of optimized parameters is 6m + 4.There will be too many parameters, and it is easy to encounter local optimization.So here, we use three strategies to carry out, and analyze them.

1.
The first strategy remains unchanged.We input ten calibration images into the aforementioned algorithm and optimize 6 × 10 + 4 parameters for each update.

2.
The second strategy takes into account the number of parameters.With each image input, we update 6 + 4 parameters and utilize the converged refraction parameters as the initial values for subsequent image updates.

3.
The third strategy builds upon the second one.Here, we directly utilize Zhang's [17] calibrated external parameters (without considering refraction, treating the image as if it were in the air for calibration) as the initial values for each iteration.Additionally, the external parameter × (1 ± 0.5) serves as the upper and lower boundary values.This approach reduces the number of iterations and enhances local optimization capabilities.

Experimental Data and Equipment
The experimental setup primarily comprises a custom-made underwater monocular camera (resolution: 1080 p, frame rate: 30 fps, interface: RJ45 Ethernet interface, field of view: 70 • ) and power supply, along with a checkerboard pattern (consisting of six rows and nine columns, totaling 54 target corners, with a 25 mm distance between corner points), and a water tank.To ensure the accuracy and reliability of the calibration results, we acquired calibration images from different distances and angles.Initially, without water in the tank, we captured images in the air to calibrate initial intrinsic parameters and distortion parameters.Subsequently, after filling the tank with water, we submerged the camera and checkerboard pattern, capturing underwater calibration images at various poses and distances.
The images captured in the air are shown in Figure 4, while the images captured in the water are shown in Figure 5.In the experiment, we utilized Python3.8.5 to handle the data and employed the OpenCV4.4.0 library for image data processing.
1.The first strategy remains unchanged.We input ten calibration images into the aforementioned algorithm and optimize 6 × 10 + 4 parameters for each update.2. The second strategy takes into account the number of parameters.With each image input, we update 6 + 4 parameters and utilize the converged refraction parameters as the initial values for subsequent image updates.3. The third strategy builds upon the second one.Here, we directly utilize Zhang's [17] calibrated external parameters (without considering refraction, treating the image as if it were in the air for calibration) as the initial values for each iteration.Additionally, the external parameter × (1 ± 0.5) serves as the upper and lower boundary values.This approach reduces the number of iterations and enhances local optimization capabilities.

Experimental Data and Equipment
The experimental setup primarily comprises a custom-made underwater monocular camera (resolution: 1080 p, frame rate: 30 fps, interface: RJ45 Ethernet interface, field of view: 70°) and power supply, along with a checkerboard pattern (consisting of six rows and nine columns, totaling 54 target corners, with a 25 mm distance between corner points), and a water tank.To ensure the accuracy and reliability of the calibration results, we acquired calibration images from different distances and angles.Initially, without water in the tank, we captured images in the air to calibrate initial intrinsic parameters and distortion parameters.Subsequently, after filling the tank with water, we submerged the camera and checkerboard pattern, capturing underwater calibration images at various poses and distances.
The images captured in the air are shown in Figure 4, while the images captured in the water are shown in Figure 5.In the experiment, we utilized Python3.8.5 to handle the data and employed the OpenCV4.4.0 library for image data processing.

Different Optimization Strategies
Firstly, regarding the choice of genetic algorithm, we adopt the elitist-reservation genetic algorithm [28], with the algorithm process shown in Table 2. 1.The first strategy remains unchanged.We input ten calibration images into the aforementioned algorithm and optimize 6 × 10 + 4 parameters for each update.2. The second strategy takes into account the number of parameters.With each image input, we update 6 + 4 parameters and utilize the converged refraction parameters as the initial values for subsequent image updates.3. The third strategy builds upon the second one.Here, we directly utilize Zhang's [17] calibrated external parameters (without considering refraction, treating the image as if it were in the air for calibration) as the initial values for each iteration.Additionally, the external parameter × (1 ± 0.5) serves as the upper and lower boundary values.This approach reduces the number of iterations and enhances local optimization capabilities.

Experimental Data and Equipment
The experimental setup primarily comprises a custom-made underwater monocular camera (resolution: 1080 p, frame rate: 30 fps, interface: RJ45 Ethernet interface, field of view: 70°) and power supply, along with a checkerboard pattern (consisting of six rows and nine columns, totaling 54 target corners, with a 25 mm distance between corner points), and a water tank.To ensure the accuracy and reliability of the calibration results, we acquired calibration images from different distances and angles.Initially, without water in the tank, we captured images in the air to calibrate initial intrinsic parameters and distortion parameters.Subsequently, after filling the tank with water, we submerged the camera and checkerboard pattern, capturing underwater calibration images at various poses and distances.
The images captured in the air are shown in Figure 4, while the images captured in the water are shown in Figure 5.In the experiment, we utilized Python3.8.5 to handle the data and employed the OpenCV4.4.0 library for image data processing.

Different Optimization Strategies
Firstly, regarding the choice of genetic algorithm, we adopt the elitist-reservation genetic algorithm [28], with the algorithm process shown in Table 2.

Different Optimization Strategies
Firstly, regarding the choice of genetic algorithm, we adopt the elitist-reservation genetic algorithm [28], with the algorithm process shown in Table 2.

•
Initialize a population of N individuals using various strategies.

•
Define the maximum number of iterations Tmax and the target value F.

2.
Iteration: • If : the iteration count < Tmax or f(x) ̸ = F Conduct statistical analysis on the current population, recording its best individual, average fitness.Independently select N − 1 parents from the current population.Independently perform crossover operations on these N − 1 parents.Independently perform mutation operations on these N − 1 individuals after crossover.
Calculate the best individual of the current generation population and insert it at the first position among the N − 1 individuals after crossover to obtain the new generation population.
In the experiment, we utilized ten underwater calibration images, as depicted in Figure 1.
The first strategy: We update the ten pictures together and set the upper and lower limits of the angle to [−π, π], the upper and lower limits of the translation to [−500, 500], set the population size to 100, update 2000 times, and obtain the errors.The objective function values of the population and the best individual for Strategy 1 are depicted in Figure 6, the images after reprojection are shown in Figure 7, the errors are illustrated in Figure 8, and the calibration result is shown in Table 3.Based on our analysis, it can be inferred that the algorithm exhibits poor convergenc considerable re-projection errors, and encounters challenges associated with loca optimization.
The second strategy: We pass each picture into the algorithm and pass the converge refraction parameters updated last time into the next image.We set the upper and lowe limits of the angle to [−π, π], the upper and lower limits of the translation to [−500, 500  Based on our analysis, it can be inferred that the algorithm exhibits poor convergence, considerable re-projection errors, and encounters challenges associated with local optimization.
The second strategy: We pass each picture into the algorithm and pass the converged refraction parameters updated last time into the next image.We set the upper and lower limits of the angle to [−π, π], the upper and lower limits of the translation to [−500, 500], set the population size to 100, update 500 times, and obtain the errors.The objective function values of the population and the best individual for Strategy 2 are depicted in Figure 9, which is the result of the last image, the images after reprojection are shown in Figure 10, the errors are illustrated in Figure 11, and the calibration result is shown in Table 4.However, a notable issue arises in this context.For each picture, there are unique refraction parameters.Here we analyze that the upper and lower limits of the external parameters are too large to cause this.The calculated refraction parameters are not applicable to the previous pictures.It can be seen from Figure 11 that the last time the convergence is better, but the previous convergences are poor.The third strategy: First, we directly apply Zhang's calibration [17] to the underwater images to obtain the corresponding external parameters for use in the genetic algorithm.The external parameters are shown in Table 5.However, a notable issue arises in this context.For each picture, there are unique refraction parameters.Here we analyze that the upper and lower limits of the external parameters are too large to cause this.The calculated refraction parameters are not applicable to the previous pictures.It can be seen from Figure 11 that the last time the convergence is better, but the previous convergences are poor.
The third strategy: First, we directly apply Zhang's calibration [17] to the underwater images to obtain the corresponding external parameters for use in the genetic algorithm.The external parameters are shown in Table 5.In order to avoid the "false" phenomenon (The parameters in Strategy 2 only apply to a subset of the images) of external parameters and refraction parameters, we multiply the approximate value of the external parameter obtained above by (1 ± 0.5) as the upper and lower boundary values.We pass each picture into the algorithm and pass the converged refraction parameters updated last time into the next image.We set the population size to 100, update 500 times, and obtain the errors.The objective function values of the population and the best individual for Strategy 3 are depicted in Figure 12, which is the result of the last image, the images after reprojection are shown in Figure 13, the errors are illustrated in Figure 14, and the calibration result is shown in Table 6.
After obtaining the calibration result, we pass the parameters into the model and calculate the error of each corner.Since we set the target value to 0, the iteration did not terminate, but it can be observed that the iteration has converged.The error is very small and performs well in all images.Therefore, we believe that we have obtained the optimal solution.

Comparative Experiment
To validate the effectiveness of our model and algorithm, we conducted comparative experiments.We used ten checkerboard images for camera parameter calibration using Li's [20] method based on equivalent focal length, Bashar's [22] method based on an approximate linear model, and our proposed method.We then used the corresponding parameters for re-projection, and selected average error, root mean squared error (RMSE), and re-projection error as comparison metrics.The errors of the comparative methods are shown in Figure 15 and Table 7.It can be observed that our method performs better: compared with Li's method, our method reduces re-projection error by 24.4%, and, compared with Bashar's method, it reduces it by 40.2%.

Conclusions
This paper proposes a correction algorithm based on the real light path's double refraction model and demonstrates its necessity in underwater camera usage.During the iterations of the genetic algorithm, certain rules are applied to overcome local optima.Experimental results show that our algorithm accurately computes camera parameters, simplifying the imaging calibration process and providing a feasible method for underwater camera calibration.Comparative experiments reveal that our method reduces the re-projection error by 24.4% compared with Li's method [17] and by 40.2% compared with Bashar's method [19].The model reduces errors in underwater measurements, improving measurement accuracy, and enhancing underwater positioning and SLAM.In future work, we will apply this model in real underwater environments and address some of the challenges it brings.Additionally, we will apply the model to underwater target positioning, and we also plan to develop target positioning software with this model and positioning technology.We intend to apply it in the field of underwater detection.

'A
, and the mapping position of A and A ' to the image is the same as shown in Figure2.According to the geometric knowledge, we can find the distance w r from point A to the central optical axis.

Figure 4 .
Figure 4. Images captured in the air (without water, used for obtaining initial parameters).

Figure 5 .
Figure 5. Images captured in the water.

Figure 4 .
Figure 4. Images captured in the air (without water, used for obtaining initial parameters).

Figure 4 .
Figure 4. Images captured in the air (without water, used for obtaining initial parameters).

Figure 5 .
Figure 5. Images captured in the water.

Figure 5 .
Figure 5. Images captured in the water.

Figure 6 .
Figure 6.Population and information for Strategy 1.Figure 6. Population and individual information for Strategy 1.

Figure 6 .
Figure 6.Population and information for Strategy 1.Figure 6. Population and individual information for Strategy 1.

Figure 6 .
Figure 6.Population and individual information for Strategy 1.

Figure 7 .
Figure 7. Re-projection images with the first strategy.

Figure 8 .
Figure 8. Error of each corner with the first strategy (on the left is the error in the X\Y direction, an on the right are the re−projection errors).

Figure 8 .
Figure 8. Error of each corner with the first strategy (on the left is the error in the X\Y direction, and on the right are the re-projection errors).

Figure 9 .
Figure 9. Population and individual information for Strategy 2.

Figure 10 .
Figure 10.Re-projection images with the second strategy.

Figure 9 .
Figure 9. Population and individual information for Strategy 2.

Figure 9 .
Figure 9. Population and individual information for Strategy 2.

Figure 10 .
Figure 10.Re-projection images with the second strategy.Figure 10.Re-projection images with the second strategy.

Figure 10 .
Figure 10.Re-projection images with the second strategy.Figure 10.Re-projection images with the second strategy.

Figure 11 .
Figure 11.Error of each corner with the second strategy (on the left is the error in the X\Y direction, and on the right are the re-projection errors).

Figure 12 .
Figure 12.Population and individual information for Strategy 3.

Figure 13 .
Figure 13.Re-projection images with the third strategy.

Figure 12 .
Figure 12.Population and individual information for Strategy 3.

Figure 12 .
Figure 12.Population and individual information for Strategy 3.

Figure 13 .
Figure 13.Re-projection images with the third strategy.Figure 13.Re-projection images with the third strategy.

Figure 13 .
Figure 13.Re-projection images with the third strategy.Figure 13.Re-projection images with the third strategy.J. Mar.Sci.Eng.2024, 12, x FOR PEER REVIEW 16 of 19

Figure 14 .
Figure 14.Error of each corner with the third strategy (on the left is the error in the X\Y direction, and on the right are the re-projection errors).

Figure 14 .
Figure 14.Error of each corner with the third strategy (on the left is the error in the X\Y direction, and on the right are the re-projection errors).

Table 1 .
Summary table of parameters to be calibrated.represents the rotation angle of the camera coordinate system relative to the world coordinate system; x O , y O , z O represents the position of the camera's optical center in the world coordinate system. ) is the position coordinate of origin O pic in the planar pixel coordinate system of the imaging plane; f x , f y are the horizontal and longitudinal digital focal lengths of the camera.
Distortion Parametersk 1 , k 2 , k 3 is the radial distortion parameter; p 1 , p 2 is the tangential distortion parameter.

Table 2 .
Genetic algorithm flow chart.

Table 3 .
Re-projection errors with the first strategy.

Table 5 .
Approximate value of external parameters.

Table 4 .
Re-projection errors with the second strategy.

Table 5 .
Approximate value of external parameters.

Table 6 .
Re-Projection errors with the third strategy.

Table 7 .
The various errors of different methods.