Scientific Programming

Volume 2018, Article ID 4230185, 9 pages

https://doi.org/10.1155/2018/4230185

## Nonmetric Correction of Lens Distortion Based on Entropy Measure

Correspondence should be addressed to Lijun Sun; moc.361@zznujilnus

Received 17 October 2017; Accepted 3 December 2017; Published 4 February 2018

Academic Editor: Shangguang Wang

Copyright © 2018 Tianfei Chen et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

In the real vision system, lens always inevitably contains nonlinear distortion, which leads to geometric distortion of digital image, so it must be corrected. In this paper, a nonmetric correction algorithm for lens distortion based on entropy measure is proposed. The algorithm uses the imaging characteristics of the space line in the ideal perspective model, and the distortion entropy is defined to measure the degree of lens distortion. For distortion curves with different distribution, the calculation dimension of distortion entropy measure is uniform, which can reduce the influence of curve inhomogeneity. On this basis, the modified distortion entropy measure with normalized weight is put forward to enhance the capability of noise suppression, and the distortion correction performance of the traditional interior point optimization algorithm, basic artificial bee colony (ABC) algorithm, and Gbest-guided artificial bee colony (GABC) algorithm is compared and analyzed. The simulation experiments demonstrate that the correction performance of GABC to optimize the modified distortion entropy measure with normalized weight is best, and it has strong robustness to noise. Finally, the actual image distortion correction examples verify the effectiveness of the proposed algorithm.

#### 1. Introduction

In the computer vision, vision inspection, image processing, and other research fields, ideal pinhole model is often used to represent camera lens. However, the manufacturing or installation factors in the actual production conditions lead to the phenomenon that the captured digital image has geometric distortion; thus the pinhole camera model is far from enough especially for some low-cost or wide-angle lenses [1]. In order to ensure the accuracy of subsequent vision processing and analysis, the actual distortion of camera lens should be described and corrected.

At present, the algorithm for lens distortion correction can be mainly divided into metric method and nonmetric method. The metric methods [2, 3] require the accurate location of feature points in space, and the distortion model parameters are also integrated into the camera model. These methods establish the corresponding relationship between feature points in world coordinate system and the two-dimensional coordinates in CCD image, and the distortion model parameters and camera model parameters are together obtained by nonlinear optimization. Therefore, these methods have more parameters and require large computation and some known coordinates of feature points; thus the correction cost is higher. In addition, the coupling of distortion model parameters and camera model parameters can easily occur in the nonlinear optimization process, which can affect the distortion correction performance.

The nonmetric correction methods [4] make full use of the geometric invariants of ideal pinhole camera model. Generally, these geometric invariants represent the properties of structures and remain unchanged under appropriate transformations; thus these methods have no need to require some known structure reference. Currently, the available features of geometric invariants include straight line [5, 6], cross ratio [7, 8], vanishing points [9], and plane constraints [10]. The straight line is the most widely used geometric feature, and the projection of straight line should be straight under any perspective transformation. Therefore, [11] uses col-linear feature points to measure distortion, and col-linear vector is adopted in [12]. In addition, geometric feature of straight line also contains line slope [13] and three mutually orthogonal sets of parallel lines [14]. The distortion correction algorithm based on cross ratio invariability is proposed by He et al. [8], which only requires image coordinates of four col-linear points and cross ratio. However, it has some limitations, because only one-order distortion model is considered. On the basis of cross ratio invariability, the linear equations are introduced by Ricolfe-Viala and Sánchez-Salmerón [15], which make the correction method more robust. Zhao et al. [16] have analyzed the accuracy of correction method based cross ratio invariability and propose the distortion correction algorithm using col-linear constraint of vanishing points. Wang et al. [17] use the division distortion model with single parameters, and the distorted image points are adopted for circle fitting; thus this method is limited by the circle fitting accuracy. Reference [18] uses multiview corresponding points to realize distortion correction, but mismatching points can lead to poor correction performance. When the distortion measure has been defined using geometric invariants, the distortion parameters can be finally solved by nonlinear optimization algorithm. The traditional nonlinear optimization algorithm has strong dependence on the initial value, and the setting of initial value has a direct impact on the optimization accuracy, such as Levenberg-Marquardt optimization method and Interior Point Method with constrains. As a research issue in the field of artificial intelligence, the swarm intelligence algorithm has become a new method to solve the traditional optimization problems in recent years. It does not need to set initial value of iteration, and the whole intelligence behavior is carried on through the cooperation of simple individuals, such as genetic algorithm, particle swarm optimization, and artificial bee colony algorithm. Zhang et al. [19] and Chen et al. [20] have in respective successfully applied genetic algorithm and particle swarm optimization algorithm in lens distortion correction. As a novel swarm intelligence algorithm, the artificial bee colony (ABC) algorithm has simple structure, less control parameters, and other characteristic, and it also has better performance in numerical optimization and other application fields [21].

In this paper, the concept of entropy is introduced to measure the degree of lens distortion by using the geometric characteristics of straight line in pinhole camera model. The new definition of distortion entropy has uniform calculation dimension, which can reduce the influence of uneven distribution of distortion curve. Besides that, the distortion entropy measure is further improved to enhance the ability of noise suppression in the analysis of curvature characteristic of distortion curve. The algorithm of ABCs is adopted to carry on the final nonlinear optimization, and the correction performance is compared and analyzed among the traditional interior point optimization, basic ABC, and GABC. In the proposed algorithm, the defined distortion entropy measure is simple and easy to implement, and the modified entropy measure with normalized weight has the noise suppression ability to some extent. In addition, the algorithm of GABC not only has no need to set initial value of iteration but also has better optimization accuracy and faster convergence speed. Finally, a large number of simulation and actual experiments verify the correction performance of the proposed algorithm.

#### 2. Lens Distortion Model and Distortion Measure

The actual camera lens generally has different degrees of distortion due to manufacturing, assembly, and other factors, which can lead to the phenomenon that the actual image points are not identical to the ideal image points, and the difference between them is called lens distortion. Usually, the lens distortion is classified into radial distortion and tangential distortion, and the radial distortion is dominant [2].

##### 2.1. Lens Distortion Model

In general, lens distortion can be quantitatively described using a mathematical model, and the lens distortion model also can be considered as mapping function between actual image points and ideal image points , where

After analyzing the actual imaging process, Brown [22] presented the mathematical expression of radial and tangential distortion model, and it has become the traditional lens distortion model; the formulation is expressed as follows:where , (, ) is the distortion center. , are radial distortion parameters, and are tangential distortion parameters.

However, in practical applications, less parameters cannot fully express the complexity of lens distortion, and too many parameters will also cause the instability of the solution [4]. Therefore, two radial distortion parameters and two tangential parameters are most adopted which can satisfy most lenses with different distortion degree. The model is expressed as

If all the distortion parameters are known, lens distortion can be corrected through the above distortion model.

##### 2.2. Distribution Law of Distortion Curve

If camera lens have no distortion, the imaging projection of straight lines in three-dimensional (3D) space should be straight based on the pinhole camera model and perspective projection principle. In fact, the actual projection of straight lines in space will deform and become distortion curves due to the inevitable distortion. In order to analyze the change law of distortion curves with different distribution influenced by lens distortion, some ideal horizontal lines are generated at intermediate intervals in the CCD image, and equal interval sampling is performed on each line. If the distortion parameters are known, the corresponding distortion points can be calculated by using formula (3). Figure 1 shows points on ideal lines and distortion points on corresponding distortion curve, the solid points represent the points on the ideal line, and the cross points represent distortion points. As can be seen from the figure, if the distance from distortion center to the ideal straight line is closer, the bending degree of the corresponding distortion curve is smaller. Figure 2 shows the relationship between mean curvature of distortion curves and the distance from the distortion center to the ideal lines, and it can be concluded that the mean curvature of distortion curve is greater when it is farther away from the distortion center.