Skip to main content

Numerical Solution for Radial Distortion Rectification in Optical Systems

  • Conference paper
  • First Online:
Maple in Mathematics Education and Research (MC 2020)

Abstract

Accurate homography estimation is a crucial step for many computer vision applications. Nevertheless, nonlinear optical camera imaging effects can introduce radial distortion, making unfeasible the pinhole model for homography estimation. In this paper, an algorithm to rectify radially distorted images using the Maple software is proposed. First, the effect of radial distortion is modeled and analyzed. Next, an inverse distortion model is developed. The proposed algorithm allows us to estimate both the homography matrix and the distortion parameters by processing images of a calibration target using the Gauss-Newton approach. Successful estimation of homographies and distortion parameters to correct real-world images is reported.

This work was supported by the Consejo Nacional de Ciencia y Tecnología (CONACYT) by the projects Cátedras-880 and A1-S-28112. Authors thank the support of Instituto Politécnico Nacional by the project SIP-20210845.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    More detailed information about homogeneous coordinates can be found in Appendix A.

  2. 2.

    Reprojection error is an error measure defined as the Euclidean distance between the estimated reference points (obtained using the estimated homography and distortion parameters) and the exact coordinates of the reference points.

References

  1. Benligiray, B., Topal, C.: Lens distortion rectification using triangulation based interpolation. In: Bebis, G., et al. (eds.) ISVC 2015. LNCS, vol. 9475, pp. 35–44. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-27863-6_4

    Chapter  Google Scholar 

  2. Brown, D.: Decentering distortion of lenses. Photogrammetric Engineering and Remote Sensing (1966)

    Google Scholar 

  3. Bukhari, F., Dailey, M.N.: Automatic radial distortion estimation from a single image. J. Math. Imaging Vis. 45(1), 31–45 (2013)

    Article  MathSciNet  Google Scholar 

  4. Cao, V.-T., Park, Y.-Y., Shin, J.-H., Lee, J.-H., Cho, H.-M.: A simple method for correcting lens distortion in low-cost camera using geometric invariability. In: Huang, D.-S., Zhang, X., Reyes García, C.A., Zhang, L. (eds.) ICIC 2010. LNCS (LNAI), vol. 6216, pp. 325–333. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14932-0_41

    Chapter  Google Scholar 

  5. Corke, P.: Robotics, Vision and Control: Fundamental Algorithms in MATLAB® Second, Completely Revised, vol. 118. Springer (2017)

    Google Scholar 

  6. Devernay, F., Faugeras, O.: Straight lines have to be straight. Mach. Vis. Appl. 13(1), 14–24 (2001)

    Article  Google Scholar 

  7. Fitzgibbon, A.W.: Simultaneous linear estimation of multiple view geometry and lens distortion. In: Proceedings of the 2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. CVPR 2001, vol. 1, pp. I-I. IEEE (2001)

    Google Scholar 

  8. Geng, J.: Structured-light 3D surface imaging: a tutorial. Adv. Optics Photonics 3(2), 128–160 (2011)

    Article  Google Scholar 

  9. Hughes, C., Denny, P., Jones, E., Glavin, M.: Accuracy of fish-eye lens models. Appl. Opt. 49(17), 3338–3347 (2010). https://doi.org/10.1364/AO.49.003338

    Article  Google Scholar 

  10. Hughes, C., Glavin, M., Jones, E., Denny, P.: Review of geometric distortion compensation in fish-eye cameras. In: IET Irish Signals and Systems Conference 2008. IET (2008)

    Google Scholar 

  11. Hwang, K., Kang, M.G.: Correction of lens distortion using point correspondence. In: Proceedings of IEEE. IEEE Region 10 Conference. TENCON 1999. Multimedia Technology for Asia-Pacific Information Infrastructure’(Cat. No. 99CH37030), vol. 1, pp. 690–693. IEEE (1999)

    Google Scholar 

  12. Juarez-Salazar, R., Diaz-Ramirez, V.H.: Operator-based homogeneous coordinates: application in camera document scanning. Optic. Eng. 56(7), 070801 (2017). https://doi.org/10.1117/1.OE.56.7.070801

  13. Kasturi, R., Jain, R.: Computer Vision: Principles, vol. 1. IEEE Computer Society (1991)

    Google Scholar 

  14. Mallon, J., Whelan, P.F.: Precise radial un-distortion of images. In: Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004, vol. 1, pp. 18–21. IEEE (2004)

    Google Scholar 

  15. Tsai, R.: A versatile camera calibration technique for high-accuracy 3D machine vision metrology using off-the-shelf tv cameras and lenses. IEEE J. Robot. Autom. 3(4), 323–344 (1987)

    Article  Google Scholar 

  16. Zhang, Z.: Flexible camera calibration by viewing a plane from unknown orientations. In: Proceedings of the Seventh IEEE International Conference on Computer Vision. vol. 1, pp. 666–673. IEEE (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Obed I. Rios-Orellana .

Editor information

Editors and Affiliations

Appendices

A Homogeneous coordinates

In this section we introduce the homogeneous coordinates and the direct linear transform (DLT) method for homography estimation. We use the homogeneous coordinates operator \(\mathcal {H}[.]\) as in [12] to represent an n-dimensional point in homogeneous coordinates. To clarify, let a Cartesian’s coordinate point \(\boldsymbol{u} \in \mathbb R^n\) specified as

$$\begin{aligned} \boldsymbol{u} = \begin{bmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{bmatrix}, \end{aligned}$$
(18)

whose homogeneous representation is given by

$$\begin{aligned} \boldsymbol{v} = \mathcal {H}_s[\boldsymbol{u}] = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_{n+1}\end{bmatrix} = \begin{bmatrix} u_1 \\ u_2 \\ \vdots \\ s\end{bmatrix}, \end{aligned}$$
(19)

such that \(v \in \mathbb R^{n+1}\). Inversely to obtain the Cartesian’s coordinates from homogeneous coordinates representation we use the inverse homogeneous operator defined as

$$\begin{aligned} \boldsymbol{u} = \mathcal {H}_s^{-1}[\boldsymbol{v}] = \frac{s}{\mathcal {S}[\boldsymbol{v}]}\mathcal {H}_0^{-1}[\boldsymbol{v}], \end{aligned}$$
(20)

where \(\mathcal {S}\) is the scale operator which returns the last element of \(\boldsymbol{v}\) and the null inverse homogeneous operator specified as \(\mathcal {H}_0^{-1}[\boldsymbol{v}] = \left[ v_1, v_2, \dots , v_n \right] ^T\).

1.1 A.1 Correspondence Between Planes

Homography estimation is critical in many vision-based applications such as camera calibration [16], perspective correction [12], among others [8]. Projective transformations are linear operations that relate points in homogeneous coordinate space. Homographies are a special kind of projective transformations that define direct and inverse mapping relationships between planes in homogeneous coordinates such as points, lines, and other objects. In this work, we use the point paradigm for correspondences between two planes \(\left( \varPi _\mu , \varPi _\rho \right) \) which are denoted as \(\mu _i \leftrightarrow \rho _i\) with \(\mu _i \in \varPi _\mu \) and \(\rho _i \in \varPi _\rho \). Equally important, consider direct and inverse mappings

$$\begin{aligned} \rho _i = \mathcal {H}^{-1}\left[ G\mathcal {H}[\mu _i] \right] , \end{aligned}$$
(21)

and

$$\begin{aligned} \mu _i = \mathcal {H}^{-1}\left[ G^{-1}\mathcal {H}[\rho _i] \right] , \end{aligned}$$
(22)

we may state the problem to estimate the homography that satisfies the equation for the direct mapping and inverse mapping given a set of correspondence points. To estimate a homography given a pair correspondences \(\mu _i \leftrightarrow \rho _i\) we may minimize the algebraic distance

$$\begin{aligned} \begin{aligned} \mathcal {H}[\mu _i] \times \mathcal {H}[\rho _i]&= \boldsymbol{0}_3, \end{aligned} \end{aligned}$$
(23)

From Eq. (23), using the matrix form of cross product \( \left[ \mathcal {H}[\mu _i] \right] _{\times } \mathcal {H}[\rho _i] = \boldsymbol{0}_3\) we may write

$$\begin{aligned} \begin{bmatrix} 0 &{} -1 &{} \mu _{y,i} \\ 1 &{} 0 &{} -\mu _{x,i} \\ -\mu _{y,i} &{} \mu _{x,i} &{} 0 \\ \end{bmatrix} \begin{bmatrix} \bar{\boldsymbol{g}_1}^T\mathcal {H}[\rho _i]\\ \bar{\boldsymbol{g}_2}^T\mathcal {H}[\rho _i]\\ \bar{\boldsymbol{g}_3}^T\mathcal {H}[\rho _i]\\ \end{bmatrix} = \boldsymbol{0}_3, \end{aligned}$$
(24)

where \(\bar{\boldsymbol{g}_i}^T\) are the matrix rows of G, and rearranging terms from Eq. (24) we obtain the measurements matrix M and the homography vector \(\boldsymbol{g}\) specified as follows

$$\begin{aligned} \underbrace{ \begin{bmatrix} \boldsymbol{0}^T &{} -\mathcal {H}[\rho _i]^T &{} \mu _{y,i}\mathcal {H}[\rho _i]^T\\ \mathcal {H}[\rho _i]^T &{} \boldsymbol{0}^T &{} -\mu _{x,i}\mathcal {H}[\rho _i]^T\\ -\mu _{y,i}\mathcal {H}[\rho _i]^T &{} \mu _{x,i}\mathcal {H}[\rho _i]^T &{} \boldsymbol{0}^T \end{bmatrix}}_{M} \underbrace{ \begin{bmatrix} \bar{\boldsymbol{g}_1}^T \\ \bar{\boldsymbol{g}_2}^T \\ \bar{\boldsymbol{g}_3}^T \end{bmatrix}}_{\boldsymbol{g}} = \boldsymbol{0}_3. \end{aligned}$$
(25)

Now from Eq. (25) the third row is a linear combination of the first two rows of the measurement matrix and promptly we may simplify it as

$$\begin{aligned} \underbrace{ \begin{bmatrix} \boldsymbol{0}^T &{} -\mathcal {H}[\rho _i]^T &{} \mu _{y,i}\mathcal {H}[\rho _i]^T\\ \mathcal {H}[\rho _i]^T &{} \boldsymbol{0}^T &{} -\mu _{x,i}\mathcal {H}[\rho _i]^T \end{bmatrix}}_{M} \underbrace{ \begin{bmatrix} \bar{\boldsymbol{g}_1}^T \\ \bar{\boldsymbol{g}_2}^T \\ \bar{\boldsymbol{g}_3}^T \end{bmatrix}}_{\boldsymbol{g}} = \boldsymbol{0}_3. \end{aligned}$$
(26)

The Eq. (26) is the principle of a well-known method for homography estimation called the Direct Linear Transformation (DLT). As we may observe, the DLT requires at least four correspondences points to estimate the homography matrix G, but we may supply more than four point correspondences and rewrite Eq. (26) as

$$\begin{aligned} \begin{bmatrix} \boldsymbol{0}^T &{} -\mathcal {H}[\rho _1]^T &{} \mu _{y,1}\mathcal {H}[\rho _1]^T\\ \boldsymbol{0}^T &{} -\mathcal {H}[\rho _2]^T &{} \mu _{y,2}\mathcal {H}[\rho _2]^T\\ \vdots &{} \vdots &{} \vdots \\ \boldsymbol{0}^T &{} -\mathcal {H}[\rho _i]^T &{} \mu _{y,i}\mathcal {H}[\rho _i]^T\\ \mathcal {H}[\rho _1]^T &{} \boldsymbol{0}^T &{} -\mu _{x,1}\mathcal {H}[\rho _1]^T\\ \mathcal {H}[\rho _2]^T &{} \boldsymbol{0}^T &{} -\mu _{x,2}\mathcal {H}[\rho _2]^T\\ \vdots &{} \vdots &{} \vdots \\ \mathcal {H}[\rho _i]^T &{} \boldsymbol{0}^T &{} -\mu _{x,i}\mathcal {H}[\rho _i]^T \end{bmatrix} \begin{bmatrix} \bar{\boldsymbol{g}_1}^T \\ \bar{\boldsymbol{g}_2}^T \\ \bar{\boldsymbol{g}_3}^T \end{bmatrix} = \boldsymbol{0}_{2n}, \end{aligned}$$
(27)

which we may be solved through the singular value decomposition method (SVD) [16]. A detailed Maple implementation for homogeneous coordinates transformation and homography estimation by the DLT method can be found in Appendix A.2.

1.2 A.2 Homogeneous Coordinates and DLT Maple Listings

For this Maple listings section, it is necessary to load the following libraries using

figure b
figure c
figure d
figure e

B Support Functions Maple Listings

figure f
figure g
figure h
figure i

C Numerical Solution for Radial Distortion Maple Listings

figure j
figure k
figure l
figure m

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rios-Orellana, O.I., Juarez-Salazar, R., Diaz-Ramirez, V.H. (2021). Numerical Solution for Radial Distortion Rectification in Optical Systems. In: Corless, R.M., Gerhard, J., Kotsireas, I.S. (eds) Maple in Mathematics Education and Research. MC 2020. Communications in Computer and Information Science, vol 1414. Springer, Cham. https://doi.org/10.1007/978-3-030-81698-8_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-81698-8_21

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-81697-1

  • Online ISBN: 978-3-030-81698-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics