Optik 125 (2014) 4795–4798
Contents lists available at ScienceDirect
Optik journal homepage: www.elsevier.de/ijleo
Line-scan CCD camera calibration in 2D coordinate measurement Weihong Ma ∗ , Tao Dong, Hui Tian, Jinping Ni Shaanxi Key Laboratory of Photoelectricity Measurement and Instrument Technology, Xi’an Technological University, Xi’an 710021, China
a r t i c l e
i n f o
Article history: Received 4 September 2013 Accepted 10 April 2014 Keywords: Coordinate measurement Charge-coupled-devices imagers Camera calibration Distortion
a b s t r a c t We present a line-scan camera calibration method in a plane not perpendicular to but parallel to the optical axis, without requiring the camera motion or a complex calibration pattern. A random 2D reference coordinate system in the calibration plane can be used, images of a rod perpendicular to the calibration plane at known coordinates are captured by the camera, the relation between the given coordinates and the rod image centroid position are analyzed based on a reduced pinhole model and image processing, and then the camera parameters and distortion factors are all estimated. These distortion factors build a sample relation only between the image position in theory and in practice, and they do not change with object position. Two wide-angle line-scan cameras that are used in a 2D-coordinate measurement system are calibrated by this method; the application results illustrate the effectiveness and convenience of this method. © 2014 Elsevier GmbH. All rights reserved.
1. Introduction The lens-scan camera has been widely used in motion detection [1], automatic inspection [2], and remote sensing [3] because it is easier achieve a higher resolution (which may reach 12k pixels) and line-sample rate than it is with an area (2D) camera. Calibration is a necessary step for these applications. Most existing camera calibration techniques are applied to area cameras, such as calibration using known 3D-coordinate targets, self-calibration by using image information only [4] and calibration based on active vision [5]. There is relatively little research on calibration methods for line-scan cameras [6]. In order to extend mature technology, especially the pinhole model, to be applied to the line-scan camera, some calibration methods [7,8] in 3D space have been proposed. A multi-line pattern has been proposed to calculate the extrinsic parameters and the pixel projected by the primary ray; it is necessary to move the calibration pattern or camera in a special direction with known space. An improved pattern [6] with two sets of coplanar lines has been proposed for line-camera calibration without relative movement between the line-scan camera and the calibration pattern, but without considering distortion. A line-scan camera consists of a line-scan image sensor and an optical lens; typically, the line-shape sensor is long in order to obtain a high resolution or dynamic range, and needs wide-angle lens matching, especially when used in close-range photogrammetry, such as 2D coordinate measurement. Under this condition, the distortion of the lens; the
∗ Corresponding author. E-mail address:
[email protected] (W. Ma). http://dx.doi.org/10.1016/j.ijleo.2014.04.057 0030-4026/© 2014 Elsevier GmbH. All rights reserved.
rotation, shift, and bending of the linear sensor; and the mismatch of the sensor with the lens should all be involved in the camera calibration [9]. A fringe pattern that has regular spacing and is perpendicular to the optical axis is used to detect the distortion factors [10], however, these distortion factors are efficient and only apply to image capture of the object at a position that is the same as that of the calibration pattern, errors occur if the object position is changed. In fact, the image captured by a line-scan camera in a single sample is a projection line of a fan-shaped plane in object space. The imaging procedure can be expressed by a reduced form of the pinhole model; in this reduced form, the projection plane is defined by the optical axis and the sensor line. Moreover, in order to ensure that the distortion factors are efficient even if the object position and direction are not strictly the same as the calibration pattern, we are much more concerned with knowing the relation between the image position and the projection direction rather than the position of the object. To resolve these problems, in this paper, we report for the first time, to the best of our knowledge, a novel method for calibrating line-scan cameras in the projection plane, without requiring information about the motion of the camera or calibration pattern. Our scheme uses a flat iron panel with a coordinate map set a bit behind the projection plane; when we set a magnetic rod perpendicular to the flat panel at a special set of coordinates, the rod image can be captured by the camera under calibration, and the pixel position of the rod image can be obtain by sub-pixel digital image processing; thus, we can build a relational expression between image position (1D) and object position at the calibration panel (2D).
4796
W. Ma et al. / Optik 125 (2014) 4795–4798
Fig. 2. Two kinds of image position distortion. (For interpretation of the references to color in text near the reference citation, the reader is referred to the web version of this article.)
Fig. 1. Diagram of line-scan camera imaging model.
2. Line-scan camera imaging model As shown in Fig. 1, a line-scan camera consists of an image sensor and a lens; a linear background light provides a background image when no objects are in view. When we set a rod along z at A(x, y), the rod will change the light intensity and the image formed by the lens at M on the image sensor; thus, in image space: tan(a) =
(M − M0 ) × c l
(1)
where c is pixel space, l is image distance, M0 is the position on the sensor projected by the primary ray, and M is rod image position. We define the camera coefficient n as follows: c n= (2) l from Fig. 1, in object space: a = tan
y − y 0
x − x0
−
(3)
where (x0 , y0 ) are the coordinates of the principal point of lens in the reference coordinate system defined by the coordinate map posted on the calibration panel. From Eqs. (1)–(3), the relational expression between the image position and object position can be obtained as follows: y − y0 = tan(arctan((M − M0 ) × n) + ) (4) x − x0 We can place the magnetic rod perpendicular to the calibration panel at a known position (x, y) and capture the rod image to estimate the image position M by using the sub-pixel centroid algorithm. There are five unknown parameters in Eq. (4); we always estimate these camera internal and external parameters after having at least five pairs of object coordinates (x, y) and the image position M. From the standpoint of distortion, the rod positions in the calibration should be near the optical axis to minimize distortion. We propose a sample method to find these five parameters by placing the rod at some special positions. According to Eq. (4), for a given camera, the positions of the calibration rod that result in equal image positions are collinear with principal point (x0 , y0 ) of lens, so we can find several lines that all pass through (x0 , y0 ) by changing the rod position and monitoring the image position, and then determine (x0 , y0 ) by computing the intersection points of
these lines; furthermore, n, M0 , and l can be determined by solving equations. After we obtained the camera parameters, as described above, we always determined the theoretical image position M according to Eq. (1), due to the distortion of the lens; the rotation, shift, and bending of the linear sensor; and the mismatch of the sensor with the lens. There are errors between the image position M estimated by the image processing and the computed M , especially on both sides of the sensor. For a particular position of the calibration rod, we can determine M according to Eq. (4), and estimate the corresponding M by digital image processing. If we move the rod to a certain space to make the image position in the sensor move from one side to another side, we will have several pairs of M and M . Further, we estimate the distortion factor by polynomial fitting to the M vs. M data; many practical calibrations indicate that a cubic polynomial is sufficient for such fitting. Because the distortion calibration is carried out in the plane defined by the sensor line and the lens axis, the distortion factors are effective for viewing at any position from any direction, regardless of the distance from the camera, which is very convenient and useful in applications. Moreover, these distortion factors build a sample relation only between the image position in theory and in practice, and do not change with object position. Like a “black box”, they indicate the synthetic effects of the distortion of the lens; the rotation, shift, and bending of the linear sensor; and the mismatch of the sensor with the lens. To obtain excellent distortion correction performance with our method, the wide-angle line-scan camera can be used in more fields with a compact setup. Two kinds of calibration results from practical calibration are shown in Fig. 2: the red solid line indicates the image position in theory, and the black dotted line indicates the image position in practice. It can be seen that the errors are small near the center of the sensor, and large to the sides. Meanwhile, the errors are not always symmetrical relative to the sensor center, as shown in the upper part of Fig. 2. This configuration indicates that the lens axis is not perfectly aligned to the center of the sensor center. In the case shown in the lower part of Fig. 2, all positions are father to right, which indicates that the optical axis of the lens is not perfectly perpendicular to the sensor line, and there is an angle between the sensor and the primary plane of the lens. To provide a large amount of information about the camera configuration, the distortion calibration results may be used in camera assembly quality estimation. For a given camera, the internal parameters and distortion factor are known; their calibration results are unaffected by the reference coordinate system, so, calibrated by this method, the internal parameters n, M0 , l, and the distortion factors are effective wherever the camera is used. If calibration is not carried out for the conditions of the application, only the external parameters (x0 , y0 ) and are estimated again; they can be calibrated only at several special positions in the calibration plane. Based on Eq. (4), the origin of the application coordinate system and three positions from which the rod should be imaged to M0 are recommended for simplifying the equation and estimating the external parameters.
W. Ma et al. / Optik 125 (2014) 4795–4798
4797
3. Calibration experiments and results To investigate the performance of this new method, we calibrate two line-scan CCD cameras with Nikon AF 14 mm f/2.8D ED lenses equipped for application condition; the cameras have 2048 pixels, and can record up to 68,000 lines per minute. The two cameras are used for the 2D-coordinate measurement illustrated in Fig. 3. The 2D coordinates have a rigid framework, and the framework carries two line-scan cameras mounted orthogonally with a shaped linear light bars which are mounted in the framework also. When an object enters the field of view of the cameras, it causes a change in light intensity that is detected by the two cameras at the same time; this change is related to the X and Y positions of the object. Then the X and Y coordinates are computed from the parameters of the cameras and the respective image positions at the two cameras. The two multi-line images are presented in the lower part of Fig. 1: the first is the image of the fixed object; the
Fig. 3. Picture of the wide-angle line-scan camera calibration installation under conditions simulating the application.
second is the image of the moving object. Images of the object are captured only when it is in the field of view. Prior to use, cameras must be calibrated in order to obtain their parameters. As shown in Fig. 3, the calibration panel is fixed a bit behind the camera with a coordinate map affixed to it, and the background linear light bars with a silt aperture are adjusted to be parallel to the calibration panel. The background light not only provides good illumination for both of the cameras, but it also provides a reference line for the cameras, which can be used when adjusting them to be coplanar with each other. When we place a rod vertically in the panel, the camera will capture the rod image. These cameras parameters calibration results are shown in Table 1. We can
Table 1 Cameras calibration results.
X coordinate of lens primary point x0 Y coordinate of lens primary point y0 Camera coefficient n Pixel projected by primary ray M0 Camera dip angle /◦ C Distortion factor C1 Distortion factor C2 Distortion factor C3 Distortion factor C4
Camera 1
Camera 2
−796.95 −810.63 6.95e−4 1051.74 −46.54 −47.01 1.12 −1.05e−5 2.92e−8
733.70 −805.56 7.00e−4 1014.65 45.75 −30.73 1.09 −9.35e−5 2.84e−8
Table 2 Coordinates measured results. Index
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Max Min
Values manual measured/mm
Values system measured/mm
Errors/mm
X
Y
X
Y
X
Y
0.00 100.00 200.00 −100.00 −200.00 −300.00 −400.00 −500.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 200.00 300.00 400.00 500.00 −400.00 −500.00 −300.00 −200.00 −100.00 200.00 −100.00 −200.00 −400.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 200.00 300.00 450.00 −100.00 −200.00 −300.00 −400.00 −500.00 −600.00 −600.00 −600.00 −600.00 −600.00 −600.00 −600.00 −600.00 −600.00 −600.00 200.00 100.00 200.00 200.00
−0.56 99.39 198.94 −100.44 −200.57 −300.31 −399.99 −501.19 −1.04 −0.59 −0.86 −0.45 −0.19 −0.95 −0.38 −0.53 −0.25 100.20 199.66 299.57 399.65 499.43 −398.71 −499.50 −299.87 −199.67 −99.12 199.24 −100.28 −200.19 −400.10
−0.44 −0.12 −0.57 −0.61 −0.04 −0.57 −0.60 −0.05 99.60 199.67 299.07 449.00 −100.29 −200.24 −299.85 −400.03 −499.88 −599.75 −599.87 −599.63 −600.06 −600.85 −600.14 −600.79 −600.36 −600.23 −599.99 199.86 100.07 199.24 198.54
−0.56 −0.61 −1.06 −0.44 −0.57 −0.31 0.01 −1.19 −1.04 −0.59 −0.86 −0.45 −0.19 −0.95 −0.38 −0.53 −0.25 0.20 −0.34 −0.43 −0.35 −0.57 1.30 0.50 0.13 0.33 0.88 −0.76 −0.28 −0.19 −0.10
−0.44 −0.12 −0.57 −0.61 −0.04 −0.57 −0.60 −0.05 −0.40 −0.33 −0.93 −1.00 −0.29 −0.24 0.15 −0.03 0.12 0.25 0.13 0.37 −0.06 −0.85 −0.14 −0.79 −0.36 −0.23 0.01 −0.14 0.07 −0.76 −1.46
1.30 −1.19 0.55
0.37 −1.46 0.42
4798
W. Ma et al. / Optik 125 (2014) 4795–4798
calibrate the camera dip angle with high precision by method presented in this paper, so it is not necessary to set camera at designed position strictly with a time-consuming work. Because the calibration and distortion correction are carried out under the conditions of the application, the compact 2D-coordinate measurement system can be used directly, by just reading the rod position with the unaided eye, and the measurement maximum errors are decreased from 42 mm before distortion correction to 1.5 mm over a range of 1000 mm × 1000 mm shown as Table 2. Because the distortions are corrected, the errors have no pattern over the whole test range, and if necessary, higher precision can be obtained by use of more accurate rod-positioning devices and a larger calibration range. From the above, the system illustrated in Fig. 3 can easily be translated into a line-scan camera calibration device. After adjusting the camera alignment with respect to that of the linear light bar, the calibration time of one camera is about 30 min.
theory and in practice, and they do not change with object position. Like a “black box”, they indicate the synthetic effects of the distortion of the lens; the rotation, shift, and bending of the linear sensor; and the mismatch of the sensor with the lens. The calibration results illustrate the effectiveness and convenience of the method presented in this paper. Finally, this new arrangement is a valuable, low cost, and versatile calibration method for use with line-scan cameras, particularly the wide-angle line-scan camera. Acknowledgments This work was supported by the National Natural Science Foundation of China (60972005). The setup was developed under the Program for Innovative Science and Research Team of Xi’an Technological University supported. References
4. Conclusions In summary, we have reported for the first time, to the best of our knowledge, a method for line-scan camera calibration in a plane not perpendicular to but parallel to the optical axis, without requiring for camera motion or a complex calibration pattern. The new method does not rely strictly on the reference coordinate system. We presented a mathematical representation of the relation between the 2D coordinates of a rod in the calibration plane and the rod image centroid in absolute pixels, based on a reduced pinhole model and digital image processing. This method consists of two steps. First, calibration of camera internal and external parameters are carried out near the optical axis. Second, images of the rod at various positions are captured. These positions do not need to be constrained to a specific set of coordinates. We find the differences between the practical image position and the image positions computed using the mathematical representation, and we estimate the distortion factors by cubic polynomial fitting. These distortion factors build a sample relation only between the image position in
[1] L.L. Ai, F. Yuan, Z.L. Ding, An exterior attitude measurement system for spatial object based on linear CCD, Opt. Precis. Eng. 16 (1) (2008) 161–165. [2] C. Wiegand, M. Herrmann, S. Bachtler, J. Klier, D. Molter, J. Jonuscheit, R. Beigang, A pulsed THz imaging system with a line focus and a balanced 1-D detection scheme with two industrial CCD line-scan cameras, Opt. Express 18 (2010) 5595–5601. [3] S. Zhu, W. Shi, Y. Zhang, B. Zhu, Precision comparison of several algorithms for approximate rectification of linear array push-broom imagery, J. Remote Sens. 3 (2004) 220–226. [4] C. Ricolfe-Viala, A.-J. Sanchez-Salmeron, E. Martinez-Berti, Calibration of a wide angle stereoscopic system, Opt. Lett. 36 (2011) 3064–3066. [5] S. Thibault, A. Arfaoui, P. Desaulniers, Cross-diffractive optical elements for wide angle geometric camera calibration, Opt. Lett. 36 (2011) 4770–4772. [6] C.A. Luna, M. Mazo, J.L. Lazaro, J.F. Vazquez, Calibration of line-scan cameras, IEEE Trans. Instrum. Meas. 59 (8) (2010) 2185–2190. [7] H.T. Zhang, F.J. Duan, K.Q. Ding, S. Ye, Study on Calibration of Linear CCD Based on Two Steps, Acta Metrol. Sin. 28 (4) (2007) 311–313. [8] J. Draréni, S. Roy, P. Sturm, Plane-based calibration for linear cameras, Int. J. Comput. Vis. 91 (2) (2011) 146–156. [9] B. Hui, G. Wen, Z. Zhao, D. Li, Line-scan camera calibration in close-range photogrammetry, Opt. Eng. 51 (5) (2012), 053602-1–053602-12. [10] H. Luo, P. Chen, J. Gu, Y. Xia, B. Li, A new method of lens distortion calibration of linear CCD measurement system, Semicond. Optoelectron. 3 (2009) 441–443, 459.