Abstract
Camera calibration is an important part of high-precision optical measurement, which is especially difficult in the micro-nano field. Based on the integrated correlation calculation and CCD moiré method, this paper describes the development of a lens calibration technique called the Integrated Colour CCD Moiré Method (ICCM). The CCD moiré fringes, formed by superimposing a periodic optical signal of a specimen grating with a CCD target array or a Bayer filter array, significantly enlarges the deformation modulated by lens distortion and the calibration plate attitude (i.e. the rotation angle relative to the camera coordinate system). To measure lens distortion using CCD moiré, the deformation pattern that is governed by the lens distortion, specimen grating attitude and carrier was used to construct a CCD fringe image. If the constructed CCD fringe image based on the trial lens distortion and rotation angles have a maximum similarity to the captured CCD moiré image, the lens distortion and rotation angles are correctly inversed. Particle swarm optimisation algorithm was selected to search for the true value so that the accuracy and robustness could be improved. Numerical experiments verified that the ICCM method developed in this work can simultaneously inverse the lens distortion, rotation angle and the grating pitch with high precision. The lens distortion of the metallographic microscope has been successfully characterised by the developed method with an 833 nm pitch grating. Simulations and experiments showed that ICCM is an intuitive, accurate, anti-noise and robust distortion calibration method.
© 2019 Optical Society of America under the terms of the OSA Open Access Publishing Agreement
1. Introduction
Non-contact optical testing techniques include the process of capturing images typically using a camera [1–3]. However, due to the imaging mechanism, some differences between the ideal geometric projection of the real object and the recorded image are produced [1,4]. The main source of error is lens distortion, which mainly includes radial distortion, eccentric distortion and thin prism aberration [5,6]. These system errors have a non-negligible effect on measurement results [1,2,7].
At present, lens distortion characterisation techniques are mainly divided into two categories [8–10]. One is based on the relationship of coordinate points as a constraint [8] and the other is based on the invariance of some properties before and after imaging [9,10]. The first method uses the correspondence between the three-dimensional coordinates of the points on the external calibration object and the two-dimensional coordinates of the corresponding points in the image captured by the camera to solve the camera parameters and lens distortion parameters. Weng used this method to obtain the parameters of radial distortion, eccentric distortion and thin prism aberration. Based on this principle, Zhang’s calibration method based on a checkerboard has been widely used [11]. Recently, Hild used the I-DIC method to characterise lens distortion using speckle images [1]. The above methods required the production of a calibration plate (a checkerboard or plate with a specific speckle pattern). The difficulty in making the calibration plate limits the application of the above methods in some fields, such as micro-nano measurement. By phase analysis of a cross-grating using a Fourier transform, the lens distortion of the scanning electron microscope was detected [12]. Using the regular grating structure, Hou [13] proposed a colour CCD moiré method [14–16] to characterise lens distortion. In comparison with a checkerboard or speckle pattern, the micro-nano scale grating structure is easy to manufacture, such as with photoetching. Moreover, the CCD moiré method to characterise lens distortion is intuitive and sensitive. However, Hou's method requires pre-processing of the moiré image, which is not only cumbersome to operate, but also introduces displacement calculation errors. Therefore, in view of the shortcomings of Hou's method, this work developed a lens distortion calibration method called Integrated Colour CCD Moiré Method (ICCM).
This paper describes the development of a lens distortion characterisation method by combining integrated correlation calculation [17,18] with CCD moiré [16]. Firstly, based on the small hole imaging model and the lens distortion model, the ICCM model suitable for the distortion parameter inversion was derived. The grating pitch in pixel and rotation angles were measured simultaneously during the inversion process of the moiré image, which simplified the experimental operation and improved the accuracy of lens distortion calibration. The PSO algorithm was introduced into the ICCM solution process, which solved the problem of initial value estimation and the premature problem. Numerical experiments then demonstrated the feasibility and accuracy of this method. Finally, the lens distortion of the metallographic microscope was characterised by the ICCM method. Numerical simulations and application experiments indicated that the developed method had the advantages of easy operation and high precision, and is applicable to a wide-range of fields.
2. Principle of the ICCM Method for distortion evaluation
2.1 Distortion model using the colour CCD moiré method
The lens distortion can be visually revealed directly using the colour CCD moiré method [13]. The colour CCD moiré forming principle is illustrated in Fig. 1, where a periodic optical signal of the standard specimen grating and a Bayer filter array interfere with each other to form a moiré pattern when imaging [19].
The stripes of the moiré pattern were changed due to lens distortion. Generally, the displacement of the stripes caused by radial distortion, eccentric distortion and thin prism aberration can be expressed as [5]:
However, for the CDD moiré method, the relative rotation angles between the specimen grating and the reference grating also introduce a virtual displacement field (Moiré deformation components which were not caused by lens distortion), as shown in Fig. 2. According to the pinhole imaging model, the virtual displacement field introduced by the rotation angles $({{\alpha_x},{\alpha_y},{\alpha_z}} )$ is derived as in Eq. (3):
For the moiré method, it is also necessary to consider the carrier field introduced by the mismatch between the specimen grating pitch and the reference grating pitch. The carrier field is given by Eqs. (4) and (5) [13]:
where ${P_s}$ is the specimen grating pitch in pixels, and ${P_r}$ is the reference grating pitch. For the colour moiré method using a Bayer filter array, ${P_r}\textrm{ = }2$ pixels.Taking into account the factors above, the total displacement field of the moiré image can be written as given in Eqs. (6) and (7):
For: where ${U_d}$ and ${V_d}$ is the distortion, ${U_r}$ and ${V_r}$ is the rotation, and ${U_c}$ and ${V_c}$ is the carrier. This model can be used for characterising the lens distortion, rigid body rotation and the specimen grating pitch in pixels using the CCD moiré method. All parameters ($P = \left[ {\begin{array}{{ccc}} K&R&{{P_s}} \end{array}} \right]$) can be obtained by the least square method. But, this is complicated to operate and is susceptible to noise, because each moiré image needs to be processed for noise reduction, binarization, refinement, etc. The ICCM method can integrate parameter inversion into the process of the moiré image correlation calculation, which greatly reduces manual participation and improves accuracy.2.2 ICCM model
The developed ICCM method integrated the inversion of distortion coefficients, the grating pitch in pixels, and rotation angles into the matching process of the moiré pattern, as shown in Fig. 3. First, a displacement field U was introduced on a constructed null matrix (image). U was constructed by an initial guess of ${P_s}$. Then, the displacement field U was converted into a moiré phase field M using Eq. (10) and the phase field M was drawn into a fringe pattern J. The correlation algorithm between J and the captured moiré I is solved by the optimisation algorithm. It should be noted that I should be translated into grayscale.
where, ${I_m}$ and ${J_m}$ are the mean intensity values of the two images, and ROI is the region of interest.
2.3 Particle swarm optimisation
In the traditional I-DIC method, a gradient-based algorithm is employed because this method converges quickly and the amount of calculation is small. However, in this work, it was found that the objective function (correlation function) C is a local multi-extreme value function, as shown in Fig. 4. In the case, where the grating pitch was changed and other parameters were constant, there was a local maximum next to the global maximum of the correlation coefficient. This local maximum will cause premature convergence when using a gradient-based algorithm. Therefore, in this work, the PSO algorithm was selected for the optimisation iteration.
In traditional PSO, a set of particle swarms is first randomly initialised in the solution space, and then these particles search for the optimal solution by simulating bird foraging (iteration). The iteration formula is as follows [22]:
3. Numerical simulation
The feasibility and accuracy of this method were verified by numerical simulation. Considering radial distortion is the main part of lens distortion [25], the following discussion takes ${k_1}$ as the lens distortion coefficient. First, a simulated moiré image with specific information of lens distortion, rotation angle and carrier (${k_1}$, R and ${P_s}$) was generated according to Eqs. (6), (7) and (10), as shown in Fig. 5(a). Due to noise and light source effects in the experiment, noise and blur will exist in the actual acquired image, hence a certain amount of noise was added to the generated moiré image. The types of noise were Gaussian noise and blur. This image was then taken as a captured moiré and then parameters (${k_1}$, R and ${P_s}$) were inversed by the PSO optimisation algorithm. The simulation experiment included three types which considered the grating pitch, rotation angle and distortion coefficient respectively. The simulation results are shown in Tables 2 to 4 of Appendix B. As can be seen from those three tables, the inversion results showed a good performance for the method in accuracy and robustness. The maximum error was less than 1%.
The anti-noise performance of the method is also discussed. Data from Group A in Table 2 of Appendix B was selected, as shown in Fig. 5. In Fig. 5(a), salt and pepper noise and Gaussian blur are added to the three selection areas (rectangles, SA1-3) in Fig. 5(a) by Photoshop software. Salt and pepper noise can cause discontinuities in the moiré fringes, such as the selection rectangle 2 in Fig. 5(a), Gaussian blur will cause a local reduction of fringe modulation, such as the selection rectangle 3 in Fig. 5(a). Three regions were applied with different types of noise: noise and blur, noise, and blur. The inversed moiré image is shown in Fig. 5(b) which is very similar to Fig. 5(a). The blue lines in Figs. 5(c)–5(e) are the grey scales of the selected areas of the lines in Fig. 5(a), whereas the red lines are the grey scales of the same areas in Fig. 5(b). Comparing the grey distribution profiles of the three areas in the two images, it can be seen that areas affected by noise can be corrected by inversion. This indicates that this method had good noise resistance. It can be confirmed that the magnitude of the reference moiré and the background intensity do not affect the final phase inversion result.
4. Experiment: distortion inversion for a microscope lens
The difficulty of making the calibration plate limits the calibration of the microscope lens. In this work, the developed method was adopted to calibrate a metallographic microscope lens. The experimental setup is shown in Fig. 6. The magnification of the microscope lens is 80, the aperture is 0.8mm, and the mechanical tube length is 160mm. The resolution of the camera is 560 pixels*780 pixels.
Since the magnification of the microscope is extremely high, it is necessary to use a grating with a high frequency. Here, a bidirectional diffraction grating of 1200 lines/mm was selected, as shown in Fig. 6. In order to further improve the accuracy of the calibration, a four-step phase shift method was introduced. The bidirectional diffraction grating was placed on a motorised translation stage that can be precisely adjusted. The accuracy of the stage was 6.25e-5 mm, while, for the 1200 lines/mm grating, the actual distance of the 1/4 phase is 2.1e-4 mm. The accuracy was sufficient to meet the requirements. Due to the bidirectional grating, bidirectional CCD moiré could be generated on the screen. By adjusting the filter and the illumination, the moiré in one direction can be made stronger and the other is weaker. Next, images of multiple phases could be obtained by controlling the translation stage (as shown in Fig. 7).
Any direction of the images can invert all the required parameters. The following section took the experimental data in the x direction as an example. Images ${I_N}(x,\;y)$. (N = 1, 2, 3, 4) taken at each step can be expressed as:
I, calculated from Eq. (16), was selected as the captured moiré and the distortion coefficient, the rotation angle and the specimen grating pitch can be inversed by this method, as shown in the Table 1. The decoupled displacement fields are shown in Fig. 8. The image scale was 2.34e-4 mm/pixel and the maximum distortion displacement was about 30 pixels. It can be seen from Fig. 8 that most of the displacement was caused by the carrier field, which was two orders of magnitude greater than the other two. The displacements caused by the rotation and distortion are of the same order of magnitude. Therefore, if the carrier field and rotation were not considered, it is hence difficult to accurately measure the distortion coefficient of the microscope lens. The residual field between the phase analysis and inversion is shown in the Fig. 9. It can be seen that the absolute value of most residuals was less than 3e-4 mm. In the upper right corner of the image, the residual was relatively large, and the residual maximum was less than 1.5e-3 mm.
Using a standard ruler, an estimated value of the specimen grating pitch can be measured. As shown in Fig. 10, the number of pixels corresponding to 12 small scales (0.01mm/scale) was read. The measured specimen grating pitch ${P_s}^{\prime}$ can be calculated from the Eq. (17). The relative error of the pitch was 0.6%, which further proved the accuracy of this method.
5. Conclusions
This paper describes the development of a characterisation method of lens distortion based on integrated correlation calculation and CCD moiré. By integrating the moiré process into the image correlation calculation, multiple parameters, including the lens distortion coefficient, can be solved simultaneously. The premature problem can be solved by introducing the PSO algorithm. Numerical experiments verified the feasibility and anti-noise performance of the method and the distortion of the microscope lens was successfully measured using a diffraction grid of high frequency and a motorized translation stage of high accuracy. The advantages of the improved method are as follows:
- 1. Highly sensitive and accurate. It is well-known that the displacement measurement sensitivity of the geometric moiré method depends on the pitch of the grating, and thus the smaller the reference grating pitch the higher the measurement sensitivity. Owing to the full use of the CCD camera resolution limit for selecting CCD target surface imaging units as reference gratings, the ICCM method has a high sensitivity and accuracy for distortion measurement.
- 2. Efficient. The developed ICCM method can obtain the rotation angle, the grating pitch in pixels, and the distortion coefficient simultaneously. It has simplified the process of dealing with moiré and reduced manual participation.
- 3. Robust. The PSO algorithm was adopted to solve the initial value estimation and premature problem, which improved the accuracy of the inversion results. The integrated algorithm for the moiré image was good for noise immunity.
- 4. Wide range of applications. The CCD moiré method has the advantage of having an easily manufactured calibration board, especially in the field of micro-nano measurements.
Appendix A
This part mainly introduces the derivation process of Eq. (3). First, the world coordinate system ${O_w} - {x_w}{y_w}{z_w}$ and the specimen coordinate system ${O_s} - {x_s}{y_s}{z_s}$ are defined. The origin ${O_w}$ of the world coordinate system is the centre of the lens, and the ${x_w}$-axis and the ${y_w}$-axis are respectively parallel to the two axes of the camera target surface, and the ${z_w}$-axis is parallel to the camera optical axis. The origin ${O_s}$ of the specimen coordinate system is the point on the test piece corresponding to the centre of the image. The ${x_s}$-axis is parallel to the normal of the grating, the ${y_s}$-axis is parallel to the grating, and the ${z_s}$-axis is parallel to the normal of the specimen’s surface. The relative rotation angle refers to the angle between the two coordinate systems. According to the pinhole imaging model, we know that the presence of the rotation angle will introduce a virtual displacement into the moiré. The usual practice is to adjust the two coordinate systems to coincide by the device. But this operation was complex. In order to simplify this step, we derived the virtual displacement formula caused by the rotation angle through the pinhole imaging model.
It is assumed that there is a point on the specimen, and its coordinates in the world coordinate system were $({X_w},{Y_w},0)$. Before rotation (the two coordinate systems are coincided), its image coordinates were $(x,\;y)$. After rotation, its image coordinates were $(x^{\prime},\;y^{\prime})$. $({\alpha _x},{\alpha _y},{\alpha _z})$ are the rotation angles. According to pinhole camera model, the coordinate transformation relationship can be obtained, as Eqs. (18) and (19).
In order to facilitate the solution, here is some simplification. It is assumed that the intersection of the camera optical axis and the target surface is at the centre of the image, and the rotation axis passes through the centre of the image. Thus, ${u_0} = {v_0} = 0$, ${T_x} = {T_y} = 0$, ${T_z} = {Z_C}$. Ignoring the difference in pixel size in the x, y direction, it can be assumed that $k = dx = dy$ and ${f_i} = {f \mathord{\left/ {\vphantom {f k}} \right.} k}$. The value of ${R_{ij}}$ is determined by $({\alpha _x},{\alpha _y},{\alpha _z})$. According to the above description of the parameters and Eqs. (18) and (19), it can be derived:
Appendix B
The numerical simulation experimental conditions in Table 2 were that ${k_1}$. and ${\alpha _i}(i = x,\;y,\;z)$ were unchanged, and only ${P_S}$ was changed. The numerical simulation experimental conditions in Table 3 were that ${k_1}$ and ${P_S}$ were unchanged, and only ${\alpha _i}$ was changed. The numerical simulation experimental conditions in Table 4 were that ${P_S}$ and ${\alpha _i}$ were unchanged, and only ${k_1}$ was changed. Reference values of the unchanged parameters are listed in the last row of the table whereas reference values of the changed parameters are listed in the first column of the table.
Funding
National Key R&D Program of China (2017YFB1103900); National Natural Science Foundation of China (11572041, 11972084); National Major Science and Technology Projects of China (2017-VI-0003-0073); Beijing Natural Science Foundation (1192014).
Acknowledgments
The authors are grateful to all of those who were involved in this work.
Disclosures
The authors declare no conflicts of interest.
References
1. J.-E. Dufour, F. Hild, and S. Roux, “Integrated digital image correlation for the evaluation and correction of optical distortions,” Opt. Lasers Eng. 56, 121–133 (2014). [CrossRef]
2. B. Pan, L. Yu, J. Yuan, Z. Shen, and G. Tang, “Determination of Viscoelastic Poisson’s Ratio of Solid Propellants using an Accuracy-enhanced 2D Digital Image Correlation Technique,” Propellants, Explos., Pyrotech. 40(6), 821–830 (2015). [CrossRef]
3. B. Pan, “Digital image correlation for surface deformation measurement: historical developments, recent advances and future goals,” Meas. Sci. Technol. 29(8), 082001 (2018). [CrossRef]
4. N. T. Vo, R. C. Atwood, and M. Drakopoulos, “Radial lens distortion correction with sub-pixel accuracy for X-ray micro-tomography,” Opt. Express 23(25), 32859–32868 (2015). [CrossRef]
5. J. Zhao, Z. Liu, and B. Guo, “Three-dimensional digital image correlation method based on a light field camera,” Opt. Lasers Eng. 116, 19–25 (2019). [CrossRef]
6. Z. Gao, Q. Zhang, Y. Su, and S. Wu, “Accuracy evaluation of optical distortion calibration by digital image correlation,” Opt. Lasers Eng. 98, 143–152 (2017). [CrossRef]
7. A. Gonzalez and J. Meneses, “Accurate calibration method for a fringe projection system by projecting an adaptive fringe pattern,” Appl. Opt. 58(17), 4610–4615 (2019). [CrossRef]
8. C. S. Fraser, “Digital camera self-calibration,” ISPRS J. Photogramm. Remote Sens. 52(4), 149–159 (1997). [CrossRef]
9. R. I. Hartley, “Theory and practice of projective rectification,” Int. J. Comput. Vis. 35(2), 115–127 (1999). [CrossRef]
10. Q. Dai, R. Xiong, and S. Li, “An Optimization Based Vision Calibration Method for PTZ Camera's Errors in Model and Execution,” Procedia Eng. 15, 585–593 (2011). [CrossRef]
11. Z. Zhang, “A flexible new technique for camera calibration,” IEEE Trans. Pattern Anal. Mach. Intell. 22(11), 1330–1334 (2000). [CrossRef]
12. P. Jin and X. Li, “Correction of image drift and distortion in a scanning electron microscopy,” J. Microsc. 260(3), 268–280 (2015). [CrossRef]
13. Y. Hou, H. Zhang, J. Zhao, J. He, H. Qi, Z. Liu, and B. Guo, “Camera lens distortion evaluation and correction technique based on a colour CCD moiré method,” Opt. Lasers Eng. 110, 211–219 (2018). [CrossRef]
14. Y. Kim, G. Park, J.-H. Jung, J. Kim, and B. Lee, “Color moiré pattern simulation and analysis in three-dimensional integral imaging for finding the moiré-reduced tilted angle of a lens array,” Appl. Opt. 48(11), 2178–2187 (2009). [CrossRef]
15. V. Saveljev and S.-K. Kim, “Simulation and measurement of moiré patterns at finite distance,” Opt. Express 20(3), 2163–2177 (2012). [CrossRef]
16. H. Zhang, C. Wu, Z. Liu, and H. Xie, “A curved surface micro-moiré method and its application in evaluating curved surface residual stress,” Meas. Sci. Technol. 25(9), 095002 (2014). [CrossRef]
17. L. Zhanwei and G. Jianxin, “Deformation-pattern-based digital speckle correlation for coefficient of thermal expansion evaluation of film,” Opt. Express 19(18), 17469–17479 (2011). [CrossRef]
18. J. Dong, Z. Liu, and J. Gao, “Multi-Parameter Inversion and Thermo-Mechanical Deformation Decoupling using I-DIC,” Exp. Mech. 57(1), 31–39 (2017). [CrossRef]
19. L. Junfei, Z. Youqi, W. Jianglong, X. Yang, W. Zhipei, M. Qinwei, and M. Shaopeng, “Formation mechanism and a universal period formula for the CCD moiré,” Opt. Express 22(17), 20914–20923 (2014). [CrossRef]
20. T. S. Smith, B. K. Bay, and M. M. Rashid, “Digital volume correlation including rotational degrees of freedom during minimization,” Exp. Mech. 42(3), 272–278 (2002). [CrossRef]
21. E. Verhulp, B. van Rietbergen, and R. Huiskes, “A three-dimensional digital image correlation technique for strain measurements in microstructures,” J. Biomech. 37(9), 1313–1320 (2004). [CrossRef]
22. M. M. Noel, “A new gradient based particle swarm optimization algorithm for accurate computation of global minimum,” Appl. Soft. Comput. 12(1), 353–359 (2012). [CrossRef]
23. M. Jenkinson and S. Smith, “A global optimisation method for robust affine registration of brain images,” Med. Image Anal. 5(2), 143–156 (2001). [CrossRef]
24. E. Ergun, S. Tasgetiren, and M. Topcu, “Determination of SIF for patched crack in aluminum plates by the combined finite element and genetic algorithm approach,” Fatigue Fract. Eng. Mater. Struct. 31(11), 929–936 (2008). [CrossRef]
25. S. Yoneyama, H. Kikuta, A. Kitagawa, and K. Kitamura, “Lens distortion correction for digital image correlation by measuring rigid body displacement,” Opt. Eng. 45(2), 023602 (2006). [CrossRef]
26. X. Dai and H. Xie, “A simple and residual-layer-free solute–solvent separation soft lithography method,” J. Micromech. Microeng. 25(9), 095013 (2015). [CrossRef]
27. X. Dai and H. Xie, “Versatile specimen-grating fabrication technique for moiré method based on solute-solvent separation soft lithography,” Opt. Mater. Express 6(5), 1530–1544 (2016). [CrossRef]