Next Article in Journal
Finite and Symmetric Euler Sums and Finite and Symmetric (Alternating) Multiple T-Values
Previous Article in Journal
Freeness of Signed Graphic Arrangements
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Method for Solving Ill-Conditioned Nonlinear Least Squares Problems and Its Application in Image Distortion Correction Using Self-Calibration

College of Geodesy and Geomatics, Shandong University of Science and Technology, Qingdao 266590, China
*
Authors to whom correspondence should be addressed.
Axioms 2024, 13(3), 209; https://doi.org/10.3390/axioms13030209
Submission received: 18 February 2024 / Revised: 16 March 2024 / Accepted: 18 March 2024 / Published: 21 March 2024

Abstract

:
In this study, the ill-conditioning of the iterative method for nonlinear models is discussed. Due to the effectiveness of ridge estimation for ill-conditioned problems and the lack of a combination of the H-K formula with the iterative method, the improvement of the LM algorithm is studied in this paper. Considering the LM algorithm for ill-conditioned nonlinear least squares, an improved LM algorithm based on the H-K formula is proposed for image distortion correction using self-calibration. Three finite difference methods are used to approximate the Jacobian matrix, and the H-K formula is used to calculate the damping factor in each iteration. The Brown model, quadratic polynomial model and Fourier model are applied to the self-calibration, and the improved LM algorithm is used to solve the model parameters. In the simulation experiment of space resection of a single image, we evaluate the performance of the LM algorithm based on the gain ratio (LMh) and the improved LM algorithm based on the H-K formula (LMHK), and the accuracy of different models and algorithms is compared. A ridge trace analysis is carried out on the damping factor to illustrate the effects of the improved algorithm in handling ill-conditioning. In the second experiment, the improved algorithm is applied to measure the diameter of a coin using a single camera. The experimental results show that the improved LM algorithm can reach the same or higher accuracy as the LMh algorithm, and it can weaken the ill-conditioning to a certain extent and enhance the stability of the solution. Meanwhile, the applicability of the improved LM algorithm in self-calibration is verified.

1. Introduction

Self-calibration is a type of analytical calibration method that describes the system error of a camera by the distortion models in the adjustment model. The self-calibration method is convenient and flexible, and it is widely used in camera calibration. According to the coordinates of the reference points, the additional parameters in the distortion model are solved to compensate for the influence of system error on the results. In order to improve the accuracy of the self-calibration, the camera parameters and distortion parameters need to be solved accurately [1]. In the field of self-calibration, a lot of research about distortion models has been done. Based on many experiments and analyses, the Brown model was introduced into the analytical calibration method for distortion correction in 1971 [2]. Currently, the Brown model and its improved model are still commonly used in photogrammetry [3]. To address the problem of inconsistency between the optical center and the geometric center of the imaging system, self-calibration based on a simplified Brown model is proposed [4]. David et al. show that the complex distortion model can improve the accuracy of self-calibration by an experiment of three-dimensional reconstruction [5]. Based on the mathematical approximation theory, a distortion model based on the Fourier series was proposed for self-calibration purposes [6] and verified in an experiment of simulated distortion data fitting [7]. The Brown model and Fourier model are applicable in image processing, pattern classification and scene analysis in the field of computer vision. With the development of the self-calibration method, it is worth considering whether the distortion model has a strong correlation or overparameterization, which leads to ill-conditioning. Unreasonable distortion models and parameters are one of the important causes of ill-conditioning. In the self-calibration method, the quality of feature points is another important cause of ill-conditioning. It depends on many factors, including the number, accuracy and distribution of feature points [8]. Insufficient feature extraction will fail to fully reflect the role of each parameter, or unilaterally highlight the roles of some parameters. Furthermore, it is easy to cause ill-conditioning in the solution of parameters. Most of the above research avoids ill-conditioning from the aspect of model selection and feature extraction, but few research studies are carried out from the aspect of parameter iteration. In this work, the method for solving the self-calibration model is studied from the aspect of a numerical iterative method.
The solutions of ill-conditioned equations are very sensitive to small parameter value perturbations, showing poor numerical stability. For ill-conditioned equations, it is difficult to obtain accurate and reliable parameter estimates, which severely affects the accuracy and quality of data processing. For the solution of ill-conditioned problems, a variety of biased estimation methods and improved methods have been proposed to improve the quality of parameter estimates, such as regularization, truncated singular value decomposition and ridge estimation [9,10,11,12,13,14,15,16]. The key to solving ill-conditioned problems by the regularization method is the selection of the stabilization functional and regularization parameter. The stabilization functional is constructed based on prior information of the model parameters, which can effectively improve the structure of the model and make solving it feasible [17]. When prior information cannot be obtained, the stabilization functional is often expressed as a 2-norm constraint on model parameters [18] and then the ridge estimation of the parameters is derived. Ridge estimation is a special form of regularization that regards the identity matrix as a regularization matrix and then improves the reliability and stability of parameter estimation by reasonably selecting the regularization parameter. In ridge estimation, the regularization parameter is also called the ridge parameter. The common methods to determine the ridge parameters are the ridge trace method and Hoerl–Kennard (H-K) formula. After determining the appropriate ridge parameters, ridge estimation can effectively reduce the mean square error by properly modifying the ill-conditioned matrix [18]. The adjustment criterion of the ill-conditioned uncertainty model based on ridge estimation can effectively suppress the influence of ill-conditioning [19]. The common strategy for solving nonlinear parameters is to linearize the nonlinear model and solve it by an iterative method, and the Levenberg–Marquardt (LM) algorithm [20,21] is commonly used. An LM algorithm based on the gain ratio [22] can weaken the ill-conditioning by determining a damping factor, and it has been widely used in nonlinear optimization [23]. However, there are some problems in the existing research: on the one hand, the damping factor determined by this algorithm is usually large, which greatly changes the structure of the Jacobian matrix; on the other hand, although ridge estimation can effectively improve the stability of the solution, there are few research studies on the combination of ridge estimation and the LM algorithm. In response to the shortcomings of the above research work, the combination of the method for determining the ridge parameters and the LM algorithm is studied in this paper.
In this work, with the LM algorithm steps as the basic framework, an improved LM algorithm is proposed. Firstly, the ill-conditioning of the iterative method for nonlinear models is discussed. Then, according to the parameter estimation criterion of the LM algorithm, the H-K formula is combined with the LM algorithm to calculate the damping factor in each iteration. Finite difference methods are used to approximate the Jacobian matrix, and finally, we present the algorithm steps of the improved LM algorithm based on the H-K formula and finite difference. The Brown model, quadratic polynomial model and Fourier model are discussed. In the numerical experiments, the three distortion models are applied to self-calibration, and the improved LM algorithm is used to solve the model parameters. In the simulation experiment of space resection of a single image, the accuracy and performance of different models and algorithms on the solution of parameters are evaluated, and a ridge trace analysis is carried out on the damping factor to illustrate the effects of the improved algorithm in handling ill-conditioning. The applicability of the improved algorithm in practical problems is verified by the measurement of a coin diameter using a single camera. The experimental results show that the improved LM algorithm can reach the same or higher accuracy as the LM algorithm based on the gain ratio, and it can weaken the ill-conditioning to a certain extent and enhance the stability of the solution under the condition of changing the matrix structure as little as possible. The improved LM algorithm proposed in this paper provides a new method for solving self-calibration model parameters, and it also provides a new idea for solving ill-conditioned nonlinear least squares.

2. Iterative Method for Ill-Conditioned Nonlinear Least Squares Problems

2.1. Ill-Conditioned Problems in the Iterative Method

For a nonlinear model, the Taylor formula is usually used to transform it into a linear form, and then the iterative method is used to solve it. We consider a nonlinear model F x = F 1 , F 2 , , F m T , x = x 1 , x 2 , , x n T , expand it by the Taylor formula and take only the first-order term:
F 1 F 2 F m F 1 0 F 2 0 F m 0 + F 1 x 1 x 1 0 F 1 x 2 x 2 0 F 1 x n x n 0 F 2 x 1 x 1 0 F 2 x 2 x 2 0 F 2 x n x n 0 F m x 1 x 1 0 F m x 2 x 2 0 F m x n x n 0 x 1 x 1 0 x 2 x 2 0 x n x n 0 F ( x ) F 0 + B x ^
where B is the Jacobian matrix consisting of the first-order partial derivatives of F x at x 0 . We rewrite it as an error equation, V = F x L B x ^ L F 0 . Under the condition of equal-precision independent observation, the iterative formula of the Gauss–Newton method can be obtained according to the least squares criterion:
x k + 1 = x k + B k T B k 1 B k T L F k 0
where k is the number of iterations, B = B 1 , , B n is a matrix of order m × n and its rank is r . In practical problems, usually m > n , and r B T B n < m can be obtained according to the properties of matrix rank. If B is rank-deficient, so is B T B . If it is of full rank but strong multicollinearity exists in its columns:
ω 1 B 1 + ω 2 B 2 + + ω n B n 0
where ω = ω 1 , ω 2 , , ω n T is the set of eigenvectors corresponding to the eigenvalues of B T B . The Jacobian matrix is ill-conditioned at this moment. Rank deficiency or ill-conditioning of the matrix occurs easily when the Gauss–Newton method is used.

2.2. LM Method Based on Hoerl–Kennard Formula and Finite Differences

According to the analysis in the previous section, rank deficiency or ill-conditioning occurs easily when the Gauss–Newton method is used, resulting in no unique or stable solution in the normal equation. Therefore, to avoid the ill-posedness of the normal equation, it is necessary to impose new constraints on the parameters. L2 regularization, namely, ridge regression, is commonly used. When L2 regularization is introduced, the parameter estimation criterion and its estimation formula are
min   V T V + μ x ^ T x ^ x k + 1 = x k + B k T B k + μ k I 1 B k T L F k 0
The iterative formula for the LM method is presented as Formula (4). This is an improved algorithm based on the Gauss–Newton method, and it is also an iterative method without a specific line search for calculating the step size, which is determined by the damping factor μ [22]. The initial value of the damping factor can be set to μ = τ max B i i . B i i denotes the diagonal elements of B T B , and τ is usually a small value. If the selected initial values of the parameters are believed to be good approximations to the estimated values, it can be set to τ = 10 6 ; otherwise, it can be set to τ = 10 3 or τ = 1 . Then, the damping factor is increased or decreased according to the gain ratio ( h ) in the iteration. The algorithm steps are as follows:
Step 1: Given the initial parameter value x k , the Jacobian matrix and initial value of the damping factor are calculated, and the convergence criteria are set: the threshold ε 1 of the gradient g , the threshold ε 2 of the error difference and the maximum number of iterations k max , along with k = 0 and υ = 2 , are set.
Step 2: B k and g k = B k T L F k 0 are calculated.
Step 3: The equation B k T B k + μ k I x ^ k = g k is solved; then, the (k + 1)th iterative estimate is obtained: x k + 1 = x k + x ^ k .
Step 4: If g k 2 ε 1 , V k + 1 V k 2 ε 2 , then x k + 1 is the optimal parameter estimate, and the iteration is terminated; otherwise, h is calculated:
h = V k 2   V k + 1 2   1 2 x ^ k T μ k x ^ k   g k
Step 5: If h > 0 , then μ k + 1 = μ k max 1 3 , 1 2 h 1 3 and υ = 2 ; otherwise, μ k + 1 = μ k υ and υ = 2 υ . We set k = k + 1 and return to Step 2.
The LM algorithm introduces the damping factor and identity matrix based on the Gauss–Newton method, which effectively resolves the rank deficiency of B T B and avoids the ill-conditioning caused by multicollinearity. When the Jacobian matrix is ill-conditioned, there is at least one eigenvalue close to 0 in B T B , while the degree of the eigenvalue close to 0 in B T B + μ I will be improved, which will weaken the ill-conditioning. In the LM algorithm, the Jacobian matrix determines the descent direction of the function, and the damping factor affects both the direction and step size. Therefore, the key to solving the nonlinear model by the LM algorithm is to calculate the damping factor and the Jacobian matrix. Formula (4) shows that the calculation method of x ^ in the iterative formula can be regarded as a ridge estimation derived from the regularization principle. Therefore, different from the above method based on the gain ratio, the damping factor can be determined by the method of selecting the ridge parameter.

2.2.1. Methods for Selecting the Ridge Parameter

The damping factor is a number greater than 0, and different values lead to different ridge estimates. When μ , x ^ 0 , and the solution is not relevant. Therefore, the value should be chosen to be as small as possible to solve the ill-posed problem using the proximal well-posed problem. The main methods of selecting the ridge parameter are ridge trace and the Hoerl–Kennard formula.
(1)
Ridge trace: Each component x ^ i i = 1 , 2 , of the correction value of x is regarded as a function of the damping factor. When the damping factor changes between 0 , , several curves can be drawn in the rectangular coordinate system o μ x ^ , which are called ridge trace curves, as shown in Figure 1. With the increase in the ridge parameter, the model parameter estimates gradually stabilize and reach a stable state around μ . The ridge trace method selects the smallest μ that makes the change stable. To determine the appropriate value according to the ridge trace curves, the following three criteria must be generally satisfied: first, the ridge estimates of model parameters in the equation are roughly stable; second, the ridge estimation can make the parameter values reasonable; and third, the sum of the squared residuals does not increase substantially. The main disadvantage of this method is the lack of a strict theoretical basis. Determining the value of the damping factor using ridge trace curves is subjective, but this subjectivity can also organically combine qualitative analysis with quantitative analysis. However, the numbers of iterations may be large. If the ridge parameter in each iteration is selected by the ridge trace curves, the workload may be large. Therefore, this method is mainly used for ridge trace analysis rather than directly determining the ridge parameter in the iteration.
(2)
Hoerl–Kennard (H-K) formula: The H-K formula is a common method for determining the ridge parameter according to the canonical form of the error equation. In order to analyze the problem, the canonical form of the error equation is introduced. Considering the symmetry of matrix B T B , the Formula (5) can be obtained according to matrix theory
Ω T B T B Ω = Λ
where Ω is an orthogonal matrix; Λ is diagonal matrix and the diagonal element is the eigenvalue of B T B . Formula (6) can be obtained by identity transformation of the original error equation
V = B Ω Ω T x ^ L F 0
Denote C = B Ω , Y = Ω T x ^ , then
V = C Y L F 0
Formula (7) is the canonical form of the error equation; Y is the canonical parameter, and its estimation is
Y ^ = C T C 1 C T L F 0 = Λ 1 C T L F 0   
According to x ^ = Ω Y , the parameter estimation of the original error equation can be obtained. In canonical form, the mean square error (MSE) of the canonical parameter is
M S E Y = E Y ^ Y 2          = E C T C 1 C T V 2         = E V T C Λ 2 C T V
Hoerl and Kennard proposed the H-K formula [14] based on the canonical form of the error equation. ω 1 , , ω n are assumed to be the eigenvectors corresponding to the eigenvalues λ 1 , , λ n of B T B :
Ω = ω 1 , , ω n , Λ = diag λ 1 , , λ n
Then μ is calculated by the H-K formula
μ = σ ^ 2 max   e ^ i 2
where σ ^ 2 = V T V m n and e ^ = Λ 1 Ω B T L F = e ^ 1 , , e ^ n T . Then
x ^ = B T B + μ I 1 B T L F   0
The mean square error of parameter estimation is
M S E x ^ = σ 2 i = 1 r λ i λ i + μ 2 + μ 2 i = 1 r x i 2 λ i + μ 2
It can be seen that, when μ is large, although this estimation method can overcome the multicollinearity, it will also introduce more bias. The determination of μ according to the H-K formula is related to the eigenvalues. An ill-conditioned matrix contains very small eigenvalues, so a smaller value can be obtained according to the H-K formula, so that the parameter estimation can be stable as soon as possible with less bias.

2.2.2. Finite Difference Form of the Jacobian Matrix

The Jacobian matrix can be calculated according to the differentiation rule of functions of several variables, as expressed in Formula (1). However, in practical problems, due to the large number of observation equations and the associated large-scale matrices, this method may require a huge amount of calculation. In a common numerical method, the finite difference approximates the differential of the function by the corresponding function value after parameter discretization. This method of approximating the derivative by the difference quotient can effectively reduce the calculational burden. In this paper, the forward difference method (FDM), backwards difference method (BDM) and central difference method (CDM) are adopted to approximate the Jacobian matrix. According to the definition of forward difference, Δ F i = F i x j + δ F i x j , and δ is the difference step. F i x j + δ is expanded by the Taylor formula, and only the first-order term is considered:
F i x j + δ F i x j + F i x j x j + δ x j F i x j F i x j + δ F i x j δ
Similarly, the backwards difference and central difference are
F i x j F i x j F i x j δ δ F i x j F i x j + δ F i x j δ 2 δ
Compared with the forward difference and backwards difference, the accuracy of approximating the Jacobian matrix by the central difference is higher, and the calculational burden is multiple times larger.
The steps of the improved LM algorithm based on the H-K formula and finite differences are as follows:
Step 1: Given an initial parameter value x k , set convergence criteria: the threshold ε 1 of gradient g , the threshold ε 2 of the error difference and the maximum number of iterations k max , along with k = 0 , are set.
Step 2: Given the difference step, F i x j i = 1 , , m , j = 1 , , n is calculated by the finite difference method, the matrix B k is obtained, and g k = B k T L F k 0 is calculated; then, the damping factor is determined by the H-K formula μ k = σ ^ 2 max   e ^ i 2 .
Step 3: The equation B k T B k + μ k I x ^ k = g k is solved, and the (k + 1)th parameter estimate x k + 1 = x k + x ^ k is obtained.
Step 4: If g k 2 ε 1 , V k + 1 V k 2 ε 2 , then x k + 1 is the optimal parameter estimate, and the iteration is terminated; otherwise, we set k = k + 1 and return to Step 2.

2.3. Distortion Models

In photogrammetry, since the beam of the imaging system within the field of view does not strictly meet the ideal center projection, the actual image points produce a position error, which is called distortion. Considering the distortion of image points, the actual image coordinates can be regarded as the sum of the ideal image coordinates and distortion, which is expressed by a collinearity equation with additional parameters:
u = f R 11 X     X S   +   R 21 Y     Y S   +   R 31 Z     Z S R 13 X     X S   +   R 23 Y     Y S   +   R 33 Z     Z S   +   u 0   +   Δ u v = f R 12 X     X S   +   R 22 Y     Y S   +   R 32 Z     Z S R 13 X     X S   +   R 23 Y     Y S   +   R 33 Z     Z S   +   v 0   +   Δ v
where u , v are the actual image coordinates, X , Y , Z are the corresponding ground control point coordinates, u 0 , v 0 , f are the elements of interior orientation, X S , Y S , Z S are the translation elements of exterior orientation, R i j i , j = 1 , 2 , 3 are the direction cosine composed of the angle elements of exterior orientation φ 1 , φ 2 , φ 3 and Δ u , Δ v are the distortions, which are generally functions of the image coordinates. Formula (16) is also called a self-calibration model. Distortion models mainly include physical models and mathematical models. The Brown model, polynomial model and Fourier model are mainly described in this paper.

2.3.1. Brown Model

The Brown model is a commonly used physical model, which was originally designed for large-area film cameras. Various forms of distortion that occur in camera imaging are considered. In practical applications, the parameters of the Brown model need to be selected according to the camera imaging characteristics. With the application of a digital camera in aerial photography, the model has been simplified into radial distortion and decentering distortion. The Brown model is expressed as
Δ u Radial = u ¯ K 1 s 2 + K 2 s 4 + K 3 s 6 Δ v Radial = v ¯ K 1 s 2 + K 2 s 4 + K 3 s 6 Δ u Decentring = 2 P 1 u ¯ v ¯ + P 2 r 2 + u ¯ 2 Δ v Decentring = 2 P 2 u ¯ v ¯ + P 1 r 2 + v ¯ 2
where s = u ¯ 2 + v ¯ 2 , and K i i = 1 , 2 , 3 and P i i = 1 , 2 are radial distortion parameters and decentering distortion parameters. The distortion of the image edges can be described only by the radial distortion and decentering distortion when using a digital camera. In practical applications, radial distortion usually remains K 1 , K 2 .

2.3.2. Polynomial Model and Fourier Model

In addition to the physical model, the distortion model can also be established from the mathematical point of view (in this section, a is used to represent the distortion coefficient of different mathematical models). The orthogonal polynomial in the mathematical model can effectively reduce the correlation between parameters and improve the stability of the solution. The polynomial model is a commonly used distortion correction model, which is expressed mathematically as
Δ u = i = 0 t j = 0 t i a i j u ¯ i v ¯ j Δ v = i = 0 t j = 0 t i a i j u ¯ i v ¯ j
where t is the order of the polynomial and a i j are the parameters to be determined. However, a higher-order polynomial is also prone to overparameterization, which will not only increase the calculational work required to obtain the numerical solution but also lead to the instability of the solution. Therefore, the order should not be too high in practical applications. The quadratic polynomial (QP) model is often selected as a distortion model. Considering the correlation of the coefficients in u and v , the quadratic orthogonal polynomial model is
Δ u QP = a 10 u ¯ + a 01 v ¯ a 20 u ¯ 2 + a 11 u ¯ v ¯ + a 02 v ¯ 2 Δ v QP = a 01 v ¯ + a 10 u ¯ + a 11 u ¯ v ¯ a 02 v ¯ 2 + a 20 u ¯ 2
According to the Weierstrass second approximation theory, a binary Fourier series orthogonal polynomial model represented by the image coordinates can be obtained [6]:
Δ u = a 1 COS 1 , 0 + a 2 COS 0 , 1 + a 3 COS 1 , 1 + a 4 COS 1 , 1 + a 5 SIN 1 , 0 + a 6 SIN 0 , 1 + a 7 SIN 1 , 1 + a 8 SIN 1 , 1 Δ v = a 9 COS 1 , 0 + a 10 COS 0 , 1 + a 11 COS 1 , 1 + a 12 COS 1 , 1 + a 13 SIN 1 , 0 + a 14 SIN 0 , 1 + a 15 SIN 1 , 1 + a 16 SIN 1 , 1
where a i are the parameters to be determined and COS i , j = cos i u ¯ + j v ¯ , SIN i , j = sin i u ¯ + j v ¯ , u ¯ = u width / 2 width π , v ¯ = v height / 2 height π (width and height are the image width and height).

3. Numerical Experiments and Analysis

The first experiment involves a simulation experiment of the space resection of a single image based on the collinearity equation with additional parameters, and the second involves measuring the diameters of coins using a single camera. The improved LM algorithm is used in the numerical experiments, and the convergence conditions are set as follows:
g k 2 10 5 V k + 1 V k 2 10 5 k max = 50
The Jacobian matrix in each iteration is approximated by the finite difference methods introduced in Section 2. The H-K formula is used to calculate the damping factor, which is compared with the method according to the gain ratio. The experimental environment is MATLAB R2021a running on a 1.80 GHz PC with Windows 7.

3.1. Space Resection of a Single Image Based on the Collinearity Equation with Additional Parameters

In this experiment, the image points in a single aerial image are simulated for space resection. It is assumed that the local coordinate system is a North-East-Down (NED) coordinate system, the flight altitude is 50 m, the design focal length of the camera is 9 mm, the pixel size is 2.4   μ m / px and the image width and height are 5472 pixels and 3648 pixels. At the moment of exposure, the focal length is 8.9 mm, the coordinates of the principal points are u 0 = 2737.2   px ,   v 0 = 1827.4   px and the elements of exterior orientation are X S = 5   m ,   Y S = 10   m ,   Z S = 51   m ,   φ 1 = 0 ° ,   φ 2 = 1 ° ,   φ 3 = 2 ° . This experiment is carried out according to the following steps:
Step 1: Simulate the data. The values of X and Y of the ground points are centered on the plane coordinates of the camera station, which are uniformly distributed in the range of X S 10 , X S + 10 and Y S 10 , Y S + 10 . And the values of Z are in the range of [−1, 1] since the origin of the NED coordinate system is set on the ground. A total of 120 image coordinates, and the corresponding ground point coordinates, are simulated, and Gaussian noises are added to the image coordinates as observations.
Step 2: Select the distortion models. The Brown model, quadratic polynomial (QP) model and Fourier model are regarded as distortion models, which are added to the collinearity equation to form the self-calibration models.
Step 3: Initialization. The initial values of the angle elements of the exterior orientation are set to φ 1 = φ 2 = φ 3 = 0 ° , the initial value of Z S is Z S 0 = 50   m and the initial values of X S and Y S are calculated according to the following formula
X S 0 = i = 1 m X i m , Y S 0 = i = 1 m Y i m
where m is the number of ground points. The initial values of the elements of the interior orientation are u 0 0 = width / 2 , v 0 0 = height / 2 , f 0 = 9 mm , and the initial values of the additional parameters are set to 0. The normalized image coordinates are substituted into the self-calibration models composed of the three distortion models.
Step 4: Solve the parameters. The LM algorithm based on the forward difference, backwards difference and central difference methods with the gain ratio and the H-K formula (LMFDM+h, LMBDM+h, LMCDM+h, LMFDM+HK, LMBDM+HK and LMCDM+HK) are used to solve the parameters. The elements of the interior orientation, and additional parameters, are determined while solving for the elements of the exterior orientation.
The experiment evaluates the performance of the algorithms from the following aspects: the accuracy is compared using the sum of squared residuals (SSR), the maximum residuals of the image points, the reprojection errors (REs) and the true errors of the parameters; the efficiency is compared using the number of iterations and the running time; the influence on the ill-conditioning is compared using the condition number; the stability of the solution is analyzed using the ridge trace curve. Table 1 presents the SSR and the maximum residuals of each algorithm at the optimal solution. It can be seen from Table 1 that, for the same algorithm, the fitting accuracy of different models for image coordinate observations is high, and the SSR of the Fourier model is generally the smallest, reaching an accuracy of 10 6 . Because the three difference methods are consistent in the approximation of the Jacobian matrix, the difference between the results obtained by the three difference methods is small. In contrast, the performance of the LM algorithm based on CDM is better. For the maximum residuals obtained by the LM algorithm based on the gain ratio (LMh) and the improved LM algorithm based on the H-K formula (LMHK), there is no significant law, which means that the LMHK algorithm has a poor fitting effect on image points with a large error. However, the SSR corresponding to the LMHK algorithm is generally smaller, reaching an accuracy of 10 6 , indicating that the LMHK algorithm has a higher fitting accuracy for the observations. According to the introduction of the H-K formula in Section 2, the H-K formula can determine a small damping factor and less bias is introduced, so that the solution of the parameters can reach a higher accuracy. This is proved by the comparison results of the LMh algorithm and LMHK algorithm. Through the above analysis, another discovery obtained from the table is explained: for the same model, the LMCDM+HK algorithm can reach the same or higher accuracy as other algorithms.
The LM algorithm based on CDM shows a better performance in Table 1. Therefore, in order to show the accuracy of the improved LM algorithm more clearly and intuitively, Figure 2 and Table 2 present the distribution and the root mean square error (RMSE) of reprojection errors (REs) obtained by the LMCDM+h and LMCDM+HK corresponding to each model. In Figure 2, the dotted line indicates the position where the RE is 1 pixel. It can be seen from Figure 2 that the maximum of the REs for all methods is less than 2 pixels. For the same model, the number of image points with an RE greater than 1 pixel in the results of the LMCDM+HK algorithm is generally less than that of the LMCDM+h algorithm, and a consistent conclusion can be obtained from Table 2: the RMSE corresponding to the LMCDM+HK algorithm is the same as or smaller than that of the LMCDM+h algorithm, which indicates that the LMCDM+HK algorithm can reach the same or higher accuracy as the LMCDM+h algorithm. For the same algorithm, the RMSE of the Brown model is the closest to 1 pixel, which is the worst accuracy of all the methods. The Brown model considers radial distortion and decentering distortion without considering other forms of distortion. The QP model and Fourier model, established from the perspective of function approximation, can accurately fit the unknown distortion in the image. The accuracy of the Fourier model solved by the LMCDM+HK algorithm is less than 0.8 pixels, which is the highest accuracy of all methods. Table 3 presents the true errors of the parameters. It can be seen from Table 3 that the parameter estimates of LMCDM+h and LMCDM+HK have an equivalent accuracy. From the true error of the exterior orientation elements, it can be found that, compared with the LMCDM+h, the true error obtained by the LMCDM+HK is generally smaller and the result is closer to the true value.
Figure 3 shows the iterative changes in the SSR for different models solved by LMCDM+h and LMCDM+HK. In order to clearly show the difference, the first iteration has been removed. Table 4 presents the number of iterations and the running time of each algorithm and model. According to Table 4, the number of iterations and the running time of the LMHK algorithm are generally less than those of the LMh algorithm, indicating that a high fitting accuracy can be obtained by the improved algorithm, with a higher iterative efficiency. According to the running time, compared with the LMCDM+h algorithm, the efficiency of the LMCDM+HK algorithm is improved by 64%, 55% and 33% corresponding to the three models. The algorithms using CDM to approximate the Jacobian matrix require more time, which is consistent with the principle of central difference. Compared with FDM and BDM, CDM needs to calculate one more approximate partial derivative of each variable in the iteration within the difference step range, and the calculational burden is the largest. As shown in Figure 3, the LMCDM+h algorithm makes the SSR of the Brown model reach a stable state after five iterations, which indicates that the descending speed is slower. However, the LMCDM+HK algorithm makes the SSR of all models stable after three iterations.
To further analyze the performance of the improved LM algorithm based on the H-K formula, a ridge trace analysis of the different methods is carried out. Figure 4 shows the ridge trace curves of x ^ changing with the damping factor at the optimal solution. Table 5 shows the condition number (C/C0) of the normal matrix with or without the damping factor. It can be seen from Table 5 that both the LMCDM+h algorithm and the LMCDM+HK algorithm can reduce the condition number of the matrix and weaken the ill-conditioning, and the effect of the LMCDM+h algorithm is more significant. Especially for the Brown model and the QP model, the condition number is reduced to 26.823 and 32.576, which can be considered to mean that the matrix is well-posed. However, it can be seen from Figure 4 that the order of magnitude of the damping factor for the Brown model, QP model and Fourier model should be 10 9 , 10 14 and 10 11 . According to the selection principle of the damping factor and Table 5, the actual value determined by the LMCDM+h algorithm is generally too large, while the values of damping factor determined by the LMCDM+HK algorithm are relatively consistent with the trend of the ridge trace curves, which is closer to the result of the ridge trace analysis. Therefore, it is found that the LMCDM+h algorithm weakens the ill-conditioning of the normal matrix more significantly, since this algorithm changes the structure of the normal matrix by selecting a larger damping factor. Upon the premise of changing the structure of the normal matrix as little as possible, the LMCDM+HK algorithm can weaken the ill-conditioning to a certain extent and make the solution stable by selecting a smaller damping factor.

3.2. Measurement of a Coin Diameter Using a Single Camera

Experiment 3.1 shows that the LM algorithm based on CDM presents a better performance in solving the self-calibration model. Therefore, LMCDM+h and LMCDM+HK are used to measure the diameters of coins using a single camera in this experiment. Nine images of a calibration pattern are taken from different angles to calibrate the camera by Zhang’s calibration method. Taking the calibration result as the initial value and using the detected point of the last image, LMCDM+h and LMCDM+HK are combined with the Brown model, QP model and Fourier model to estimate the model parameters and then measure the diameters of the coins. The detected points and the coins are shown in Figure 5. The SSR and the maximum residuals in pixels of each algorithm and model are shown in Table 6.
It can be seen from Table 6 that the accuracy of all the models and algorithms is high, since good initial values are obtained. The SSR and maximum residuals of the LMCDM+h algorithm and LMCDM+HK algorithm are consistent, which indicates that the fitting accuracy is equivalent. The orders of magnitude of SSR and the maximum for the Brown model are 10 3 and 10 2 . For the same algorithm, the accuracy of the Brown model is lower, while the accuracy of the QP model and Fourier model are higher, which indicates that the image has other forms of distortion except radial distortion and decentering distortion, and the mathematical model can compensate for these distortions more effectively. Table 7 presents the number of iterations and running time. It can be seen from Table 7 that the LMCDM+HK algorithm has a higher iteration efficiency than LMCDM+h. This is consistent with the conclusion in Section 3.1. According to the running time, the efficiency of the LMCDM+h algorithm is improved by 12%, 28% and 30% corresponding to the three models. For the same algorithm, the QP model and Fourier model need fewer iterations, while the Brown model requires more iterations. However, the running time of the Brown model is the least, since the model has the least number of distortion parameters.
To measure the coins, the top-left and top-right corners of the bounding box are converted into world coordinates. Then the Euclidean distance between them is calculated in millimeters. The actual diameter is 19.05 mm. The diameters of the coins calculated by different methods are shown in Table 8. It can be seen from Table 8 that the numerical results calculated by the different methods are consistent. The measurements of the first coin and the second coin are accurate to within 0.004 mm and 0.164 mm. All the methods have a sufficiently high accuracy.

4. Discussion

In this work, we study the combination of the H-K formula and the LM algorithm, and an analysis of the LM algorithm and its improvement are carried out in the numerical experiment. Consistent with the previous study [20,21,22,23], it is found that the LM algorithm based on the gain ratio (LMh) is effective in handling nonlinear least squares problems, and it can weaken the ill-conditioning of the Jacobian matrix by determining the damping factor. However, from the perspective of ridge estimation, the damping factor determined by this algorithm is generally too large, and it greatly changes the structure of the matrix. In the existing literature about the methods for solving ill-conditioning [9,10,11,12,13,14,15,16,17,18,19], there is no research on the combination of the H-K formula and the LM algorithm. Therefore, an improved LM algorithm based on the H-K formula (LMHK) is proposed and used to solve the self-calibration model composed of the Brown model, QP model and Fourier model.
From the numerical experiment and analysis, it is found that, compared with the LMh algorithm, the LMHK algorithm can reach the same or higher accuracy, and it makes the SSR stable after fewer calculations (three iterations) in the simulation experiment, indicating that a high fitting accuracy can be reached by the improved algorithm with a higher iterative efficiency. In the ridge trace analysis, it is found that the damping factor determined by the improved LM algorithms is smaller, and it is consistent with the trend of the ridge trace curves, which means that this algorithm can weaken the ill-conditioning to a certain extent and make the solution stable by selecting a smaller damping factor and changing the structure of the Jacobian matrix as little as possible.
From the aspect of the distortion model, we consider the fitting effects of the Brown model, QP model and Fourier model on image distortion. In this paper, the study of the Brown model is different from the previous study [2,4]. In the simulation experiment, the specific distortion form is uncertain. Under this condition, the fitting effect of the Brown model on distortion is studied. It is found that if there are unknown distortions in the image, the mathematical model, such as the QP model and Fourier model, can effectively compensate for these distortions. For the same algorithm, the fitting accuracy of the Fourier models for image point observations is higher, which is consistent with the previous study [7].
Although the study reveals the above discoveries, there are also limitations in this paper. In this paper, the LM algorithm is improved from the perspective of ridge estimation. However, in addition to the ridge trace method and H-K formula, the method for determining the ridge parameters also includes the minimum mean square error and cross validation, which are not considered. Therefore, an important future direction for improving the LM algorithm is a combination of the calculation of the damping factor and other methods for determining the ridge parameter.

5. Conclusions

Ill-conditioning generally exists in nonlinear least squares problems. An LM algorithm based on the gain ratio is the commonly used method, and it is discussed in this paper. This algorithm linearizes the nonlinear model and weakens the ill-conditioning of the Jacobian matrix by determining a damping factor. However, the damping factor determined by this algorithm is usually large, which greatly changes the structure of the matrix. Since the H-K formula can weaken the ill-conditioning by determining a smaller damping factor, an improved LM algorithm based on the H-K formula is proposed for solving nonlinear least squares problems. From the perspective of the ridge estimation of nonlinear parameters, the damping factor is calculated by the H-K formula. For the ill-conditioned problem in image distortion, the Brown model, quadratic polynomial model and Fourier model are discussed for the space resection of a single image. The improved LM algorithm based on the H-K formula is used to solve the self-calibration model, and it is applied to measure the diameter of coins using a single camera. The applicability of the improved LM algorithm in self-calibration is verified. Through numerical experiments, it is found that the improved LM algorithm can stabilize the parameter values under the condition of changing the matrix structure as little as possible, and it can reach the same or a higher accuracy than the LM algorithm based on the gain ratio. The improved LM algorithm based on the H-K formula provides a new method for solving the self-calibration model, and it also provides a new idea for solving ill-conditioned nonlinear least squares.

Author Contributions

Methodology, L.W.; software, L.W.; writing—original draft, L.W.; writing—review and editing, G.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (Grant no. 42074009) and the Natural Science Foundation of Shandong Province (No. ZR2020MD043).

Data Availability Statement

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

References

  1. Huang, W.; Jiang, S.; Liu, X.Z.; Jiang, W. GNSS Constrained Self-Calibration for Long Corridor UAV Image. Geomat. Inf. Sci. Wuhan Univ. 2024, 49, 197–207. [Google Scholar] [CrossRef]
  2. Brown, D.C. Close-range camera calibration. Photogramm. Eng. 1971, 37, 855–866. [Google Scholar] [CrossRef]
  3. Sun, P. Research on Key Techniques of Large Scale Dynamic Photogrammetry; Beijing University of Posts and Telecommunications: Beijing, China, 2019. [Google Scholar]
  4. Gao, Z.Y.; Gu, Y.Y.; Liu, Y.H.; Xu, Z.B.; Wu, Q.W. Self-calibration based on Simplified Brown Nonlinear Camera Model and Modified BFGS Algorithm. Opt. Precison Eng. 2017, 25, 2532–2540. [Google Scholar] [CrossRef]
  5. David, G.; Helene, B. Comparison of pre- and self-calibrated camera calibration models for UAS-derived nadir imagery for a SfM application. Prog. Phys. Geogr. Earth Environ. 2018, 43, 215–235. [Google Scholar] [CrossRef]
  6. Tang, R.; Fritsch, D.; Cramer, M. New Rigorous and Flexible Fourier Self-calibration Models for Airborne Camera Calibration. ISPRS J. Photogramm. Remote Sens. 2012, 71, 76–85. [Google Scholar] [CrossRef]
  7. Sun, J.M.; Yu, J.P.; Li, J.M.; Man, Y.Y.; Shen, G. Performance Analysis of a Generic Photogrammetric Distortion Model. Spacecr. Recovery Remote Sens. 2020, 41, 110–117. [Google Scholar]
  8. Bian, Y.; Wang, M.; Chu, Y.; Liu, Z.; Chen, J.; Xia, Z.; Fang, S. A Cost Function for the Uncertainty of Matching Point Distribution on Image Registration. Int. J. Geo-Inf. 2021, 10, 438. [Google Scholar] [CrossRef]
  9. Tikhonov, A.N.; Arsenin, V.Y. Solutions of Ill-Posed Problems; John Wiley & Sons: New York, NY, USA, 1977. [Google Scholar] [CrossRef]
  10. Hansen, P.C. The Truncated SVD as a Method for Regularization. BIT Numer. Math. 1987, 27, 534–553. [Google Scholar] [CrossRef]
  11. Park, Y.; Reichel, L.; Rodriguez, G. Parameter determination for Tikhonov regularization problems in general form. J. Comput. Appl. Math 2018, 343, 12–25. [Google Scholar] [CrossRef]
  12. Aravkin, A.Y.; Drusvyatskiy, D.; van Leeuwen, T. Efficient quadratic penalization through the partial minimization technique. IEEE Trans. Autom. Control. 2018, 63, 2131–2138. [Google Scholar] [CrossRef]
  13. Guo, H.; Liu, G.; Wang, L. An Improved Tikhonov-Regularized Variable Projection Algorithm for Separable Nonlinear Least Squares. Axioms 2021, 10, 196. [Google Scholar] [CrossRef]
  14. Hoerl, A.E.; Kennard, R.W. Ridge Regression: Applications to Nonorthogonal Problems. Technometrics 1970, 12, 69–82. [Google Scholar] [CrossRef]
  15. Li, B.F.; Shen, Y.Z.; Feng, Y.M. Fast GNSS Ambiguity Resolution as an Ill-posed Problem. J. Geod. 2010, 84, 683–698. [Google Scholar] [CrossRef]
  16. Lin, D.F.; Yao, Y.B.; Zheng, D.Y.; Li, C.K. Determination of Truncation Parameter based on the Differences of TSVD Parameter Estimates for Ill-posed Problems in Geodesy. Acta Geod. Cartogr. Sin. 2022, 51, 1787–1796. [Google Scholar]
  17. Xu, X.Y.; Li, J.C.; Wang, Z.T.; Zou, X.C. The Simulation Research on the Tikhonov Regularization Applied in Gravity Field Determination of GOCE Satellite Mission. Acta Geod. Cartogr. Sin. 2010, 39, 465–470. [Google Scholar] [CrossRef]
  18. Lin, D.F.; Zhu, J.J.; Song, Y.C. Construction Method of Regularization by Singular Value Decomposition of Design Matrix. Acta Geod. Cartogr. Sin. 2016, 45, 883–889. [Google Scholar]
  19. Lu, T.D.; Wu, G.M.; Zhou, S.J. Ridge estimation algorithm to ill-posed uncertainty adjustment model. Acta Geod. Cartogr. Sin. 2019, 48, 403–411. [Google Scholar] [CrossRef]
  20. Levenberg, K.Q. A method for the solution of certain nonlinear problems in least squares. Q. J. Appl. Math. 1944, 2, 164–168. [Google Scholar] [CrossRef]
  21. Marquardt, D.W. An algorithm for the least-squares estimation of nonlinear parameters. J. Soc. Ind. Appl. Math. 1963, 11, 431–441. [Google Scholar] [CrossRef]
  22. Madsen, K.; Nielsen, H.B.; Tingleff, O. Methods for Non-Linear Least Squares Problems, 2nd ed.; Society for Industrial & Applied Mathematics; Informatics and Mathematical Modelling, Technical University of Denmark: Kongens Lyngby, Denmark, 2004. [Google Scholar] [CrossRef]
  23. Yang, G.C.; Wang, Q.; Yu, B.G.; Liu, P.; Li, S. High-precision indoor positioning based on robust LM visual inertial odometer and pseudosatellite. Acta Geod. Cartogr. Sin. 2022, 51, 18–30. [Google Scholar] [CrossRef]
Figure 1. Diagram of ridge trace curves.
Figure 1. Diagram of ridge trace curves.
Axioms 13 00209 g001
Figure 2. The distribution of reprojection errors.
Figure 2. The distribution of reprojection errors.
Axioms 13 00209 g002
Figure 3. Iterative changes of SSR in different methods.
Figure 3. Iterative changes of SSR in different methods.
Axioms 13 00209 g003
Figure 4. Ridge trace curves of x ^ at the optimal solution.
Figure 4. Ridge trace curves of x ^ at the optimal solution.
Axioms 13 00209 g004
Figure 5. The detected points and the coins.
Figure 5. The detected points and the coins.
Axioms 13 00209 g005
Table 1. SSR and maximum residuals of each algorithm.
Table 1. SSR and maximum residuals of each algorithm.
ModelsBrownQPFourier
Algorithms SSRMaximumSSRMaximumSSRMaximum
LMFDM+h 1.631 × 10 4 3.137 × 10 4 1.114 × 10 4 2.990 × 10 4 6.245 × 10 6 3.511 × 10 4
LMBDM+h 1.632 × 10 4 3.137 × 10 4 1.114 × 10 4 2.990 × 10 4 6.245 × 10 6 3.511 × 10 4
LMCDM+h 1.631 × 10 4 3.137 × 10 4 1.114 × 10 4 2.990 × 10 4 6.245 × 10 6 3.511 × 10 4
LMFDM+HK 3.197 × 10 6 3.423 × 10 4 3.145 × 10 6 3.391 × 10 4 2.856 × 10 6 2.959 × 10 4
LMBDM+HK 3.197 × 10 6 3.423 × 10 4 3.145 × 10 6 3.391 × 10 4 2.856 × 10 6 2.959 × 10 4
LMCDM+HK 3.196 × 10 6 3.423 × 10 4 3.144 × 10 6 3.391 × 10 4 2.856 × 10 6 2.958 × 10 4
Table 2. The RMSE of reprojection errors (px).
Table 2. The RMSE of reprojection errors (px).
ModelsBrownQPFourier
Algorithms
LMCDM+h0.9700.8610.929
LMCDM+HK0.9370.8610.749
Table 3. The true errors of parameters.
Table 3. The true errors of parameters.
MethodsLMCDM+hLMCDM+HK
Errors BrownQPFourierBrownQPFourier
Δ X S m 0.0650.0640.0640.002−0.010−0.051
Δ Y S m 0.7660.7550.7450.017−0.015−0.008
Δ Z S m 0.7210.7760.998−0.5730.572−0.206
Δ ϕ 1 rad 1.824 × 10 3 1.730 × 10 3 2.106 × 10 3 4.841 × 10 4 1.392 × 10 4 1.746 × 10 3
Δ ϕ 2 rad 1.661 × 10 2 1.610 × 10 2 8.391 × 10 3 1.067 × 10 3 4.340 × 10 4 7.422 × 10 3
Δ ϕ 3 rad 1.506 × 10 4 5.104 × 10 4 2.008 × 10 2 1.005 × 10 5 9.283 × 10 6 7.342 × 10 3
Δ f px 41.66541.66541.66641.58841.65241.696
Δ u 0 px −1.200−1.199−1.199−1.803−1.248−1.206
Δ v 0 px −3.399−3.399−3.399−3.376−3.358−3.434
Table 4. The number of iterations k and the running time (s).
Table 4. The number of iterations k and the running time (s).
ModelsBrownQPFourier
Algorithms kTimekTimekTime
LMFDM+h143.681121.64782.459
LMBDM+h143.666121.63282.508
LMCDM+h147.224123.20484.963
LMFDM+HK51.31350.72851.609
LMBDM+HK51.34850.73951.580
LMCDM+HK52.60151.41153.302
Table 5. The condition number and damping factor at the optimal solution.
Table 5. The condition number and damping factor at the optimal solution.
ModelsBrownQPFourier
C0 μ C0 μ C0 μ
Algorithms CCC
LMCDM+h 7.263 × 10 16 4.028 2.705 × 10 17 3.373 2.113 × 10 15 3.586 × 10 3
26.82332.576 1.233 × 10 5
LMCDM+HK 1.179 × 10 13 5.698 × 10 9 3.684 × 10 17 6.407 × 10 8 2.777 × 10 15 2.752 × 10 9
1.918 × 10 10 1.707 × 10 9 1.633 × 10 11
Table 6. SSR and maximum residuals (px).
Table 6. SSR and maximum residuals (px).
ModelsBrownQPFourier
Algorithms SSRMaximumSSRMaximumSSRMaximum
LMCDM+h 8.512 × 10 3 2.738 × 10 2 1.208 × 10 5 9.448 × 10 3 1.816 × 10 4 3.617 × 10 3
LMCDM+HK 8.950 × 10 3 2.858 × 10 2 1.007 × 10 5 8.995 × 10 3 9.463 × 10 5 3.137 × 10 3
Table 7. The number of iterations k and the running time (s).
Table 7. The number of iterations k and the running time (s).
ModelsBrownQPFourier
Algorithms kTimekTimekTime
LMCDM+h81.56962.21362.350
LMCDM+HK71.37841.58741.622
Table 8. The diameter of coins calculated by different methods (mm).
Table 8. The diameter of coins calculated by different methods (mm).
ModelsBrownQPFourier
Algorithms Diameter1Diameter2Diameter1Diameter2Diameter1Diameter2
LMCDM+h19.05418.88619.05318.88619.05318.886
LMCDM+HK19.05318.88619.05318.88719.05318.887
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, L.; Liu, G. A Method for Solving Ill-Conditioned Nonlinear Least Squares Problems and Its Application in Image Distortion Correction Using Self-Calibration. Axioms 2024, 13, 209. https://doi.org/10.3390/axioms13030209

AMA Style

Wang L, Liu G. A Method for Solving Ill-Conditioned Nonlinear Least Squares Problems and Its Application in Image Distortion Correction Using Self-Calibration. Axioms. 2024; 13(3):209. https://doi.org/10.3390/axioms13030209

Chicago/Turabian Style

Wang, Luyao, and Guolin Liu. 2024. "A Method for Solving Ill-Conditioned Nonlinear Least Squares Problems and Its Application in Image Distortion Correction Using Self-Calibration" Axioms 13, no. 3: 209. https://doi.org/10.3390/axioms13030209

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop