## 2 Image Undistortion  
The projection of points in the scene onto images is usually described by a series of geometric transformations using the pinhole model [12]. First, the world coordinates in the scene are transformed to camera coordinates while using a three-dimensional (3D) rigid-body transformation that involves three rotations \((\alpha,\beta,\gamma)\) and three translations \((t_{x},t_{y},t_{z})\). These parameters are often referred to as extrinsic parameters. The transformation can be expressed as (1), where \(P^{w}=(x^{w},y^{w},z^{w})^{T}\) and \(P^{c}=(x^{c},y^{c},z^{c})^{T}\) represent the coordinates of points in world and camera coordinates, and \(r_{ij}\) are the coefficients of the rotation matrix using the angles \(\alpha\), \(\beta\), and \(\gamma\). \[P^{c}=RtP^{w}=\left( \begin{array}{cccc}r_{11}&r_{12}&r_{13}&t_{x}\\ r_{21}&r_{22}&r_{23}&t_{y}\\ r_{31}&r_{32}&r_{33}&t_{z}\\ 0&0&0&1\end{array} \right)\left( \begin{array}{c}x^{w}\\ y^{w}\\ z^{w}\\ 1\end{array} \right) \tag{1}\]  
Points in camera coordinates are transformed next to pixel coordinates using a combination of perspective projection and 2D affine transformation. These transformations are usually combined in a single form as (2), where \((c,r)^{T}\) are the column and row of the pixel, \(f\) is the focal distance, \(S_{x}\) and \(S_{y}\) are the size of the pixels, and \(C_{x}\) and \(C_{y}\) are the translation coefficients that compensate for displacements of the central pixel. These parameters are often referred to as intrinsic parameters. \[\left( \begin{array}{c}c\\ r\\ 1\end{array} \right)=\left( \begin{array}{cccc}\frac{f}{S_{x}}&0&C_{x}&0\\ 0&\frac{f}{S_{y}}&C_{y}&0\\ 0&0&1&0\end{array} \right)Rt\left( \begin{array}{c}x^{w}\\ y^{w}\\ z^{w}\\ 1\end{array} \right) \tag{2}\]  
This linear model is not accurate, as it does not take lens distortions into account [13]. Lens imperfections produce non-linear projections of the scene points onto the image plane. Figure 1 shows the effects of the most common lens distortions. An additional transformation is required to compensate for these optical distortions. The most common distortion model is the polynomial model [14]. Other models also exist, such as the division model [15]. In general, eight coefficients are considered, six to model the radial distortion and two to model the tangential distortion. However, the last five radial distortion coefficients are only used for severe distortion, such as in wide-angle lenses. Radial distortion is related to light rays bending near the edges of the lens. Tangential distortion is related to nonalignment issues between the image plane and the lens. Distortion is usually modeled as (3) and (4), where \((x^{\prime},y^{\prime})\) denote the distorted points, \(r=\sqrt{x^{2}+y^{2}}\), \((k_{1},k_{2},k_{3},k_{4},k_{5},k_{6})\) are the radial distortion coefficients, and \((p_{1},p_{2})\) are the  
Figure 1: Lens distortion. (**a**) No distortion, (**b**) Positive radial distortion (barrel). (**c**) Negative radial distortion (pincushion). (**d**) Tangential distortion. tangential distortion coefficients. These radial and tangential distortion coefficients are part of the intrinsic parameters, as they do not depend on the scene viewed. \[x^{\prime}=x\frac{1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}}{1+k_{4}r^{2}+k_{5}r^{4}+k_{6 }r^{6}}+2p_{1}xy+p_{2}(r^{2}+2x^{2}) \tag{3}\]  
\[y^{\prime}=y\frac{1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}}{1+k_{4}r^{2}+k_{5}r^{4}+k_ {6}r^{6}}+2p_{2}xy+p_{1}(r^{2}+2y^{2}) \tag{4}\]  
Lens distortions provoke different irregular patterns and undesirable artifacts in the image, such as curvatures of lines. Straight lines in the scene do not remain straight in the projected image, provoking difficulties in image processing and interpretation. Therefore, image undistortion is a recommended pre-processing step for further image analysis [16]. Image undistortion is performed by applying image interpolation with a reverse distortion. This is a non-trivial problem with no analytical solution due to the non-linearity of the distortion model.