A Camera Model for Line-Scan Cameras with Telecentric Lenses

We propose a camera model for line-scan cameras with telecentric lenses. The camera model assumes a linear relative motion with constant velocity between the camera and the object. It allows to model lens distortions, while supporting arbitrary positions of the line sensor with respect to the optical axis. We comprehensively examine the degeneracies of the camera model and propose methods to handle them. Furthermore, we examine the relation of the proposed camera model to affine cameras. In addition, we propose an algorithm to calibrate telecentric line-scan cameras using a planar calibration object. We perform an extensive evaluation of the proposed camera model that establishes the validity and accuracy of the proposed model. We also show that even for lenses with very small lens distortions, the distortions are statistically highly significant. Therefore, they cannot be omitted in real-world applications.


Introduction
Line-scan cameras play an important role in machine vision applications because they offer a better resolution per price in comparison to area-scan cameras. Today, line-scan cameras with lines of up to 16,384 pixels are available (Steger et al. 2018, Chapter 2.3.4). The height of the resulting image is essentially unlimited because it corresponds to the number of 1D images acquired over time, as described in more detail below. Hence, several hundred megapixels per image can be achieved easily.
In contrast to area-scan cameras, the sensor of a line-scan camera consists of a single line of photosensitive elements. Consequently, the image that is obtained from a line-scan camera would be one pixel high. To obtain a 2D image that can be processed in computer vision applications, multiple 1D images are stacked over time while moving the sensor with respect to the object that is to be imaged. In machine vision applications, the relative motion is realized either by  MVTec Software GmbH, Arnulfstraße 205, 80634 Munich, Germany mounting the camera above the moving object or by moving the camera across the stationary object , Chapter 2.3.1.1). The motion can be effected, for example, by a conveyor belt, a linear motion slide, or other linear actuators. For practical applications, it is therefore not sufficient to calibrate the single sensor line only. Instead, also the process of creating the 2D image must be included in the calibration.
Obviously, the resulting image strongly depends on the relative motion of the camera with respect to the object. In almost all machine vision applications, a linear motion is applied. This requires the camera to move with constant velocity along a straight line relative to the object while the orientation of the camera is constant with respect to the object. Furthermore, the motion must be equal for all images (Gupta and Hartley 1997). In other application domains, e.g., in remote sensing, more general motion models are applied. For example, the motion of an airborne or spaceborne camera can be modeled by discrete positions and orientations (Haala et al. 1998) or approximated by polynomial functions (Lee et al. 2000;Poli 2007). Since our focus is on machine vision applications, we will assume a linear motion in this paper. In practice, a linear motion can be realized by using appropriate encoders that ensure a constant speed (Steger et al. 2018, Chapter 2.3.1.1;Beyerer et al. 2016, Chapter 6.8).
Because typical readout rates of line-scan cameras are in the range of 10-200 kHz , Chapter 2.3.1.1), in some applications the exposure time of each line needs to be very short. Therefore, line-scan applications often require a very bright illumination. Fortunately, the illumination only needs to cover the narrow footprint of the sensor line, and hence often line-shaped LED or halogen light sources are used. Another consequence of the short exposure time is that often an open diaphragm, i.e., a large aperture, is used to maximize the amount of light that passes through the lens. This must be taken into account when choosing an appropriate hardware setup because a large aperture severely limits the depth of field.
For line-scan cameras with linear motion and a conventional entocentric (i.e., perspective) lens, an appropriate camera model and calibration procedure have been described in Steger et al. (2018, Chapter 3.9.3). Because of the perspective projection of an entocentric lens, objects that are closer to the lens produce a larger image. Therefore, this kind of line-scan camera performs a perspective projection in the direction of the line sensor and a parallel projection perpendicular to the line sensor.
In contrast to entocentric lenses, telecentric lenses perform a parallel projection of the world into the image (Steger et al. 2018, Chapter 2.2.4). In many machine vision applications, and especially in measurement applications, telecentric lenses are preferred over entocentric lenses because they eliminate perspective distortions, which is especially important for gauging applications when non-flat objects must be inspected. Also, self-occlusions of objects that would occur because of perspective distortions are avoided (Luster and Batchelor 2012, Chapter 6.1). Steger (2017, Section 4) and Steger et al. (2018, Chapter 2.2.4) show that the placement of the aperture stop is crucial for the projection properties of a lens. For entocentric lenses, the aperture stop is placed between the two focal points of the lens system. For telecentric lenses that perform a parallel projection in object space, the aperture stop is placed at the image-side focal point (Steger et al. 2018, Chapter 2.2.4;Lenhardt 2017, Chapter 4.2.14;Beyerer et al. 2016, Chapter 3.4.5). This effectively filters out all light rays that are not parallel to the optical axis in object space. Owing to the parallel projection in object space, the lens must be chosen at least as large as the object to be imaged.
Because of the advantages of line-scan cameras and telecentric lenses, many machine vision applications would benefit from a camera model for line-scan cameras with telecentric lenses. Obviously, a camera model and an appropriate calibration procedure are essential for accurate 2D measurements in world units. The calibration result facilitates the removal of image distortions and the rectification from the image to a world plane.
In addition to accurate measurement tasks, the calibration of line-scan cameras is important for many other applications. For example, if the motion direction is not perfectly perpendicular to the sensor line, i.e., has a non-zero motion component in the direction of the sensor line, skew pixels will be obtained (Steger et al. 2018, Chapter 3.9.3.4). Furthermore, if the speed of the motion is not perfectly adjusted, rectangular instead of square pixels will be obtained. Both effects cause many image processing operations that (often implicitly) assume square pixels to return false or unusable results. Examples are segmentation and feature extraction (e.g., the computation of moments or shape features from segmented regions), 2D template matching approaches, and stereo matching. Unfortunately, a perfect alignment of the camera is very cumbersome to realize in practice. For example, a sensor line with 16,384 pixels would have to be mounted with an accuracy of 1/140 • in order to keep the total skew of the image below one pixel. Camera calibration allows us to rectify the images in order to eliminate lens distortions or skew, for example, and to ensure square pixels, hence making an exact alignment of the sensor line unnecessary.
In this paper, we introduce a versatile camera model for line-scan cameras with telecentric lenses. We first discuss work relating to camera models for entocentric line-scan cameras in Sect. 2. We then discuss the camera models for area-scan and entocentric line-scan cameras on which our model is based in Sect. 3. In Sect. 4, we describe our camera model for telecentric line-scan cameras, the calibration of its parameters, its relation to affine cameras, as well as the camera model's degeneracies and how to handle them. Various experiments that establish the validity and accuracy of the model are described in Sect. 5. Finally, Sect. 6 concludes the paper.
Our main contributions are the following: -We propose a comprehensive and versatile camera model for line-scan cameras with telecentric lenses. The camera model allows to model a very large class of lens distortions. It does not assume that the sensor line is aligned with the optical axis of the lens. To the best of our knowledge, no camera model for line-scan cameras with telecentric lenses has ever been proposed in the scientific literature. -The parameterization of the camera model is very intuitive for machine vision users. All parameters have a physical meaning that is easy to understand. -We prove that for the division model of lens distortions, the projection of a 3D point to the image can be computed analytically. -We establish that images of telecentric line-scan cameras with lens distortions and a potential skew can be rectified to have no lens distortions and no skew without knowing the 3D geometry of the scene in the image. This is in contrast to line-scan cameras with entocentric lenses, where this is impossible in general.
-We propose a camera calibration algorithm that determines the camera parameters using images of a planar calibration object. -We examine how telecentric line-scan cameras without lens distortions are related to affine cameras and prove that every affine camera be regarded as a telecentric line-scan camera with appropriately chosen interior orientation parameters. We also show that every telecentric line-scan camera without lens distortions has an equivalent area-scan camera with a bilateral telecentric tilt lens. -We comprehensively examine the degeneracies of the camera model and propose methods to handle them. -We perform an extensive evaluation that establishes the validity and versatility of our camera model. -We show that even for lenses with very small lens distortions, the distortions are statistically highly significant and therefore cannot be omitted in real-world applications.

Related Work
We have been unable to find any research relating to camera models for line-scan cameras with telecentric lenses. The research closest to the camera model we will propose is research on camera models for line-scan cameras with entocentric lenses. Therefore, we will discuss these approaches in this section. In our experience, it is very important for machine vision users to have a camera model with explicit parameters that are easy to understand and have a physical meaning. Hence, in the taxonomy of Sturm et al. (2010, Section 3), we require a global and not a local or discrete camera model. Therefore, although in principle any camera could be modeled by a generalized camera model, such as those described by Sturm et al. (2010, Sections 3.2 and 3.3) or Ramalingam and Sturm (2017), we do not consider and discuss these approaches. Camera models for line-scan cameras with entocentric lenses can be grouped into two categories: static and dynamic camera models. In static camera models, the motion of the camera is not taken into account in the camera model and therefore is not calibrated. In contrast, dynamic camera models take the camera motion into account and calibrate it. In dynamic models, a linear camera motion is typically assumed. As discussed in Sect. 1, the ability to model the linear camera motion is essential in machine vision applications. Therefore, static camera models are less relevant there.
Another distinction is whether a camera model is able to model lens distortions. Machine vision applications often have very high accuracy requirements that can only be achieved if the camera model is able to model lens distortions accurately. Furthermore, the large size of the sensors also makes the ability to model lens distortions essential. For example, a maximum lens distortion of 0.1% (a figure often specified in data sheets of telecentric lenses) will cause a distortion of more than 8 pixels at the left and right edges of the image for a line-scan sensor with 16,384 pixels.
Even if a camera model supports lens distortions, often the model assumes that the sensor line is mounted exactly behind the principal point, i.e., that the optical axis intersects the sensor line. In a real camera, this assumption may not be fulfilled. In fact, in photogrammetry and remote sensing, multiple sensor lines are often mounted behind the lens at large distances to the principal point (Chen et al. 2003). Therefore, to provide general applicability, the camera model should be able to represent cameras in which the line sensor is not mounted directly behind the principal point.
A final distinction is whether a planar (2D) or a 3D calibration object is used to calibrate the camera. In machine vision applications, there is often limited space in the machine where the camera must be calibrated. Here, 3D calibration objects may be too cumbersome to handle or may not even fit into the available space. In contrast, planar calibration targets typically are much easier to handle for the users. Furthermore, a backlight illumination is used frequently. For these applications, 2D calibration targets are much easier to manufacture. Finally, 2D calibration targets can be produced more cheaply and accurately than 3D calibration objects.
As a result of the above discussion, we require that the camera model is dynamic, supports lens distortions, allows the line sensor to be mounted anywhere with respect to the principal point or optical axis, and uses a planar calibration object. In the following, we will not discuss every camera model in detail. Instead, we will only mention the requirements that the respective model does not fulfill.
Dynamic entocentric line-scan camera models are proposed by Gupta and Hartley (1997), MVTec Software GmbH (2005a, b), Steger et al. (2008Steger et al. ( , 2018, Draréni et al. (2011), Hui et al. (2012a Donné et al. (2017) and Zhang et al. (2018). Lens distortions are not modeled in the camera models by Gupta and Hartley (1997), Draréni et al. (2011), Hui et al. (2012b, Donné et al. (2017) and Zhang et al. (2018). The camera models by Hui et al. (2012aHui et al. ( , 2013 take into account lens distortions, but assume that the sensor is mounted exactly behind the principal point. 3D calibration objects are used by Hui et al. (2012a, b). Furthermore, Hui et al. (2013) use an additional area-scan camera to calibrate the line-scan camera, which is undesirable for the reasons that were mentioned previously. A camera model that fulfills all of the above requirements (i.e., a dynamic camera model that supports lens distortions, allows an arbitrary line sensor position with respect to the principal point, and uses a planar calibration object) is described by MVTec Software GmbH (2005a, b) and Steger et al. (2008Steger et al. ( , 2018 . We will describe it in more detail in Sect. 3.2 and use it to develop our proposed model for telecentric line-scan cameras.

Fundamental Camera Models
The camera model for line-scan cameras with telecentric lenses that we will propose in Sect. 4 is based on camera models for area-scan cameras and on a camera model for line-scan cameras with entocentric lenses. Therefore, we will discuss these models first. Our presentation is based on the descriptions in Steger et al. (2018, Chapter 3.9) and Steger (2017, Section 6).
We start by discussing camera models for area-scan cameras since we will later model line-scan cameras conceptually as one particular line of an area-scan camera. This will enable us to model that the line sensor may not be perfectly aligned with the optical axis of the lens. This, in turn, will allow us to model a more general class of lens distortions for line-scan cameras.
Furthermore, we will describe some of the properties of the existing camera models. This will allow us to compare the properties of the camera model for telecentric line-scan cameras with those of the existing camera models in Sect. 4.

Camera Models for Area-Scan Cameras
The camera model for area-scan cameras is capable of modeling a multi-view setup with n c cameras (Steger 2017, Section 6.1). In this paper, we will only consider single cameras. Therefore, we simplify the discussion to this case.
To calibrate the camera, n o images of a calibration object in different poses are used. Each pose l (l = 1, . . . , n o ) of the calibration object defines a transformation from the calibration object coordinate system to the camera coordinate system. The transformation of a point p o = (x o , y o , z o ) is given by where t l = (t l,x , t l,y , t l,z ) is a translation vector and R l is a rotation matrix that is parameterized by Euler angles: The transformation can also be written as a 4 × 4 homogeneous matrix: where it is silently assumed that p l and p o have been extended with a fourth coordinate of 1. As discussed by Steger (2017, Section 6.1) and Ulrich and Steger (2019), the origin of the camera coordinate system lies at the center of the entrance pupil of the lens.
Next, the point p l = (x l , y l , z l ) is projected into the image plane. For entocentric lenses, the projection is given by: where c is the principal distance of the lens. For telecentric lenses, the projection is given by: where m is the magnification of the lens. 1 Subsequently, the undistorted point (x u , y u ) is distorted to a point (x d , y d ) . We support two distortion models (Steger 2017, Section 6.1; Steger et al. 2018, Chapter 3.9.1.3): the division model (Lenz 1987(Lenz , 1988Lenz and Fritsch 1990;Lanser et al. 1995;Lanser 1997;Blahusch et al. 1999;Fitzgibbon 2001;Steger 2012) and the polynomial model (Brown 1966(Brown , 1971. In the division model, the undistorted point (x u , y u ) is computed from the distorted point by: where r 2 d = x 2 d + y 2 d . The division model can be inverted analytically: where r 2 u = x 2 u + y 2 u . The division model only supports radial distortion.
The polynomial model supports radial as well as decentering distortions. The undistorted point is computed by: The polynomial model cannot be inverted analytically. The computation of the distorted point from the undistorted point must be performed by a numerical root finding algorithm. Finally, the distorted point (x d , y d ) is transformed into the image coordinate system: Here, s x and s y denote the pixel pitches on the sensor and (c x , c y ) is the principal point. Note that x refers to the horizontal axis of the image (increasing rightward) and y to the vertical axis (increasing downward).
The calibration of the camera model is described in detail in Steger (2017, Sections 9 and 10).

Remark 1
The above parameterization is very intuitive for machine vision users (Steger 2017, Section 6.1). All parameters have a physical meaning that is easy to understand. Approximate initial values for the interior orientation parameters simply can be read off the data sheets of the camera (s x and s y ) and the lens (c or m) or can be obtained easily otherwise (the initial values for the principal point can be set to the center of the image and the distortion coefficients can typically be set to 0). Furthermore, the calibration results are easy to check for validity.
Remark 2 For telecentric lenses, (c x , c y ) is solely defined by the lens distortions (Steger 2017, Remark 2). If there are no lens distortions, (c x , c y ) and (t l,x , t l,y ) have the same effect. Therefore, in this case (c x , c y ) should remain fixed at the initial value specified by the user (typically, the image center).

Remark 3
For telecentric lenses, the pose parameter t l,z obviously cannot be determined. We arbitrarily set it to 1 m (Steger 2017, Remark 4).

Remark 4
For telecentric cameras and planar calibration objects, the rotation part of the pose can only be determined up to a twofold ambiguity from a single camera (Steger 2017, Remark 5). This is a special case of a Necker reversal (Shapiro et al. 1995, Section 4.1) when the object is planar. The two sets of pose parameters (α l , β l , γ l ) and (−α l , −β l , γ l ) (with identical translation vectors) result in the same points in the image (Steger 2018, Section 2.4). If a correct exterior orientation of the calibration object is required in the application, the user must resolve this ambiguity by selecting the correct pose based on prior knowledge.
Remark 5 An operation that we will use below is the calculation of the optical ray of an image point (also called camera ray or line of sight). We first invert (8): Then, we rectify the lens distortions by applying (5) or (7). Now, for entocentric lenses, the optical ray is given by: while for telecentric lenses, it is given by: Remark 6 In machine vision applications, it is often desirable to remove the lens distortions from an image or from data, such as subpixel-precise contours, that were extracted from an image. For example, fitting a line to a contour only returns useful results if the lens distortions have been removed. Since (5) and (7) represent transformations that are performed purely within the image plane, this can easily be achieved. Furthermore, often it is also desirable to remove perspective distortions as well as lens distortions. This can be achieved from a single image if the scene exhibits a known geometry, e.g., a plane, by intersecting the optical ray with the plane , Section 3.9.5.4).

Camera Model for Line-Scan Cameras with Entocentric Lenses
The camera model for line-scan cameras was first described in MVTec Software GmbH (2005a, b) and Steger et al. (2008). Our discussion is based on Steger et al. (2018, Chapter 3.9.3). As described in Sect. 1, we assume that the relative motion between the line-scan camera and the object is linear with constant velocity. Therefore, the camera motion can be described by the motion vector v = (v x , v y , v z ) . The vector v is described in units of meters per scan line in the camera coordinate system (i.e., the units are m Pixel −1 ). 2 This definition of v assumes a moving camera and a fixed object. If the camera is stationary and the object is moving, e.g., on a conveyor belt, we can simply use −v as the motion vector (see Fig. 1).

Fig. 1 Camera model for line-scan cameras with entocentric lenses
The camera model for line-scan cameras is displayed in Fig. 1. The origin of the camera coordinate system lies at the center of the entrance pupil of the lens. The z axis is identical to the optical axis and is oriented such that points in front of the camera have positive z coordinates. The x axis is parallel to the sensor line and perpendicular to the z axis. It points rightward in the image. The y axis is perpendicular to the sensor line and to the z axis such that a right handed coordinate system is obtained.
Like for area-scan cameras, the transformation from the calibration object coordinate system to the camera coordinate system is given by (1). In contrast to area-scan cameras, this exterior orientation refers only to the first line of the image. Since the camera moves relative to the object, the exterior orientation is different for each line. However, because we assume a linear motion, the motion vector v can be used to compute the exterior orientation of all lines. Therefore, the single exterior orientation is sufficient.
Since we want to be able to model line-scan cameras for which the sensor line is not perfectly aligned with the optical axis, we model the sensor line as one particular line of a virtual area-scan camera. We use the principal point (c x , c y ) to model this misalignment (cf. Fig. 1). The semantics of c y are slightly different than for area-scan cameras: c y = 0 signifies that the sensor line is perfectly aligned with the optical axis in the y direction.
The remaining parameters of the model are identical to those of area-scan cameras (see Sect. 3.1): c is the principal distance, the lens distortions are described by (5) or (7), and s x and s y describe the pixel pitch on the sensor.
To compute the projection of a point p c = (x c , y c , z c ) that has been transformed into the camera coordinate sys-tem, 3 we can use the fact that p c moves along the straight line p c − tv, where t denotes the number of scan lines that have been acquired since the first scan line. As the point moves, it must at some point intersect the optical ray of an image point if it projects to a point p s = (x s , 0) on the sensor line. 4 This optical ray is given by (9) and (10).
Let us assume that we have transformed the point p s to a distorted image point p d by (9) . Furthermore, let us call the undistortion function in (5) or (7) . Then, the intersection of the moving point and the optical ray results in the following equation system: The equation system (12), which for both distortion models is a polynomial equation system, must be solved for λ, t, and x d . Once t and x d have been determined, the point is transformed into the image coordinate system by: Thus, the interior orientation of line-scan cameras with entocentric lenses is given by:

Remark 7
The model is overparameterized. The values of c and s x cannot be determined simultaneously. This can be solved by fixing s x at the initial value that was specified by the user. Furthermore, since there is only one image line, s y is only used to specify the principal point in pixels. It has no physical meaning on the sensor and only occurs in the term y d = −s y c y . Therefore, it cannot be determined and is kept fixed at the initial value specified by the user. In practice, s y = s x is typically used.

Remark 8
The value of c y is solely defined by the lens distortions. If there are no lens distortions, c y should remain fixed at the initial value specified by the user (typically, c y = 0 is used).

Remark 9
If c y = 0, the effect of the lens distortions is purely along the sensor line, i.e., in the horizontal direction. If c y = 0, lens distortions will also cause the sensor line to appear bent (Steger et al. 2018, Chapter 3.9.3.4).

Remark 10
The parameters P 1 and P 2 of the polynomial distortion model are highly correlated with other parameters of the entocentric line-scan camera model, especially if the radial distortions are small. Therefore, they typically cannot be determined reliably. Consequently, in practice, they should be set to 0 and should be excluded from the calibration.

Remark 11
In contrast to area-scan cameras, where the aspect ratio of the pixels is determined by s x and s y , the aspect ratio of the pixels is determined by s x and v y for line-scan cameras. Furthermore, in contrast to area-scan cameras, for which we have assumed orthogonal pixels, for line-scan cameras, a nonzero v x will result in pixels that appear skewed (i.e., non-orthogonal). Therefore, to achieve square pixels, it is important that the sensor is aligned to be perpendicular to the motion vector and the motion speed or the line frequency of the camera must be selected appropriately , Chapter 3.9.3.4).
Remark 12 A pure removal of lens distortions is impossible for entocentric line-scan cameras if c y = 0. To remove the lens distortions, we would have to compute the optical ray for an image point and then would have to reproject it into the rectified image. However, if there are lens distortions and if c y = 0, the optical ray in general does not project to a single point in the rectified image. Therefore, a pure removal of lens distortions requires a 3D reconstruction to be available because we can then reconstruct a unique 3D point that we can project into the rectified image. What is possible, on the other hand, is to reproject the image onto a world plane (Steger et al. 2018, Chapter 3.9.5.4). This rectification also removes the lens distortions, of course.

Camera Model for Line-Scan Cameras with Telecentric Lenses
Based on the discussion in Sect. 3, we can now derive the camera model for line-scan cameras with telecentric lenses.

Camera Model
The first step of the camera model is identical to that in Sect. 3.2: We transform points from the calibration object coordinate system to the camera coordinate system by (1). Again, we will call the transformed point p c .
To project the point into the image, we use the same approach as in Sect. 3.2: We intersect the line on which the point moves with the optical ray of the point to which it projects. The equation of the optical ray is given by (11). This results in the following equation system: where It can be seen that λ does not occur in (14) and (15). Therefore, neither z c nor v z influence the projection and we can omit (16). Consequently, line-scan cameras with telecentric lenses perform an orthographic projection, similar to area-scan cameras with telecentric lenses. Thus, with respect to the taxonomy by Sturm et al. (2010), line-scan cameras with telecentric lenses are central cameras (Sturm et al. 2010, Section 3), unlike line-scan cameras with entocentric lenses, which are axial cameras (Ramalingam et al. 2006;Sturm et al. 2010, Section 3.1.4). Furthermore, with respect to the taxonomy by Ye and Yu (2014), line-scan cameras with telecentric lenses are orthographic cameras and not pushbroom cameras. For the polynomial model, Eqs. (14) and (15) define a polynomial equation system of degree 7 in the unknowns x d and t. Therefore, the equations cannot be solved analytically, i.e., a numerical root finding algorithm must be used to solve them. For the division model, however, an analytical solution is possible. Specializing (14) and (15) to the division model results in the following equation system: where u = 1/(1+κ(x 2 d +y 2 d )). Since y d = −s y c y is constant, we solve (18) for t: Substituting (19) into (17) results in: If we multiply both sides by 1+κ(x 2 d + y 2 d ), expand the terms, and sort them according to powers of x d , we obtain: The term intersects the xz plane). Let us call this term x 0 . The term 1 + κ y 2 d represents the inverse of the undistortion factor u for x d = 0. Let us call this term d 0 . Then, we have: Hence, for κ = 0 and x 0 = 0, we have: For κ = 0 or x 0 = 0, (22) reduces to a linear equation. We examine both cases in turn. For x 0 = 0, we have: Inserting the value of x d obtained from (23) or (24) into (19) returns the value of t in both cases. For κ = 0, we have: In this case, Eq. (19) can be simplified to: Note that for κ = 0, y d , i.e., c y , is not meaningful (cf. Remarks 8 and 20). Therefore, if it is known a priori that κ = 0, c y (and, therefore, y d ) should be set to 0, which simplifies the equations even further to: If there are lens distortions, we can see from (23) that there are two potential solutions for the projection into the image, whereas in the cases without distortion, (24) and (25), there is a unique solution. Intuitively, we expect that for the case with lens distortions, there also is a unique solution since there is only one particular instant of time when the point will appear in front of the sensor line. (23), the correct solution is given by:

Proposition 1 In
Proof To prove the assertion, we will examine the limit of (23) for κ → 0. Obviously, this solution must converge to (25) for the correct solution because (17) and (18) are continuous around κ = 0. We first examine the solution in (29) and note that both the numerator and denominator converge to 0 for κ → 0. Therefore, we use L'Hôpital's rule to compute the limit: Hence, Eq. (29) converges to (25) for κ → 0. We now examine the solution of (23) with the plus sign and note that the numerator converges to 2/m for κ → 0, while the denominator converges to 0. Hence, the second solution converges to ∞ for κ → 0. Therefore, Eq. (29) is the correct solution.

Remark 13
The optical ray of an image point (x i , y i ) can be computed as follows. First, Eq. (13) is inverted: Next, Eqs. (14) and (15) are solved for (x c , y c ) : where y d = −s y c y . The optical ray is then given by:

Remark 14
In contrast to line-scan cameras with entocentric lenses (cf. Remark 12), a pure removal of lens distortions is possible for line-scan cameras with telecentric lenses because (14) and (15) do not depend on z c . Given an image point (x i , y i ) , the corresponding point (x c , y c ) in the camera coordinate system can be computed, as described in Remark 13. This point can then be projected into a rectified camera for which all distortion coefficients have been set to 0. Moreover, any skew in the pixels can be removed by setting v x to 0 in the rectified camera. Finally, square pixels can be enforced by setting s x to min(s x , mv y ) and then setting v y to s x /m. This approach ensures that no aliasing occurs when rectifying the image.

Remark 15
As is the case for line-scan cameras with entocentric lenses (cf. Remark 12), a reprojection of the image onto a world plane is possible for line-scan cameras with telecentric lenses.

Calibration
Like the camera models that were described in Sect. 3, the camera is calibrated by using the planar calibration object introduced in Steger (2017, Section 9). The calibration object has a hexagonal layout of circular control points. It has been designed in such a way that it can cover the entire field of view. Further advantages of this kind of calibration object are discussed in Steger (2017, Section 9). Let the known 3D coordinates of the centers of the control points of the calibration object be denoted by p j ( j = 1, . . . , n m , where n m denotes the number of control points on the calibration object). The user acquires n o images of the calibration object. Let us denote the exterior orientation parameters of the calibration object in image l by e l (l = 1, . . . , n o ), the interior orientation parameters of the camera by i, and the projection of a point in the calibration object coordinate system to the image coordinate system by π (cf. Sect. 4.1). In addition, let v jl denote a function that is 1 if the control point j of the observation l of the calibration object is visible with the camera, and 0 otherwise. Finally, let p jl denote the position of control point j in image l. Then, the camera is calibrated by minimizing the following function: The minimization is performed by a suitable version of the sparse Levenberg-Marquardt algorithms described in Hartley and Zisserman (2003, Appendix A6). The points p jl are extracted by fitting ellipses (Fitzgibbon et al. 1999) to edges extracted with a subpixel-accurate edge extractor (Steger 1998b, Chapter 3.3;Steger 2000). As discussed by Steger (2017, Section 5.2) and Mallon and Whelan (2007), this causes a bias in the point positions. Since telecentric line-scan cameras perform an orthographic projection, there is no perspective bias, i.e., the bias consists solely of distortion bias. The bias can be removed with the approach for entocentric line-scan cameras described by Steger (2017, Section 10).
The optimization of (35) requires initial values for the unknown parameters. Initial values for the interior orientation parameters, except for the motion vector, can be obtained from the specification of the camera and the lens, as described in Remark 1. In contrast to area-scan cameras, c y = 0 is typically used as the initial value. An approximate value for v y usually will be known from the considerations that led to the line-scan camera setup. Finally, v x typically can be set to 0. With known initial values for the interior orientation, the image points p jl can be transformed into metric coordinates in the camera coordinate system using (31)-(33). This allows us to use the OnP algorithm described by Steger (2018) to obtain estimates for the exterior orientation of the calibration object.

Remark 16
The Levenberg-Marquardt algorithm requires the partial derivatives of x i and y i with respect to the interior and exterior orientation parameters of the camera model. This, in turn, requires the partial derivatives of x d and t with respect to the interior orientation parameters. These can be computed analytically using the implicit function theorem (de Oliveira 2013).

Line-Scan Cameras with Telecentric Lenses in Projective Geometry
In this section, we will consider telecentric line-scan cameras without lens distortions. In this case, Eqs. (27), (28), and (13) can be written as the following calibration matrix: Since m and s x cannot be determined simultaneously (cf. Remark 19), we have removed this overparameterization by using the parameter a = m/s x . Furthermore, since the principal point is undefined if there are no distortions (see Remark 20), we have used c x = c y = 0. 6 The orthographic projection that the telecentric line-scan camera performs can be written as: Finally, the pose of the camera with respect to the world coordinate system can be written as a 4 × 4 homogeneous matrix H (see Sect. 3.1). Hence, if there are no distortions, line-scan cameras with telecentric lenses are affine cameras (Hartley and Zisserman 2003, Chapter 6.3.4) with the following camera matrix: A general affine camera can be written as the following camera matrix: where the top left 2 × 3 submatrix must have rank 2 (Hartley and Zisserman 2003, Chapter 6.3.4). M has eight degrees of freedom: its elements m i j (i = 1, 2, j = 1, . . . , 4) (Hartley and Zisserman 2003, Chapter 6.3.4). The camera matrix in (38) also has eight degrees of freedom: a, v x , v y , t x , t y , α, β, and γ . Therefore, it is natural to examine whether a general affine camera matrix M can be decomposed uniquely into the eight parameters of a telecentric line-scan camera without lens distortions.

Theorem 1 Every affine camera matrix M can be decomposed into the eight parameters a, v x , v y , t x , t y , α, β, and γ of a telecentric line-scan camera without lens distortions. There is a twofold ambiguity in the decomposition: If a valid decomposition of M is given by
Proof To prove Theorem 1, we will make use of the dual image of the absolute conic (DIAC) (Hartley and Zisserman 2003, Chapter 8.5), given by where Q * ∞ = diag(1, 1, 1, 0) is the canonical form of the absolute dual quadric (Hartley and Zisserman 2003, Chapter 3.7). 7 This will allow us to remove the exterior orientation from the equations to be solved. If we denote the entries of a camera matrix M by m i j , the elements ω i j of the DIAC ω * are given by Note that ω * is a symmetric matrix. Let us denote the DIAC of M by ω * M and the DIAC of the camera matrix (38) by ω * P . We require that both DIACs are identical: 7 The function diag constructs a diagonal matrix with the specified elements.
The DIAC ω * P is given by: Hence, we have the following three equations to determine a, v x , and v y : We can solve (46) for v y : Substituting v y into (45) and solving for v x results in: Substituting v x and v y into (44) and solving for a yields: We can assume that a = m/s x is positive. Hence, only the positive square root in (49) yields a valid result: Substituting a into (48) results in: Note that ω 11 > 0 and ω 22 > 0 because M has rank 3 and that ω 11 ω 22 − ω 2 12 ≥ 0 (and, therefore, ω 11 − ω 2 12 /ω 22 ≥ 0) because of the Cauchy-Schwarz inequality (Steger 2017, Appendix A.1). Consequently, all equations can always be solved.
The above derivation shows that that there are two solutions: (a, v x , v y ) and (a, v x , −v y ), where we have selected v y = 1/ √ ω 22 . These solutions allow us to compute the respective calibration matrix K. If we compute K −1 M, we obtain the first two rows of H (Steger 2017, Appendix A.1).
The left 2 × 3 submatrix of K −1 M contains the first two rows of the rotation matrix of the pose. The third row of the rotation matrix can be computed as the vector product of the first two rows. This rotation matrix can then be decomposed into the parameters α, β, and γ . The right 2 × 1 submatrix of K −1 M contains t x and t y .
We now examine what effect the two different solutions for the interior orientation parameters have on the pose. The two different calibration matrices are given by: Their inverses are given by: Since the only difference between the two inverses is the sign of the element (2, 2), this means that when H 1,2 are computed as K −1 1,2 M, the two solutions H 1 and H 2 will have inverse signs in their second row. If the third row of the rotation matrix is computed by the vector product, the two rotation matrices R 1 and R 2 will differ by having inverse signs in their second and third rows. This corresponds to a multiplication by a matrix Q = diag(1, −1, −1) on the left. Note that Q is a rotation by π around the x axis. Since in our Euler angle representation the rotation around the x axis is performed last (see Sect. 3.1), multiplying by Q on the left corresponds to adding π to α. This shows that for the first solution (a, v x , v y ) of the interior orientation parameters, the solution for the pose parameters is given by (t x , t y , α, β, γ ), while for the second solution (a, v x , −v y ) of the interior orientation parameters, the solution for the pose parameters is given by (t x , −t y , α + π, β, γ ).

Remark 17
A rotation by π around the x axis corresponds to looking at the front or at the back of an object. Therefore, if the camera is acquiring images of opaque objects, it is typically possible to select the correct solution. However, if images of transparent objects are acquired, which is the case in applications with backlight illumination (at least the calibration object must be transparent in this case), the ambiguity of Theorem 1 can occur in practice.

Remark 18
Theorem 1 shows that every affine camera is equivalent to a telecentric line-scan camera with no distortions. On the other hand, Theorem 1 in Steger (2017) shows that every affine camera is equivalent to an area-scan camera with a bilateral telecentric tilt lens with no distortions. Therfore, telecentric line-scan cameras with no distortions are equivalent to telecentric area-scan cameras (with tilt lenses if the pixels are skewed). This means that we can replace telecentric line-scan cameras with no distortions by telecentric area-scan cameras with no distortions if this is convenient. In particular, this allows us to reuse existing algorithms for telecentric area-scan cameras for telecentric line-scan cameras.
We note that a telecentric line-scan camera that has been rectified with the approach described in Remark 14 fulfills the above criterion of having no distortions. Therefore, a rectified telecentric line-scan camera with parameters m l = m, s x,l = s x , s y,l = s y , c x,l = c x , c y,l = c y , v x,l = 0, and v y,l = v y = s x /m can be represented by a telecentric area-scan camera (cf. Sect. 3.1) with m a = m, s x,a = s x , s y,a = s x , c x,a = c x , and c y,a = c y s x /s y .

Remark 19
The model for telecentric line-scan cameras is overparameterized. The values of m and s x cannot be determined simultaneously. This can be solved by fixing s x at the initial value that was specified by the user. Furthermore, like for entocentric line-scan cameras, s y is only used to specify the principal point in pixels (cf. Remark 7) and is therefore kept fixed at the initial value specified by the user.

Remark 20
Like for telecentric area-scan cameras (cf. Remark 2), (c x , c y ) is solely defined by the lens distortions for telecentric line-scan cameras. If there are no lens distortions, (c x , c y ) and (t l,x , t l,y ) have the same effect. Therefore, in this case (c x , c y ) should remain fixed at the initial value specified by the user (typically, c x is set to the horizontal image center and c y is set to 0).

Remark 21
Like for entocentric line-scan cameras (cf. Remark 10), the parameters P 1 and P 2 of the polynomial distortion model are highly correlated with other parameters of the telecentric line-scan camera model, especially if the radial distortions are small. Therefore, they typically cannot be determined reliably. Consequently, in practice, they should be set to 0 and should be excluded from the calibration.

Remark 22
Neither t z nor v z can be determined since they have no effect on the projection (cf. Sect. 4.1). We leave v z at the initial value specified by the user and set t z to 1 m (see also Remark 3).

Remark 23
As described in Theorem 1 and Remark 17, there is a sign ambiguity for v y . Therefore, the user must specify the initial value of v y with the correct sign to ensure the calibration converges to the correct solution.

Remark 24
Like for telecentric area-scan cameras (see Remark 4), the rotation of the pose of a planar calibration object can only be determined up to a twofold ambiguity. This is a special case of a Necker reversal (Shapiro et al. 1995, Section 4.1) when the object is planar. The two sets of pose parameters (α l , β l , γ l ) and (−α l , −β l , γ l ) (with identical translation vectors) result in the same points in the image. If a correct exterior orientation of the calibration object is required in the application, the user must resolve this ambiguity by selecting the correct pose based on prior knowledge. Proof Without loss of generality, we can assume that the planar calibration object lies in the plane z = 0 in the calibration object coordinate system. Let us first assume we have cameras with c y = 0. Furthermore, let us assume that the first camera has α 1 = 0, t y,1 = t y , and v y,1 = v y , where t y and v y are arbitrary but fixed. In addition, let us assume the remaining interior and exterior orientation parameters m, c x , s x , s y , v x , t x , and γ are arbitrary and identical for both cameras. We now can select an arbitrary value α for the rotation around the x axis for the second camera, i.e., α 2 = α. Then, by setting v y,2 = v y cos α and t y,2 = t y cos α, we obtain a camera with identical projection geometry for points in the plane z = 0. If c y = 0 and if there are no distortions, we must also set c y,1 = c y and c y,2 = c y cos α.
To prove that both cameras result in the same projection geometry, we can construct their camera matrices P 1,2 , as described in Sect. 4.3. Then, we can project an arbitrary point p c = (x c , y c , 0) , i.e., we can compute p i,1,2 = P 1,2 p c . Comparing the resulting expressions for p i,1,2 , which we omit here, shows that they are identical. Proof Without loss of generality, we can assume that the planar calibration object lies in the plane z = 0 in the calibration object coordinate system. Let us first assume we have cameras with c y = 0. Furthermore, let us assume that the first camera has β 1 = 0, t x,1 = t x , m 1 = m, and v x,1 = v x , where t x , m, and v x are arbitrary but fixed. In addition, let us assume the remaining interior and exterior orientation parameters c x , s x , s y , v y , t y , and γ are arbitrary and identical for both cameras. We now can select an arbitrary value β for the rotation around the y axis for the second camera, i.e., β 2 = β. Then, by setting m 2 = m/ cos β, v x,2 = v x cos β, and t x,2 = t x cos β, we obtain a camera with identical projection geometry for points in the plane z = 0. If c y = 0 and if there are no distortions, we must also set c y,1 = c y and c y,2 = c y / cos β.
To prove the assertion, we can proceed in the same manner as in the proof of Proposition 2.
Remark 25 Proposition 2 shows that a rotation of a planar calibration object around the x axis can be exchanged with different values for the speed v y and the translation t y . Proposition 3 shows that a rotation of a planar calibration object around the y axis can be exchanged with different values for the magnification m, the speed v x , and the translation t x . Since the interior and exterior orientation parameters that are affected by these degeneracies are independent of each other, we conjecture that there is a universal degeneracy that implies that the interior and exterior orientation parameters cannot be determined from a single image of a planar calibration object, no matter how the calibration object is oriented in 3D. We prove that this is the case in the following theorem.
Theorem 2 For a single image of a planar calibration object, m, v x , v y , α, β, t x , and t y cannot be determined simultaneously if c y = 0, or if c y = 0 and there are no distortions (i.e., κ = 0 for the division model).
Proof Without loss of generality, we can assume that the planar calibration object lies in the plane z = 0. Furthermore, we can immediately see that a rotation around the z axis is immaterial since a rotation of a point in the plane z = 0 by an angle γ around the z axis merely corresponds to a different point in the plane z = 0. Consequently, we can use γ = 0 in the following.
We will now show that a camera with parameters m, s x , s y , c x = 0, c y = 0, v x , v y , t x , t y , α, and β leads to an identical projection as a camera with parameters m/ cos β, s x , s y , c x = 0, c y = 0, v x cos β, v y f , t x cos β, t y f , φ, and ψ for a suitably chosen factor f and suitably chosen angles φ and ψ. We will only examine the case of no lens distortions since for c y = 0 the distortion is purely along the horizontal direction of the image and therefore can be rectified within each line independently.
To prove that the two camera parameter sets above result in the same projection, we will construct the affine transformation matrix A of points in the plane z = 0 in the calibration object coordinate system to points in the image plane. The affine transformation is given by multiplying the camera matrix in (38) by O from the right, where O is given by (37). Hence, we have: For the first set of camera parameters, this results in: where a = m/s x . For the second set of camera parameters, we obtain: Hence, we can see that the translation part of A 1 and A 2 (their last columns) are identical. This leaves us with the following four equations for f , φ, and ψ: We solve (62) for f and obtain: By substituting (63) into (60), we obtain an equation that is fulfilled tautologically. Hence, we substitute (63) into (61) and simplify to obtain: which we solve for tan φ: By substituting (63) into (59) and simplifying, we obtain: av y cos ψ cos β − av x cos α tan φ sin ψ = av y cos β − av x sin α sin β.
By substituting (68) into (65) and using the identity sin θ = √ 1 − cos 2 θ , we obtain: Therefore, we have: Finally, by substituting (71) into (63) and using the identity cos(arctan θ) = 1/ √ θ 2 + 1, we obtain: To extend the proof to the case, (c x , c y ) = (0, 0) , we note (see Footnote 6) that c y,1 = c y,1 s y /(mv y ) for the first camera and c y,2 = c y,2 s y cos β/(mv y f ) for the second camera, whence c y,2 = c y,1 ( f / cos β). Furthermore, for the first camera, c x,1 = −c y,1 (s y /s x )(v x /v y ) + c x,1 , while for the second camera, c x,2 = −c y,2 (s y /s x )(v x cos β)/(v y f )+c x,2 . Substituting c y,2 = c y,1 ( f / cos β) into the last equation shows that c x,2 = c x,1 . Table 1 displays an example for interior and exterior orientation parameters that result in identical projections for planar objects in the plane z = 0 that were obtained with solution in the proof of Theorem 2.

Remark 27
From the proof of Theorem 2, it might appear that there is only a twofold ambiguity. However, this is only caused by the fact that we have chosen the specific values of m/ cos β, v x cos β, and t x cos β for the second camera to simplify the proof as much as possible. If other factors instead of cos β had been chosen, the values of f , φ, and ψ would change accordingly. Therefore, like in Propositions 2 and 3, the degeneracy is completely generic.

Remark 28
In machine vision applications, it sometimes is important to calibrate the camera from a single image. As the above discussion shows, this will lead to camera parameters that differ from their true values. However, if the residual error of the calibration is sufficiently small, a camera geometry that is consistent within the plane that is defined by the exterior orientation of the calibration object (and all planes parallel thereto) will be obtained. Therefore, an image or features extracted from an image can be rectified to this plane (cf. Remark 15). On the other hand, algorithms that solely rely on the interior orientation, e.g., the pure removal of radial distortions in Remark 14, are less useful because the ambiguities with respect to m and v y imply that we cannot reliably undistort an image or features extracted from an image to have square pixels.

Robustness of Principal Point Estimation
In our first experiment, we evaluate the importance of modeling c y and lens distortions in general. We mounted an area-scan camera with a telecentric lens approximately 30 cm above a linear stage. The camera was oriented such that its viewing direction was vertically downwards onto the linear stage and its y axis was approximately parallel to the linear motion of the stage. An encoder that triggered the image acquisition was used to ensure a constant speed. We acquired an image at each trigger event and saved the obtained image array. We restricted the part that was read out from the sensor to the center image rows only: we selected the 90 sensor rows above and below the center image row, resulting in images of height 181. This setup enabled us to generate images of a virtual line-scan camera that consist of one of the 181 image rows. The line-scan image for one selected row was obtained by stacking the selected image row of all images in the array on top of each other. The frequency of the encoder was chosen such that the pixels in the generated line-scan images were approximately square.
For the tests, we chose two different hardware setups. In the first setup, we used an IDS GV-5280CP-C-HQ color camera (2/3 inch sensor size, CMOS, 3.45 µm pixel pitch, 2448×2048) with a telecentric Vicotar T201/0.19 lens (nominal magnification: 0.19). We set up the camera, which uses a color filter array to capture color information, to directly return gray-scale images. The generated line-scan images are of size 2448 × 3330.
In the second setup, we used an IDS UI-3080CP-M-GL monochrome camera (2/3 inch sensor size, CMOS, 3.45 µm pixel pitch, 2456×2054) with a telecentric V.S. Technologies L-VS-TC017 lens (nominal magnification: 0.17). Because the lens was designed for a maximum sensor size of 1/2 inch, we cropped the images to 70% of their width. The generated line-scan images are of size 1719 × 2954.
With both setups, we acquired 16 image arrays of a 4×3 cm 2 planar calibration object with a hexagonal layout of circular marks in different poses, as described in Steger et al. (2018, Chapter 3.9.4.1). For each of the 181 image rows, we generated 16 virtual line-scan images, one from each of the 16 image arrays. Consequently, for each of the 181 image rows, we obtained 16 calibration images that we used for calibration by minimizing (35). Lens distortions were taken into account by applying the division model. The variation of the resulting camera parameters depending on the selected sensor row is shown in Figs. 2 and 3. In addition, the variation of the root mean square (RMS) calibration error, i.e., ε 2 / n o l=1 n m j=1 v jl , is plotted. From the plots, it can be seen that all parameters except for c y do not change substantially when selecting different sensor rows (note the scaling of the vertical axes). This is the expected behavior because c y measures the misalignment of the sensor line with respect to the optical axis in the y direction (see Sect. 3.2). Therefore, there is a linear relationship between the selected sensor row and c y , which is evident from the plots. While the expected change of c y over the sensor rows is 181, it is 182 for the color camera but only For each twentieth sensor row, the standard deviation is indicated by error bars. Additionally, the root mean square (RMS) calibration error is plotted Fig. 3 Variation of the calibrated interior orientation of the IDS UI-3080CP-M-GL monochrome camera with the V.S. Technologies L-VS-TC017 lens depending on the selected sensor row when applying the division distortion model. For each twentieth sensor row, the standard deviation is indicated by error bars. Additionally, the root mean square (RMS) calibration error is plotted 131 for the monochrome camera. Although we are not perfectly sure, we assume that the reason for c y changing only by 131 pixels is that the circular actuator of the linear stage is not perfectly centered, resulting in a non-uniform movement (see Sect. 5.2 for more details). Because of the different magnifications of the lenses, for the color camera, there seems to be an integer number of periods of the movement bias in the images, whereas for the monochrome camera there seems to be a non-integer number of periods. Since c y is primarily determined by the bending of the image lines, an asymmetry in the movement bias in the images may prevent the reliable extraction of c y for the monochrome camera.
For increasing sensor rows, the values for m and κ increase slightly for the color camera and decrease slightly for the monochrome camera. This is because a larger magnification can be at least partially compensated by a larger value of κ, which causes a non-uniform scaling in the image row, and vice versa.
Also note that the RMS error of the color camera is significantly larger than that of the monochrome camera, which probably is caused by image artifacts that are caused by the color filter array.
Despite the relatively small lens distortions of at most 1.8 pixels in the images, c x and c y are estimated consistently over different sensor rows. Nevertheless, the standard deviations of the estimated principal point are significantly larger for the color camera than for the monochrome camera because the magnitude of κ is larger by a factor of almost 3 for the monochrome camera. Consequently, the principal point of the monochrome camera is better defined (see Remark 20).
We alternatively applied the polynomial distortion model to the calibration of the monochrome camera. As suggested in Remark 21, we set P 1 and P 2 to 0 and excluded them from the calibration. The results are shown in Fig. 4. The obtained values for the parameters are very similar to those obtained with the division model. The RMS error decreases only marginally from 0.3318 (division) to 0.3316 (polynomial), on average. As for the division model, a correlation between m and the radial lens distortion parameters (K i ) is observable. The experiment shows that the division model obviously represents the lens distortions sufficiently well and that both models return consistent results.
These experiments show that the proposed camera model is able to estimate the principal point of the camera accurately, and hence is able to handle lens distortions effectively, even for lenses with only small lens distortions.

Calibration of Line-Scan Cameras
In the second experiment, we calibrated two monochrome Basler raL2048-48gm line-scan cameras (14.3 mm sensor size, CMOS, 7.0 µm pixel pitch, 2048 × 1) with Opto Engineering telecentric lenses. On the first camera, we mounted a TC2MHR048-F (nominal magnification: 0.268, working distance: 133 mm) and on the second camera, we mounted a TC2MHR058-F (nominal magnification: 0.228, working distance: 158 mm). We used the same setup as described in Sect. 5.1 and acquired 16 images of a 8 × 6 cm 2 planar calibration object in different poses. Each calibration was performed with the division and polynomial distortion models. The results are shown in Tables 2 and 3.
The low RMS errors indicate that the cameras and lenses can be represented very accurately by our proposed model. Both high-quality lenses have very small lens distortions. This also causes the principal points to be poorly defined, resulting in significantly different values for c y for the division and polynomial distortion models in Table 2. When setting c x = 1024, c y = 0, all distortion parameters to 0, and excluding these parameters from the calibration, the RMS errors only marginally increase to 0.3545 (division model) and 0.3541 (polynomial model) for the TC2MHR048-F lens and to 0.2928 (division model) and 0.2927 (polynomial model) for the TC2MHR058-F lens. Nevertheless, the maximum absolute distortion in the images is approximately 1.2 pixels (TC2MHR048-F) and 1.4 pixels (TC2MHR058-F), which would decrease the accuracy of measurements when being ignored.
The small distortions raise the question whether any of the parameters in the model are redundant for these lenses, i.e., whether overfitting has occurred. Obviously, m, v x , and v y are significant geometrically and therefore cannot be omitted. Hence, the question is whether (c x , c y ) or the distortion parameters κ or K 1 , K 2 , and K 3 are significant. We use the significance test proposed by Grün (1978) to test whether any useful combinations of these parameters are significant. Each test hypothesis was obtained by setting the respective distortion parameters to 0 and the principal point to the center of the sensor line. In Table 4, we display the results of this test for the TC2MHR058-F lens. The results for the TC2MHR048-F lens are omitted because they are similar. As can be seen from Table 4, all distortion-related parameters are highly significant. Therefore, no overfitting occurs, even for these small distortions. Figure 5 shows one of the calibration images that were used to calibrate the camera with the TC2MHR048-F lens. In addition, the residuals (scaled by a factor of 130) are visualized for each circular calibration mark. The residuals are the differences between the extracted centers of the calibration marks in the image and the projections of the corresponding points on the calibration object into the image. The projection is performed by using the calibrated camera parameters of the interior and exterior orientation while applying polynomial distortion model. The mean and maximum length of the residuals was 0.284 pixels and 0.538 pixels, respectively. This corresponds to 7.21µm and 13.67µm in the world. It can be seen that the predominant part of the residuals is a sys- Parameters indicated by * are excluded from the calibration tematic periodic error in the direction of the movement, i.e., in vertical direction in the image. It should be noted that the used encoder reacts to the angle position of the electric motor of the linear stage. Therefore, we assume that the major part of the residuals is caused by the circular actuator that is not perfectly centered. Another indication of this assumption is the fact that the periodicity of the error corresponds to one full revolution of the actuator. In this case, the calibration error could be further reduced by using a higher-quality electric Table 3 Calibration results for a Basler raL2048-48gm line-scan camera with an Opto Engineering TC2MHR058-F telecentric lens for the division and polynomial lens distortion models Parameters indicated by * are excluded from the calibration actuator that better realizes a constant speed. In comparison, the residuals in horizontal direction are very small, which again shows that the proposed camera model represents the true projection very well.

Example Application: Image Rectification
To be able to precisely measure distances and angles in the image, the obtained line-scan images must be rectified to The values of the significance level α were computed using the MAT-LAB function 1−fcdf (T , m, n). T is the test statistic proposed by Grün (1978), m is the number of parameters tested for significance, and n is the redundancy of the system (2×number of calibration marks extracted− number of camera parameters optimized−5n o ). The entry < 1×10 −16 indicates that fcdf(T , m, n) = 1 to double precision accuracy. Note that all distortion-related parameters are highly significant eliminate lens distortions and skew to ensure square pixels. While this is generally impossible for entocentric lenses (see Remark 12), we can perform such a rectification for telecentric lenses (see Remark 14). For the example shown in Fig. 6, we acquired a line-scan image of a graph paper with the setup described in Sect. 5.2 with the TC2MHR058-F lens. The acquired image is shown in Fig. 6a. Because the motion direction was not perfectly perpendicular to the sensor line, i.e., has a significant nonzero motion component in the direction of the sensor line (v x = −1.0491 µm Pixel −1 , see Table 3), the squares of the graph paper appear skewed. Furthermore, because the speed of the motion was not perfectly adjusted, rectangular instead of square pixels are obtained, causing a non-uniform scaling of the squares on the graph paper in the image.
By setting all distortion coefficients to 0, v x to 0, s x to min(s x , mv y ), and v y to s x /m (see Remark 14), we can generate an image mapping that rectifies the images acquired with the setup. After the rectification, the images have no lens distortions and square pixels. Fig. 6b shows the resulting rectified image. The squares on the graph paper are squares in the rectified image. Hence, in the rectified image, it is possible to measure angles and distances and areas in world units correctly.
For a quantitative comparison, we extracted subpixelprecise lines (Steger 1998a(Steger , b, 2013 in the original and in the rectified image, fitted straight lines, and computed their intersection angles. The mean over all angles was 87.971 • in the original image and 90.004 • in the rectified image. Further- Fig. 5 One of the images of the planar calibration object that were used to calibrate the raL2048-48gm line-scan camera with the TC2MHR048-F lens. Residuals are overlaid for each circular calibration mark as white lines. The residuals were scaled by a factor of 130 for better visibility. The predominant part of the residuals is a systematic periodic error in the direction of the movement, i.e., in vertical direction in the image Fig. 6 Example application: image rectification by eliminating lens distortions and ensuring square pixels. a Original line-scan image. The squares on the graph paper are skewed and have a non-uniform scaling in the image. b Rectified line-scan image. The squares on the graph paper are squares in the image more, we computed the area of each square on the graph paper in both images and transformed it to metric units by multiplying it by s x s y /m 2 . Here, s x and s y are the pixel pitches on the sensor and m is the lens magnification obtained from calibration. The mean area was 25.50 mm 2 in the original image and 24.98 mm 2 in the rectified image, while the actual size of the squares on the paper was 25 mm 2 .

Conclusions
We have proposed a camera model for line-scan cameras with telecentric lenses. The model assumes a linear motion of the camera with constant velocity. It can model general lens distortions by allowing the sensor line to lie anywhere with respect to the optical axis. The model is parameterized by camera parameters that have a physical meaning and is therefore easy to understand by machine vision users. We have described an algorithm to calibrate the camera model using a planar calibration object. Furthermore, we have investigated the degeneracies of the model and have discussed how they can be handled in practice. In addition, we have shown that every affine camera can be interpreted as a telecentric linescan camera and vice versa, provided the lens does not exhibit any lens distortions. Experiments with real setups have been used to establish the validity of the model. In particular, we have shown that even for lenses with very small lens distortions, the distortions statistically are highly significant and therefore cannot be omitted in real-world applications.
One direction for future research is to derive an explicit stereo or multi-view camera model for telecentric line-scan cameras.