2.1. Measurement Principle of the Stereo Bi-Telecentric PMD
As shown in
Figure 5, similar to stereo PMD with endocentric lenses [
32], the reconstruction of the SUT in the stereo bi-telecentric PMD system can be accomplished through anchor point positioning, followed by iterative surface
S reconstruction.
- (1)
The detailed positioning procedure for anchor point
Z will be discussed in
Section 3.1, which deals with the triangulation in stereo-PMD setup. Although bi-telecentric lenses exhibit significantly lower distortion compared to endocentric lenses, it is still necessary to accurately handle the distortion mapping relationship during the anchor point positioning process to improve the accuracy of the measurement system. The distortion mapping for the pixel coordinate
upA and 3D point
pA in camera A will be discussed in
Section 3.2, while the inverse distortion mapping for the 3D point
pB and pixel coordinate
upB in camera B will be discussed in detail in
Section 3.4.
- (2)
Once the anchor point has been established, the iteration starts with initial plane
S0 in mono-PMD setup. Then the slope data of the guessed surface can be calculated. The updated iteration surface
Sn can be calculated by the integral reconstruction of the slope data [
48,
49], until the iteration result converges [
50].
The developed hardware (as shown in
Figure 6) includes two bi-telecentric lenses with cameras, a flat LCD screen, and a 535 nm, 50 mW laser diode serving as the laser pointer. Since the mirror surface lacks distinct features, it is necessary to utilize its diffuse reflection characteristics during the anchor point positioning process. This can be achieved by using a laser to mark a spot on the surface that exhibits diffuse reflection properties. The model of the bi-telecentric lenses is TC23144, with a nominal magnification of 0.061. The cameras use the Sony IMX264 CMOS sensor with a resolution of 2448 × 2048. The model of the flat LCD screen is a ViewSonic VP2768 with a resolution 3840 × 2160. The LCD coordinate system {L} takes the first row and first column of the LCD screen as the origin, with the
x-axis along the horizontal direction of the LCD screen, the
y-axis along the vertical direction of the LCD screen, and the
z-axis perpendicular to the screen inward.
From the reconstruction procedure, it can be seen that the geometric relationships between the cameras and LCD and the cameras’ intrinsic parameters with distortion must be precisely calibrated. As the extrinsic parameters, the rotation matrix and the translation vector represent the relative positions between {L} and camera A’s local coordinate system {A}. The magnification (along camera horizontal direction) and (along camera vertical direction) are the intrinsic parameters of camera A. The rotation matrix and the translation vector represent the relative positions between {L} and camera B’s local coordinate system {B}. The magnification (along camera horizontal direction) and (along camera vertical direction) are the intrinsic parameters of camera B.
2.2. Formula Derivation in the Calibration
The calibration process starts by placing a flat mirror in 3 different positions, allowing camera A and camera B to capture the phase-shifting fringes on the flat LCD screen (as shown in
Figure 7). The red dots in
Figure 7 are indicated by the laser pointer for anchor point positioning. And the blue frames are the bounding boxes of the red dots. To obtain reliable calibration results, nonlinear errors need to be suppressed [
51]. By the optimal phase-shifting technique [
52], the corresponding physical position
pL = [
xL,
yL,0]
T in the flat LCD coordinate system {L} of camera pixel
up = [
u,
v]
T can be acquired. Because the LCD is flat, the
z-value of
pL is always zero. So the 3D point
pL = [
xL,
yL,0]
T can be noted as a 2D point
pL = [
xL,
yL]
T. Its coordinate in camera B’s local coordinate system {B} is also a 2D point
pB = [
xB,
yB]
T. For camera B, the geometric relationship is drawn in
Figure 8.
The rotation matrix (whose determinant is −1) and the translation vector represent the position relationship between the flat LCD screen virtual image coordinate system {L’} and camera B’s local coordinate system {B} when the flat mirror is at pose 1. The normal of flat mirror in {B} can be noted as Bn = [nx, ny, nz]T. The distance between the origin of {B} and the flat mirror is noted as L.
According to the geometric relationship [
53], the relationship between the 2D coordinates of
p in {L} and {B} can be derived as
where the number in the bottom right corner of the matrix symbol, for example, 2 × 2, represents the upper 2 × 2 submatrix set of this matrix. The geometric relationship between the
pB and its virtual image
p’B with respect to the plane mirror is
where the number 2 × 1 in the bottom right corner of
Bn represents the upper 2 × 1 submatrix set of this
Bn2×1 = [
nx,
ny]
T, and the distance
d between the given point
pB of {B} and the flat mirror is noted as
Combining Equation (3) to Equation (5), the following equation can be obtained as
where
where
I2 means a 2 × 2 identity matrix. As bi-telecentric lenses perform parallel projection, it cannot identify the “
z value” (or depth) from the coordinates of
p and the normals of
n in camera B’s local coordinate system {B}. Thus, these 2D equations in the camera’s local coordinate system can be obtained from the 3D ones by simply taking the first two components.
For the Sony IMX264 CMOS sensor, its pixel size is equal in
x and
y directions. Thus, it can be noted that
, then
up = [
u,
v]
T and
pB = [
xB,
yB]
T have the relationship as follows:
Substituting Equation (6) into Equation (8), the following equation can be obtained as
where
rij is the element of rotation matrix
, and
.
= [
tx,
ty]
T. Equation (9) can be rewritten as
where
hij can be calculated directly from a least square solution from Equation (10). Thus, to calculate
and
,
m must be determined first.
With the orthogonality of the rotation matrix
with reflection,
rij has a relationship as
Since each column of the rotation matrix is a unit vector,
rij has the second relationship as
From Equations (11) and (12), the following equation can be obtained as
From the relationship between
rij and
hij in Equation (10), Equation (13) can be rewritten as
where
m is the maximum non-negative root satisfying
Now
m has been determined. According to Equation (9), the translation vector
can be retrieved by
By Equations (12) and (15),
rij where
can be determined. The signs of
r31 and
r32 are uncertain. Since the rotation matrix is unitary and orthogonal, the remains can be determined by
Now, the following equation can be obtained as
It should be noticed that
has an ambiguous solution. These two solutions are noted as
and
. The reason why there are two solutions of
is that the bi-telecentric lenses perform parallel projection, and cannot identify the depth.
Figure 9 shows the geometric relationship of the two possible LCD virtual images, which the bi-telecentric lenses cannot identify.
2.3. Eliminating Ambiguities within Monocular Setup
According to Equation (7), the rotation matrix
at pose
i (
) can be calculated as
It can be noticed that
and
is orthogonal. Therefore,
is a rotation matrix. The eigenvector
of
corresponding to the unit eigenvalue can be calculated from
It also can be noted that
Compare Equations (22) and (23), which have the relationship as
Here,
is defined as the operator that performs normalization after the cross product. Thus, all the normal vectors of the flat mirror at three different poses can be obtained by
Derived from Equation (6),
Thus, according to [
43] the rotation matrix between camera B and flat LCD screen can be calculated as
where
indicates the square root of the elements within the matrix. The translation vector between {B} and {L} can be determined by a least square solution of
which is a general form
Dx =
c (where
D is a 6 × 6 known matrix,
c is a 6 × 1 know vector, and
x is the 6 × 1 vector of unknown). The reprojection error of the least square process can be defined as
It is very important to know that the ambiguous solution of
may cause an increase in error. The rotation matrix at three different LCD virtual image positions, with each position having two solutions, results in a total of eight possible solutions.
Table 3 and
Table 4 show the reprojection error and solutions of Equation (28) at these eight possible solutions for camera A and B, respectively. For every camera, six incorrect solutions can be eliminated from the
Error, leaving two solutions marked in red and blue in
Table 3 and
Table 4.
2.4. Eliminating Ambiguities within Stereo Setup
Now the stereo system has four solutions. Obviously, the distance
d between the given point
p and the flat mirror should be same in the two cameras’ geometric relationships. Here, the given point can be set as the origin
pL = [0, 0]
T of {L}. Combining Equations (3) and (5), the distance
d can be calculated as
Here, the calculated
d at three poses can be collected as
d = [
d1,
d2,
d3]
T. Thus, the remaining four solutions can be filtered using the
d from Equation (30). As shown in
Table 5,
can be utilized to eliminate two incorrect solutions with higher differences of distance
d. The remaining two solutions are marked in red (as solution A) and blue (as solution B) in
Table 5.
One way to find the last ambiguity is to plot the geometric relationships for each of these two solutions and observe which scenario matches the real physical situation depicted in
Figure 6.
Figure 10 illustrates the geometric relationships of solution A (
Figure 10a) and solution B (
Figure 10b). It can be easily noticed that solution B is the solution that matches the real physical situation depicted in
Figure 6.
Another way to resolve the ambiguity is to use stereo deflectometry technology. For the anchor point highlighted with the laser shown in
Figure 7, the ambiguity solution can be filtered by the residual of the angle
θ minimization between the normal, calculated from camera A and B.
As shown in
Figure 11, the anchor point
Z must hit in the surface under test, when the searching depth
t makes the angle between the calculated
normalA and
normalB equal to zero. The ambiguity solution will make the minimization residual very large.
2.5. Refine Calibration Results by the Bundle Adjustment
Finally, a bundle adjustment with distortion compensation should be performed by Equation (32) to refine all parameters in the above calibration process for accuracy [
54]
where
N is the point sampling number at pose
i.
Ln is the normal in coordinate system {L}.
pLij represents the LCD sampling coordinates at pose
i and sampling order
j. The integer sampling real image coordinates can be represented as
up(
pLij) according to the phase-shifting method. The optimized image decimal coordinates
upd can be calculated from the optimization parameters. Because the phase-shifting method is needed to retrieve the LCD sampling coordinates
pLij, the
u and
v coordinates of
up are all integer camera pixel indices (as in the blue dots in
Figure 12). There will always be some deviation Δ
up between the optimized image coordinates
upd and the real image integer coordinates
up. Here,
upd is noted as the distorted image coordinates
upd = [
ud,
vd]
T (as in the red crosses in
Figure 12). So
ud and
vd are decimal numbers. The relationship between
upd and
upd is
After the bundle adjustment, the calibration results are shown in
Table 6. The calibration procedure for the proposed stereo bi-telecentric phase-measuring deflectometry, which requires only a flat mirror, is illustrated in
Figure 13.
The translation vector
and
in
Table 6 are the 2D translation vectors. The physical implication is that the bi-telecentric imaging system cannot perceive depth information, meaning its spatial position can be at any location along its optical axis. To facilitate subsequent surface reconstruction in 3D space, the depth information component
Tz is added to the 2D translation vector. When
Tz is 0, 50, or 100, the schematic diagram of the position of the bi-telecentric imaging system in the coordinate system is shown in
Figure 14. The value of
Tz does not affect the distribution of the incident light rays for imaging. Therefore, to facilitate the subsequent coordinate transformation calculations, the third dimension
Tz = 0 is added to the translation vector
and
to clearly define the relative spatial position of the bi-telecentric imaging system. Let the previous 2D translation vectors
and
be denoted as
and
, respectively. After adding the depth component
Tz = 0, the resulting 3D translation vectors are