3D Metrology Using One Camera with Rotating Anamorphic Lenses

In this paper, a novel 3D metrology method using one camera with rotating anamorphic lenses is presented based on the characteristics of double optical centers for anamorphic imaging. When the anamorphic lens rotates −90° around its optical axis, the 3D data of the measured object can be reconstructed from the two anamorphic images captured before and after the anamorphic rotation. The anamorphic lens imaging model and a polynomial anamorphic distortion model are firstly proposed. Then, a 3D reconstruction model using one camera with rotating anamorphic lenses is presented. Experiments were carried out to validate the proposed method and evaluate its measurement accuracy. Compared with stereo vision, the main advantage of the proposed 3D metrology approach is the simplicity of point matching, which makes it suitable for developing compact sensors for fast 3D measurements, such as car navigation applications.


Introduction
In modern industry, 3D metrology is an important technology, based on various methods. Optical metrology and non-optical metrology are the two categories of 3D metrology [1]. Non-optical 3D metrology methods may use a coordinate measuring machine (CMM), a scanning electron microscope, and a scanning probe microscope [2,3], whereas optical 3D metrology methods may employ chromatic confocal microscopy, point autofocus instruments, focus variation instruments, phase-shifting interferometry, coherence scanning interferometry, imaging confocal microscopy, and stereo vision. An overview of such methods was presented in detail [4][5][6]. Each 3D metrology method has its own properties and differs in application areas, measurement accuracy, scale, efficiency, cost, etc. Optical metrology procedures are often fast, precise, and non-destructive of the measured objects. Stereo vision, which uses two cameras with spherical lenses, is a frequently used optical metrology approach [7][8][9]. The measuring precision of stereo vision can range from several microns to several millimeters, depending on the measured area and the spherical lenses used. The most challenging aspect of stereo vision involves the extraction of the corresponding points from stereo images. Projectors are widely used to generate structured light to achieve high-quality corresponding points [10]. Stereo vision has been widely used in many areas, such as industry metrology, agriculture, daily living, etc. [11,12] Anamorphic lenses are increasingly employed in the film industry to capture wide images for broad screens [13][14][15]. Anamorphic lenses are distinguished by two characteristics: double focal lengths and double optical centers [16][17][18]. Double focal lengths means the focal lengths differ greatly in the tangential and sagittal planes. This characteristic of anamorphic lenses is often used in the film industry, as it allows images to be compressed horizontally. Metrology, physics, and some optical imaging applications also use anamorphic lenses [19][20][21][22]. Double optical centers means there are two optical centers, one in the tangential plane and the other in the sagittal plane. The distance between the two optical centers is the anamorphic distance, which is an intrinsic quantity for anamorphic lenses. The anamorphic distance will provide anamorphic images with more 3D information, making anamorphic lenses considerably more suitable for 3D metrology. H. Durko used anamorphic lenses for measuring parts with large aspect ratios [23]. F. Blais performed an exploratory calibration of anamorphic lenses based on a pinhole imaging model [24]. In our previous work, a high-precision anamorphic lens calibration method was proposed with 3D and 2D calibration targets [16,25].
In this study, a novel 3D metrology method using one camera with rotating anamorphic lenses is proposed based on its characteristic of double optical centers. When the anamorphic lens rotates −90 • around its optical axis, the 3D data of the measured object can be reconstructed from the two anamorphic images captured before and after the anamorphic rotation. The rest of this paper is organized as follows. Section 2 presents the anamorphic lens imaging model as well as the anamorphic distortion model. Section 3.1 describes the 3D reconstruction process employing rotating anamorphic lenses. Section 3.2 describes the point matching approach, and Section 3.3 depicts the rotating anamorphic stereo vision. Section 4 describes the experiments and evaluates the proposed method's measurement accuracy. Finally, Section 5 concludes the paper.

Anamorphic Imaging Model
This section presents the imaging model and the distortion model of anamorphic lenses, which differ significantly from those based on spherical lenses. Anamorphic lenses are typically composed of rear spherical lenses on the back and an anamorphic attachment on the front. The anamorphic attachment consists of cylindrical lenses that have no optical power in planes parallel to the cylindrical axis but have optical power in planes perpendicular to it.

Anamorphic Imaging Model
The imaging model of anamorphic lenses differs from the traditional pinhole imaging model of spherical lenses. The anamorphic distance and the anamorphic angle are introduced as new extra intrinsic parameters [16]. Figure 1 depicts the imaging model of anamorphic lenses, where ad denotes the anamorphic distance, and aa denotes the anamorphic angle. If the anamorphic lens is precisely assembled, the anamorphic angle aa, as shown in Figure 1, can be as small as zero. The cylindrical lenses or the anamorphic attachment determine the anamorphic distance ad, which must be precisely calibrated. O W -X W Y W Z W are the world coordinates, O ci -X ci Y ci Z c are the camera coordinates centered in the CCD plane, and O p -X p Y p Z c are the pixel coordinates centered in the CCD plane. O cx and O cy are the optical centers in the horizontal plane and the vertical plane, and f x and f y are the focal lengths in the two planes. The imaging model for anamorphic lenses can be expressed as follows: where [X w ; Y w ; Z w ] is a point in the world coordinates, [X c ; Y c ; Z c ] is the point expressed in the anamorphic coordinates. R and T denote the rotational and translating matrix from the world coordinates to the anamorphic coordinates. (X I , Y I ) are the image coordinates in the camera coordinates in the image plane, and (X P , Y P ) are the image coordinates in the pixel coordinates in the image plane.

Anamorphic Distortion Model
Anamorphic lenses have a distinct distortion model with respect to spherical lenses. The front anamorphic attachment introduces many more aberrations [26]. Based on the aberration theory and numerical experiments for anamorphic lenses, we proposed a polynomial distortion model for anamorphic lenses, which allows for high-precision camera calibration [25]. As shown in Equation (2), anamorphic distortions can be divided into radial distortions (X rad , Y rad ), third-order distortions (X 3 , Y 3 ), and second-order distortions (X 2 , Y 2 ). (x d , y d ) denotes the distorted image coordinates, and (x c , y c ) denotes the undistorted image coordinates. [k 1 , k 2 , n 1 , n 2 , m 1 , m 2 , x 21 , x 12 , x 03 , x 20 , x 11 , x 02 , y 30 , y 21 , y 12 , y 03 , y 20 , y 11 , y 02 ] are the 19 distortion coefficients for anamorphic lenses that must be calibrated.

Description of 3D Metrology Using Rotating Anamorphic Lenses
As shown in Figure 2a, the vertical position is the first anamorphic position, and the cylindrical axis of the anamorphic attachment is vertical. After a −90 • rotation, the cylindrical axis of the anamorphic lens is horizontal, and this anamorphic position is known as the horizontal position. The anamorphic lens can switch between the two positions by rotating. The imaging model of anamorphic lenses shown in Section 2 can be reduced to an ideal anamorphic lens for ease of analysis, which implies that the anamorphic angle is zero, there are no distortions, and the rotation angle is precisely −90 • without decentering. As shown in Figure 1 and Equation (1), the following equations describe the vertical position of an ideal anamorphic lens: x where (x v , y v ) refer to the image position of the object point P V = (X C , Y C , Z C ), and P V is in the anamorphic coordinates in the vertical position. After the anamorphic rotation, the coordinates of the object point in the anamorphic coordinates change as follows: If the anamorphic lens rotates alone its optical axis by −90 • , R can be expressed as: Thus, when the anamorphic lens is rotated to its horizontal position, the object coordinates can be calculated as P H = [Y C ; −X C ; Z C ], and we have the following equations: Given Equations (3) and (6), the coordinates of the object point can be calculated as: Thus, given the internal parameters f x , f y , and ad, as well as the image coordinates (x v , y v ) and (x h , y h ) of an object point in an ideal anamorphic lens, the 3D coordinates of this point can be easily reconstructed using Equation (7).

Point Matching
Point matching is crucial for stereo vision but is also challenging because the two images are captured by two different cameras. Points in different positions will have different image points in stereo images. Epipolar constraints and projectors are commonly adopted to achieve robust point matching, which requires a complex calculation. Point matching limits the applications of stereo vision in areas requiring fast or real-time 3D reconstruction, such as car navigation. Compared with stereo vision, point matching is much simpler in our proposed 3D metrology method. A simulation is provided to demonstrate its image point matching, as shown in Figures 3-6. The simulated anamorphic lens has the following internal parameters: ad = 30 mm, aa = 0 • , f x = 12 mm, f y = 16 mm, and no distortions. As shown in Figure 3, the object to be built is a collection of points on a spherical surface, with their coordinates given in the vertical position of the anamorphic lens. The simulated image points on the image planes are shown in Figure 4, where the dot points and the circle points express the image points when the anamorphic lens is in the vertical and horizontal positions, respectively. It is not easy to match the image points from these two positions in the current stage. In our method, the point matching can be greatly simplified by using a parameter of an anamorphic lens known as the anamorphic ratio AR, which is:    As a result, if the dot points and circle points in Figure 4 are expanded horizontally and vertically by AR, respectively, we obtain the corresponding image points shown in Figure 5. Because the corresponding points are nearby dot points and circle points, point matching in rotating anamorphic lenses becomes a simple and straightforward task. In addition, as illustrated in Figure 6, we can trace the image positions during the anamorphic rotation from the dot points to the circle points for point matching. Point matching in anamorphic rotating 3D metrology is much easier than stereo vision with spherical lenses, as shown in Figures 5 and 6. The deviations between the dot points and the circle points are due to the anamorphic distance ad. In this example, the anamorphic distance of 30 mm was much smaller than the object distance of 1500 mm. The deviation between the dot points and the circles in the image planes will increase when the object points are imaged using an anamorphic lens with a large anamorphic distance.

Stereo Vision with Anamorphic Lenses
Inevitably, there will be a misalignment between the optical axis of the anamorphic lens and the rotation axis of the rotary table, which will be magnified if the object is far away from the lens. As a result, large errors will occur if Equation (7) is applied directly for 3D reconstruction. A rational approach for high-precision 3D metrology is to treat the rotating anamorphic lenses as two distinct anamorphic lenses, which constitute a stereo vision with anamorphic lenses. The main differences between stereo vision and stereo vision with anamorphic lenses are that spherical lenses are replaced by anamorphic lenses and the baseline distance between the two anamorphic lenses is extremely small.
For 3D metrology using rotating anamorphic lenses, we should first calibrate the internal parameters of the anamorphic lenses according to the anamorphic imaging model and the anamorphic distortion model. A 3D calibration target can be used to calibrate the anamorphic lens [16]. As can be seen in Equation (2), the distortion model of the anamorphic lens has 19 unknown distortion coefficients. If only one image of a 3D calibration target is used for anamorphic lens calibration, local convergence is likely to occur for the distortion coefficients. Commonly, the 3D calibration target cannot cover the entire imaging area, which will lead to a poor calibration result for other imaging areas. Therefore, to achieve a stable calibration result for the entire imaging area, mixed calibration targets are adopted, which means 3D calibration targets and 2D calibration targets are both required [25]. The initial values of the internal parameters are calibrated using the 3D calibration target, and those parameters are refined using 2D calibration targets. After anamorphic calibration using mixed calibration targets, the internal anamorphic lens parameters [f x , f y , u 0 , v 0 , ad, aa] and the 19 distortion coefficients [k 1 , k 2 , n 1 , n 2 , m 1 , m 2 , x 21 , x 12 , x 03 , x 20 , x 11 , x 02 , y 30 , y 21 , y 12 , y 03 , y 20 , y 11 , y 02 ] can be determined.
After anamorphic lens calibration, we should calibrate the relative position of the anamorphic lens in the vertical position and the horizontal position. Two images of the 3D calibration target are captured, one for the vertical position and one for the horizontal position. Based on the calibrated internal parameters of the anamorphic lens and the image of the 3D calibration target, the relative position [t x , t y , t z , a, b, r] between the 3D calibration target and the anamorphic lens can be easily calibrated: where T and R refer to the translation vector and the rotation matrix. For the two anamorphic positions, there are the following equations between the coordinates of the 3D calibration target and the two anamorphic coordinates in the two positions: where the superscript W refers to the coordinates of the 3D calibration target, and the subscripts CV and CH refer to the coordinates of the anamorphic lens in the vertical and horizontal positions. Given Equation (11), the relationship between the vertical and the horizontal anamorphic coordinates can be determined as follows: where R CV CH and T CV CH are determined as follows: The horizontal position is rotated from the vertical position by −90 • along the optical axis; thus, the relative position between the two anamorphic positions is similar to [t x , t y , t z , a, b, r] = [0 mm, 0 mm, 0 mm, 0 • , 0 • , 90 • ]. After the anamorphic lens calibration and the stereo calibration for the rotating anamorphic lenses, the 3D reconstruction using rotating anamorphic stereo vision is similar to that in stereo vision with spherical lenses.

Experiments
An experiment was performed to validate the proposed 3D metrology method using one camera with rotating anamorphic lenses. The design of the experiment is shown in Figure 7. The camera was MER-504-10Gx-P from Daheng China, and its resolution was 2448 × 2448 with a pixel size of 3.45 µm × 3.45 µm. The anamorphic lens was mounted on the rotary table HK130-10. The servo motor was SGM7J-02A7C6E, and the servo controller was SGD7S-1R6A00A002, both from YASKAWA, Japan. As shown in Figure 7, the 3D calibration target was composed of two 2D planar calibration targets, and the relative position of the two planar calibration targets was determined by the 3D calibration target camera, which was previously calibrated. As shown in Figure 8, the anamorphic lens was composed of a front anamorphic attachment and a 16 mm Computar spherical lens. As shown in Figure 9, the anamorphic attachment comprised three cylindrical lens elements, and the effective focal length in the YOZ plane was −2489 mm. A paraxial lens design for anamorphic lenses can be seen in [27,28]. The lens parameters for the anamorphic attachment are shown in Table 1.    The anamorphic lens was calibrated using 3D and 2D calibration targets, and the internal parameters are shown in Table 2. And as shown in Figure 7, the relative position of the vertical position with respect to the horizontal position was calibrated using the 3D calibration target, and the results were [t x , t y , t z , a, b, r] = [−0.8943 mm, 0.3591 mm, −0.1712 mm, −0.5586 • , −0.8074 • , 90.0059 • ]. After the anamorphic lens calibration and the rotating anamorphic stereo calibration, we conducted the 3D metrology using the rotating anamorphic lens. As shown in Figure 10, to achieve dense 3D points, a checkerboard was adopted with a square's length of 5 mm. The original anamorphic images are shown in Figure 10. Figure 10a shows the image when the anamorphic lens was in the vertical position, and Figure 10b shows the image when the anamorphic lens was in the horizontal position. Figure 10b was achieved by rotating the anamorphic lens by −90 • anticlockwise along the optical axis. Once the corresponding corners in Figure 10a,b were determined, the 3D coordinates of the corners could be reconstructed from the rotating anamorphic stereo vision.  One possible method to determine the corresponding corners between Figure 10a,b is to trace the corners while rotating the anamorphic lens, similar to Figure 6. In order to trace the corners correctly, the rotating speed must be limited. Another method is to rectify the two anamorphic images by the anamorphic ratio AR, as shown in Equation (6), after which the corresponding points are very close, as in Figure 5.  Figure 11a,b, the two images are very similar after AR rectification, and the corresponding points are nearby, for the overlapping areas in Figure 11a,b. The chessboard corners in Figure 11a were extracted and represented as red points in Figure 12; the corners in Figure 11b were represented by green circles in Figure 12. The red points and green circles in Figure 12a are in their original positions. It can be seen that the corresponding corners were not adjacent and were separated from one another. This is because there was a misalignment between the optical axis and the rotation axis of the rotary table. This misalignment was further amplified by the large object distance. If Equation (7) is directly applied for 3D reconstruction, there will be significant errors. Thus, the rotating anamorphic stereo vision was adopted for the 3D reconstruction. As can be seen in Figure 11, the two images are similar, the only difference between Figure 11a,b being a decentering. If we shift Figure 11b by (d u , d v ) = (105.0792 pixels, −28.8297 pixels), the two images will overlap. In Figure 12b, the corresponding points are very close, as shown in Figure 5. Given the internal parameters of the anamorphic lens, the relative positions between the vertical anamorphic lens and the horizontal anamorphic lens, and the corresponding image points, the 3D coordinates of the corners could be reconstructed using the rotating anamorphic stereo vision. As shown in Figures 13 and 14, the 3D positions of the corners in checkerboards were constructed. Figure 13 shows the images of the checkerboards when the anamorphic lens was in the vertical position, and Figure 14 shows the images of the calibration targets when the anamorphic lens was in the horizontal position. When constructing the eight objects, the first two objects were 3D objects, and the other six objects were 2D objects. The constructed 3D points are shown in Figure 15, while not all corners in the checkerboard were reconstructed. Some points were no constructed for they lay in the anamorphic gas where the construction accuracy was very low. The anamorphic gas is discussed in detail in Section 4.2.2. As can be seen in Figure 15, the reconstruction accuracy was low compared with that of the stereo vision. The accuracy of this metrology method is also discussed in Section 4.2.

Accuracy Analysis
As shown in Equation (14), the pixel error was the main source of error for this metrology, though other parameters such as ad, f x , and f y are also very important. This method's measuring principle is based primarily on the anamorphic distance, which changes the image position compared to spherical lenses. The anamorphic distance ad shown in Section 4.1 was small in comparison to the object distance; thus, any small pixel position error would have a significant impact on the measurement results. From Equation (7), we have: where δx h , δx v , and δy v are the pixel errors. If we substitute the pixel errors in Equation (14) with δ, the point error can be deduced from Equation (14) as follows: where the coefficients x 2 y 2 , x 2 , x 1 y 1 , and y 2 in Equation (15) are given by: To further evaluate the measurement accuracy, we conducted two simulation experiments. The simulation anamorphic lens was the same as the anamorphic lens shown in Section 3.2: f x = 12 mm, f y = 16 mm, aa = 0 • , and ad = 30 mm.

Accuracy Analysis for a Point
First, we simulated an object point with the coordinates [X C , Y C , Z C ] = [500 mm, 500 mm, 1500 mm] in anamorphic coordinates for the vertical position. The pixel coordinates of the point in the vertical and the horizontal anamorphic positions were calculated using Equations (3)- (6). Given the pixel coordinates and the calibrated parameters of the rotating anamorphic stereo vision, the 3D coordinates of the point could be calculated. The pixel errors in the image plane were assumed to have a Gaussian normal distribution with a standard deviation of 0.2 pixels, which was the calibration result of the anamorphic lens. Then, 5000 3D points were reconstructed with varying pixel errors, and the reconstructed 3D points are shown in Figure 16. The standard deviation of the reconstructed 3D point was 17.3378 mm.

Accuracy Analysis for a Surface
We also simulated a set of object points in a plane. The X C and Y C coordinates ranged from −1000 mm to 1000 mm, with an interval of 50 mm, and all the Z C were 1500 mm. The pixel errors in the image plane satisfied a Gauss normal distribution, and the standard deviation of the pixel error was set to 0.2 pixels. The standard deviation for each reconstructed 3D point is shown in Figure 16. As can be seen in Figure 17, the measuring accuracy for the points away from the X C axis was high, while it was very low if the object points were near the X C axis. The points near the X C axis were removed, which left a gap in Figure 17. Thus, there was a measuring gap if rotating anamorphic lenses were used for 3D construction. We named this gap the anamorphic gap.  Standard deviation for object points in a plane. The standard deviations for object points with small Y C coordinates were removed for large reconstruction errors. The standard deviation of the pixel position was 0.2 pixels, the ad was 30 mm, and the Z C was 1500 mm.
If we individually increase the anamorphic distance from 30 mm to 100 mm, the measuring accuracy will increase correspondingly, as shown in Figure 18. The lens parameters ad, f x , and f y are closely related because they are determined by the anamorphic lens structure, and it is not possible to simply change one parameter independently [25]. We proposed paraxial lens designs for anamorphic lenses with zero anamorphic distance [26], but designing an anamorphic attachment with an extremely large anamorphic distance appeared to be difficult. The measuring precision of this 3D metrology method appeared to be lower than that of stereo vision with spherical lenses. The fundamental reason for this is that, in comparison to stereo vision, the baseline distance between the two anamorphic positions was quite small. The measuring precision will be as good as that of stereo vision with spherical lenses if the two anamorphic lenses are sufficiently apart from each other. Because the two images are captured with the same revolving anamorphic lens, the main advantage of this 3D metrology is its ease of point matching. The appropriate matching points are very close if the two images are rectified with the anamorphic ratio, as shown in Figures 5  and 12. Alternatively, as illustrated in Figure 6, it is possible to trace the matching points by rotating the anamorphic lens. When the anamorphic lens is rotated at a rapid speed, it can measure 3D data four times in one circle, which is ideal for a quick 3D reconstruction with low measurement accuracy. One potential application of this would be car navigation.

Conclusions
A 3D metrology method using one camera with rotating anamorphic lenses is proposed in this paper. The anamorphic lens can rotate by −90 • along the optical axis, capturing two anamorphic images of an object before and after the rotation. This setup is similar to that of stereo vision; therefore, it can be considered a stereo vision with anamorphic lenses. The main differences between stereo vision and rotating anamorphic lenses are that anamorphic lenses replace spherical lenses, and the baseline distance between the two anamorphic lenses is very small. This feature will make rotating anamorphic lenses a compact sensor suitable for 3D metrology in a constrained space. The feasibility of the proposed method in 3D reconstruction is based on one internal parameter of anamorphic lenses, i.e., the anamorphic distance, which will slightly change the image position of the object. The corresponding points between the two anamorphic images are close if the two anamorphic images are rectified by the anamorphic ratio, which substantially simplifies the corresponding point matching and reduces the calculation amount. When compared to stereo vision, the measurement accuracy of the rotating anamorphic stereo vision is lower, especially for the image points near the X C axis of the anamorphic lens in the vertical position. These characteristics make the rotating anamorphic stereo vision suitable for a fast 3D reconstruction without a high demand for measurement accuracy, such as car navigation applications. Further research might include high precision anamorphic lens calibration, error compensation, point matching for rotating anamorphic lenses, and anamorphic lens designs with a large anamorphic distance.

Data Availability Statement:
The data underlying the results presented in this paper are not publicly available at this time but may be obtained from the authors upon reasonable request.

Conflicts of Interest:
The authors declare no conflict of interest.