Skip to main content
Sensors (Basel, Switzerland) logoLink to Sensors (Basel, Switzerland)
. 2020 Dec 11;20(24):7107. doi: 10.3390/s20247107

Automatic Calibration of a Two-Axis Rotary Table for 3D Scanning Purposes

Livio Bisogni 1, Ramtin Mollaiyan 1, Matteo Pettinari 1, Paolo Neri 1,*, Marco Gabiccini 1
PMCID: PMC7764672  PMID: 33322387

Abstract

Rotary tables are often used to speed up the acquisition time during the 3D scanning of complex geometries. In order to avoid manual registration of the point clouds acquired with different orientations, automatic algorithms to compensate the rotation were developed. Alternatively, a proper calibration of the rotary axis with respect to the camera system is needed. Several methods are available in the literature, but they only consider a single-axis calibration. In this paper, a method for the simultaneous calibration of both axes of the table is proposed. A checkerboard is attached to the table, and several images with different poses are acquired. An optimization algorithm is then setup to determine the orientation and the locations of the two axes. A metric to assess the calibration quality was also defined by computing the average mean reprojection error. This metric is used to investigate the optimal number and distribution of the calibration poses, demonstrating that the optimum calibration results are achieved when a wider dispersion of the calibration poses is adopted.

Keywords: rotary table calibration, 3D scanning, optical system

1. Introduction

Image-based modeling is the process of reconstructing the three-dimensional geometry and the surface appearance of a real object from its two-dimensional images. In typical applications [1] images are acquired in a controlled environment. In order to achieve a 360° view of a complex object, the scanning must be repeated from different perspectives. Then, acquisition performed from different viewpoints needs to be registered, to reconstruct the full object geometry. The easiest solution to this issue is the manual point cloud registration, which is generally based on the 3-2-1 procedure: the first rough registration is manually provided by selecting three or more corresponding points on the clouds. Then, an iterative closest-point algorithm is run to refine the manual registration [2]. This procedure is robust and versatile, and it does not impose any constraints in terms of scanning perspective, but it requires long processing times. The procedure can be accelerated by gluing markers on the target surface, which can help the user to manually select the corresponding points, or can even allow for automatic algorithms [3]. Nevertheless, the marker placement may be cumbersome and also impossible to use where the surface cannot be altered. An alternative solution to this problem is represented by the use of turntables, which have proven to be effective in the reconstruction of complex shapes [4,5]. The object to be scanned can be placed on a turntable, and a stereo-camera system acquires images, while both orientation and placement of the item are changed within the work space by rotating the table by known angles. The use of a rotary table imposes a constraint to the possible scanning orientations, which can help the development of automatic algorithms to register the point clouds [6,7]. In addition, knowing the precise position and orientation of the turntable axis can further improve the registration step [8,9,10]. To this extent, a proper calibration of the acquisition system is necessary to obtain satisfying results.

The camera calibration problem has been extensively studied by researchers, and several approaches have been proposed. Linear methods [11,12] adopt a simple pinhole camera model and incorporate no distortion effects. Despite the algorithm being fast and non-interactive, neglecting camera distortion implies that lens distortion effects cannot be compensated for. Conversely, non-linear techniques [13,14,15] use general camera models, which also incorporate distortion parameters. At first, a relation between parameters is established, and then an iterative solution is found by minimizing properly defined error terms. Typically, the iterative procedure requires an initial guess, which often dictates the quality of the convergence. However, the most common approach is represented by two-step techniques [16,17,18], where in the first step, a direct solution of some parameters is given, and then an iterative procedure is followed in order to compute the other parameters as well as to reduce the error of the direct solution. The research on stereo camera systems calibration pushed forward the calibration of non-conventional optical setups based on mirrors (catadioptric systems), such as [19,20,21,22] which solve the problem of spherical mirror calibration to achieve an omnidirectional scanning.

Although technical literature well addresses the camera calibration problem, the extraction of the rotation axis of the turntable with reference to the fixed camera coordinate frame still deserves attention. Many different approaches have been found dealing with single-axis calibration: Mülayim et al. [23] proposed a multi-image approach capable of extracting the rotation axis of a single-axis turntable with respect to the camera coordinate frame. Li et al. [24] calibrated the rotation axis by means of a test sphere with a known diameter mounted on the turntable, similarly to [25]. Bi et al. [26] used a cuboid block and edge detection to assess the rotation axis. Langming et al. [27] developed a procedure based on the scanning of a cylindrical specimen. Ye et al. [28] used a planar specimen acquired in different orientations, basing the calibration on the intersection lines between subsequent planar surfaces. Chen et al. [29] formalized the problem as a constrained global optimization problem. However, these techniques do not generalize when a multi-axis turntable is considered, since each axis has to be calibrated separately, one after the other. Furthermore, no strict information about the placement of the calibration target as well as the number of images to be acquired is given in order to obtain acceptable results.

In this study, a novel approach for the calibration of a two-axis turntable is proposed. At first, a mathematical model for the rotation of a point attached to the turntable has been formalized and exploited in order to provide a minimum least-squares estimation of the two rotation axes as well as their distance with respect to the reference camera. Afterwards, a further analysis, based on optimal conditions to calibrate the rotary table, was conducted in order to optimize the estimates of the calibration process. Optimal conditions are considered to be the number and the orientation of placements of the calibration board with respect to the stereo-camera system. Qualitative criteria are finally provided based on experimental results.

2. Materials

With reference to Figure 1 the image acquisition system consisted of a fixed stereo-camera system, a rotary table, and a computer. The stereo-camera system, shown in Figure 1a, is characterized by two digital cameras with a resolution of 1600 pixel × 1200 pixel (The ImagingSource® DMK 51BU02), equipped with lenses having a 16 mm focal length, and a 1024 pixel × 768 pixel multimedia DLP projector (OPTOMA EX330e, resolution XGA 1024 pixel × 768 pixel). Figure 1b shows the two-axis rotary table developed in this work. The overall system schematic, reporting the main reference frames, is represented in Figure 2. The first axis is parallel to the camera image plane while, by construction, the second is perpendicular to the first; the two axes are also assumed to intersect each other. It is reasonable to make such an assumption, since the rotary table was designed as a CNC (Computer Numerical Control) machine with high dimensional accuracy. An asymmetrical checkerboard of 7 × 10 squares (each square having size of 12 mm × 12 mm), resulting in M=54 inner corners, was attached to the turntable during the image acquisition process. This pattern allows for extraction of the point sets as they are placed in corners on the squares (excluding those on the external side of the checkerboard). Therefore, information on the table configuration, through the arrangement of the points in space, can then be deduced.

Figure 1.

Figure 1

Main instruments used for experimentation: (a) stereo-camera system; (b) two-axis turntable with checkerboard attached.

Figure 2.

Figure 2

Axes and system representations: (a) 3D axonometric view; (b) 2D top view.

Each axis of the turntable was moved by means of a stepper motor, respectively a NEMA 23 for the vertical axis and a NEMA 17 for the horizontal axis. Both steppers were controlled via Arduino Uno with the addition of the Adafruit Motor Shield V2. The overall system was controlled via Matlab® on a PC platform where a Graphic User Interface (GUI) has been developed in order to simplify the entire workflow, providing an interface that allows to control the settings of cameras, image acquisition, table calibration, and analysis results. The software is available as a free package at [30], and a brief description of the GUI is given in Appendix A.

3. Calibration Approach

The geometrical construction of the system was exploited for the implementation of a suitable calibration procedure of the two-axis turntable. We assume that the centers of the tables are disposed such that their axes intersect perpendicularly at point q. That bears the advantage to consider a single point of application of rotation for both axes. Hence, just a single position vector from the cameras is enough. Since the orientation of the camera system, chosen as a global reference, was different from those of the tables, axis-angle notation was used to describe the rotation of each table.

The general rotation of a point around an axis outside of the origin, as shown in Figure 3, is represented as follows:

p=Rω(θ)(pq)+q, (1)

where p is a generic point positioned on a system rotating around an axis with unit vector ω going through point q, p is the rotated point, and Rω(θ) is the axis-angle parametrization of the rotation matrix in which θ is the angle of rotation. Equation (1) can be expressed as a rigid-body transformation in homogeneous coordinates as follows:

p1=Rω(θ)(IRω(θ))q01p1 (2)

Figure 3.

Figure 3

Rotation of a point p by an angle θ around a single axis ω.

Equation (2) can be applied to the studied system. As shown in Figure 2, the axis of the horizontal table is defined as ω1, the axis of the vertical as ω2, θ1 is the angle of rotation around ω1, and θ2 the angle around ω2. Since ω2 lies in the reference system of the horizontal table, the global transformation must be defined in the following order:

p1=T(ω1,ω2,q;(θ1,θ2))p1=Rω1(θ1)(IRω1(θ1))q01Rω2(θ2)(IRω2(θ2))q01p1=Rω1(θ1)Rω2(θ2)(IRω1(θ1)Rω2(θ2))q01p1 (3)

The axis-angle representation provides the advantage of being a direct function of the components of the axis unit vector for both tables. The two axis unit vectors ω1 and ω2, together with the global coordinates of their intersection point q from the camera frame, denoted in Figure 2 as {Sc}, are used as input parameters for an optimization procedure that finds the solutions through a nonlinear least-squares approach.

First, an initial reference pose XR is acquired, which is associated to angle configuration (θ1=θ2)=(0°,0°). Then, N poses X¯i (i=1,,N) are acquired by rotating around both axes ω1 and ω2 in their working range of interest. From each of the N poses, a point cloud in the 3D space is extracted, corresponding to the checkerboard corners, thus obtaining the measured pose X¯i. The theoretical relation between a generic (ideal) pose Xi and the reference pose XR would be

Xi=T(ω1,ω2,q;(θ1,θ2)i)XR,i=1,,N (4)

where both Xi and XR are expressed in homogeneous coordinates. However, since measured point clouds X¯i are considered, which are affected by various error sources, the following equations can be written:

X¯1T(ω1,ω2,q;(θ1,θ2)1)XR=δX1X¯2T(ω1,ω2,q;(θ1,θ2)2)XR=δX2=X¯NT(ω1,ω2,q;(θ1,θ2)N)XR=δXN (5)

where δXiR4×M (i=1,,N) are the residual errors between measured and ideal coordinates of corresponding point clouds originated by XR, and where M are the points (extracted via software) on the checkerboard.

Finally, a nonlinear least-squares estimation of the parameters is established to minimize the mismatch between measured and ideal point cloud coordinates. The optimization function is therefore based on Equation (5), where the table rotation angles are known by counting the steps provided to the stepper motors (since the rotational speed is low, it is reasonable to neglect step losses). On the other hand, q,ω1, and ω2 are unknown and should be estimated. A formalization of the nonlinear least-squares estimation, minimizing the sum of squared Euclidean error norms, is provided as follows:

minω1,ω2,q12i=1Nj=1Mp¯jipji(ω1,ω2,q;(θ1,θ2)i)22, (6)

where i is the pose index examined (i=1,,N), j is the point index in the checkerboard (j=1,,M), and p¯ji is the corresponding rotated point (Cartesian coordinates) measured on the checkerboard. Point pji(ω1,ω2,q;(θ1,θ2)i) is obtained from the rotation of the reference pose by θ1,i around axis ω1 and θ2,i around axis ω2, both intersecting at the point q. The optimization must also satisfy the following constraints:

{(7a)ω1Tω2=0(7b)ω1Tω1=1(7c)ω2Tω2=1

where (7a) indicates the perpendicularity between the axes, whereas (7b) and (7c) impose the condition for ω1,ω2 of having unit length.

For instance, the proposed method was employed for the calibration of a two-axis rotary table, using the hardware previously described in Section 2; hence, M=54 points per grid were considered. At first, 100 stereo-pair images were acquired in different poses (θ1,θ2)i,i=1,,N of the rotary table. Then, using an estimation of (ω1,ω2,q) yielded by (6) applied to all the N=100 stereo-pair images, and by taking the inverse of (4), the measured grids X¯i,i=1,,N were reprojected onto the reference grid X¯R. Finally, the N·M point-to-point errors committed were computed. Figure 4 shows the error cloud in the 3D space, expressed in the camera frame {Sc}, whereas Figure 5 shows these errors in the three Cartesian planes. The absolute error was lower than 1 mm in every direction.

Figure 4.

Figure 4

Dispersion of the M=54 point-to-point errors in the 3D space—for a given set of N=100 images—committed using an estimation of (ω1,ω2,q) yielded by (6) and expressed in the camera frame {Sc}.

Figure 5.

Figure 5

Same error cloud of Figure 4, plotted in the three Cartesian planes: (a) XY-plane; (b) YZ-plane; (c) ZX-plane.

4. Influence of the Number of Calibration Images

Calibration quality depends both on the number K of poses used and on their spatial location, i.e., (θ1,θ2)i, i=1,,K. Hence, it is useful to investigate the influence of the number K of images to be captured towards a quality and fast calibration. To this extent, a proper metric was introduced, as discussed further in this section.

4.1. Data Set Definition

Any i-th image, i=1,,K, can be captured in the rotary table joint configuration Space S, S[180°,180°]×[180°,180°]. This is the space any pair of angular positions (θ1,θ2)i, i=1,,|S|, belongs to, i.e., S=[θ1,min,θ1,max]×[θ2,min,θ2,max]. In order to assess the influence of the number of images K, a test run was conducted. First of all, a set of images was captured in S (Acquisition set A, AS). Then—excluding an image SR which is taken as Reference—it was partitioned into two subsets: the Calibration set C, CA, and the Test set T, TA, so that CT=ASRCT=. C is the set from which to select the desired subset CH of K images to calibrate the turntable with, whereas T is the set subsequently used for quantifying the calibration error achieved with CH. With respect to C, for each K, K=1,,|C|, a series of bK subsets CH, CHC could be extracted, where H is a set of indices i, K is the size of H, and bK is the following binomial coefficient:

bK=|C|K=|C|!K!(|C|K)!,K=1,,|C| (8)

In the present study, a S=[36°,+36°]×[90°,+90°] was considered. Such S ensures that the checkerboard remains visible from the stereo-camera system during the entire acquisition process. To discretize S, a uniform sampling was performed, obtaining 101 images: the first one was associated to (0°,0°) and was taken as reference, whereas the remaining 100 were equally spaced in steps of size (δθ1,δθ2)=(8°,20°) within S, as in Figure 6. Lastly, the obtained A was partitioned into two equally sized and spaced sets C and T. In more detail:

  • S=[θ1,min,θ1,max]×[θ2,min,θ2,max]=[36°,+36°]×[90°,90°];

  • A={(θ1,θ2)ii=1,,NA}, where NA=|A|=101;

  • C={(θ1,θ2)2r+1r=1,,NC}, where NC=|C|=NA12=50;

  • T={(θ1,θ2)2ss=1,,NT}, where NT=|T|=NA12=50;

  • H{3,,2r+1,,NA} is a set of indices i, where r=1,,NC, that denotes the pairs of angular positions (θ1,θ2)i, i=2r+1, of the subset of images to calibrate with;

  • K=|H|, K{1,,NC}, is the size of H, i.e., the number of images considered;

  • CH={(θ1,θ2)hhH}.

Figure 6.

Figure 6

Acquisition setA within the joint configuration Space S; the red points constitute the Calibration set C, whereas the blue are the Test set T and black is the reference. The number next to a point of coordinates (θ1,θ2)i denotes the index i of the corresponding image; any combination of the indices highlighted in red constitutes a possible subset H of size K.

The i-th pair of angular positions is given by

(θ1,θ2)i=(0°,0°)i=1(θ1,min+(m1)·8°,θ2,min+(n1)·20°)i=2,,NA (9)

where

m=i+810n=mmod2·i+910m+m+1mod2·10m+2ii=2,,NA (10)

4.2. Error Metric Definition

The checkerboard, shown in Figure 7, consists of 7 × 10 squares, so the number of inner-corners M is (71)×(101)=54. Figure 7 shows the turntable with the attached checkerboard in two different poses: Figure 7a is the reference pose at (θ1,θ2)1=(0°,0°), whereas Figure 7b represents a generic i-th configuration, which is taken as target at (θ1,θ2)i. Given the i-th pose expressed in the coordinate frame {Sc}, i=1,,NA, and recognizing the i-th Equation in (5), it is possible to rotate by (θ1,θ2)i its measured target grid X¯i (blue dots in Figure 7b and Figure 8a) onto the reference grid X¯R=X¯1 (red dots in Figure 7a and Figure 8), thus obtaining the reprojected grid XR=X1, as shown in Figure 8b.

Figure 7.

Figure 7

Checkerboard in two different poses and their M highlighted inner corners: (a) reference grid (X¯R, in red); (b) target grid (X¯i, in blue).

Figure 8.

Figure 8

The two measured grids of Figure 7 in the operative space: (a) reference grid (X¯R, in red; as in Figure 7a) and target grid (X¯i, in blue; as in Figure 7b); (b) reference grid (in red), and target grid rotated by (θ1,θ2)i onto the reference grid (XR, in blue); virtually identical because of the low reprojection error.

Hence, given a subset CH within the Calibration set C of K images, and based on the results described in the previous section, it is possible to calibrate the rotary table, obtaining an estimate (ω˜1,ω˜2,q˜)H of (ω1,ω2,q). A series of metrics was arranged to quantify the reprojection accuracy obtained to reproject all NT grids of the Test set T onto the reference grid X¯1 using the calibration results acquired with the subset CH of K images. The subscript H highlights the dependency of the two axes, ω1 and ω2, and of their intersection point, q, on the particular subset of images used, thus (ω˜1,ω˜2,q˜)H.

Considering only the grids belonging to T, for a given H, the point-to-point error between a j-th measured point p¯j1 on the reference grid X¯1 and the reprojection of the j-th point pj1((ω˜1,ω˜2,q˜)H;(θ1,θ2)2s) of the 2s-th target grid X¯2s onto X¯1, i.e., X1=T1((ω˜1,ω˜2,q˜)H;(θ1,θ2)2s)X¯2s, where j=1,,M and s=1,,NT, is

ϵj,2s,H=p¯j1pj1((ω˜1,ω˜2,q˜)H;(θ1,θ2)2s)2,j=1,,M,s=1,,NT,H{3,,2r+1,,NA},r=1,,NC (11)

The arithmetic mean of ϵj,2s,H over M points yields the 2s-th averaged point-to-point error committed using the (ω˜1,ω˜2,q˜)H that was estimated through the calibration previously made with the grids X¯h, hH(θ1,θ2)hCH, and for the target grid X¯2s, s=1,,NT:

ϵ2s,H=j=1Mϵj,2s,HM,s=1,,NT,H{3,,2r+1,,NA},r=1,,NC (12)

Finally, averaging all of the NT averaged point-to-point errors over the entire Test set T gives the T-averaged point-to-point error, yielding the reprojection accuracy:

ϵ¯H=s=1NTϵ2s,HNT,H{3,,2r+1,,NA},r=1,,NC (13)

Additionally, the root mean square (RMS) of these errors was defined as

σ¯H=s=1NT(ϵ2s,Hϵ¯H)2NT1,H{3,,2r+1,,NA},r=1,,NC (14)

The number of possible subsets CH of size K that can be employed for calibration is given by the binomial coefficient bK in (8). First of all, in order to have a rough estimation of the effect of K on the calibration accuracy, and to reduce the computational time, for each K, K=2,,NC only NRK=1000 combinations of CH are randomly extracted, obtaining NC1 sets RK, and NRK is the size of RK, i.e., NRK=|RK|. The case K=1 is not considered from now on since it is not sufficient to calibrate a two-axis rotary table. Then, all the RK sets, K=2,,NC, were used to execute (NC1)·NRK=49,000 independent table calibrations. Subsequently, their respective T-averaged point-to-point errors ϵ¯H given by Equation (13), HCHRK, were computed. Finally, averaging them over RK, where K=2,,NC, returns NC1RK-averaged point-to-point errors:

E¯K=HCHRKϵ¯HNRK,K=2,,NC (15)

Additionally, the root mean square (RMS) of these errors was defined as

σ¯K=HCHRK(ϵ¯HE¯K)2NRK1,K=2,,NC (16)

An overview of the errors, and their RMS, is presented in Figure 9 for K=2,,Nc. As can be seen, both E¯K and σ¯K decrease when K increases. While the effect of K on E¯K seems to saturate for K greater than 10, it can be noted that E¯K still decreases with K. Thus, if the poses are randomly chosen, greater values of K are more likely to produce high-quality calibrations. Nevertheless, even a small K can provide high-quality calibration results, if the poses are properly chosen as demonstrated in the following.

Figure 9.

Figure 9

The RK-averaged point-to-point errors E¯K (blue dots) and their RMS σ¯K (red circles) for K=2,,NC.

4.3. Methods Comparison

In order to verify its effectiveness, the developed algorithm was compared with the circles method proposed by Chen et al. [29]. Hence, several combinations of images were extracted from the Calibration Set, and the calibration of the two-axis rotary table was carried out using both methods. It is worth mentioning, being that the circles method is a single-axis procedure, the vertical axis ω1 was firstly calibrated, and subsequently the horizontal axis ω2 was considered. For each combination H of images, the T-averaged point-to-point error ϵ¯H and its standard deviation σ¯H were computed by considering all the images of the Test Set. The results are reported in Table 1, comparing the two methods for the tested calibration sets.

Table 1.

Comparison between the proposed method and the circles algorithm.

Combination Circles method Proposed method
H ϵ¯H [mm] σ¯H [mm] ϵ¯H [mm] σ¯H [mm]
{59,79,99,93,95,97} 1.6956 0.1488 0.3579 0.1758
{35,55,75,95,93,97,99} 0.8038 0.2310 0.3414 0.1711
{13,33,53,73,93,95,97,99} 0.5283 0.1833 0.3352 0.1678

It is possible to observe that the proposed method returned almost constant values of ϵ¯H and σ¯H (i.e., 0.330.36 mm and 0.160.18 mm, respectively), which slightly decreases with the increasing of K. On the contrary, a different behavior was noticed in the circles procedure case, where ϵ¯H decreased but not σ¯H, since this method is influenced appreciably by the specific calibration poses. In addition, the range of values of both ϵ¯H was considerably wider (i.e., 0.521.70 mm) than the results of the proposed method. Hence, the proposed method seems to be more robust and reliable with respect to the circles algorithm.

5. Optimal Calibration Set

On the basis of the data obtained in the previous section, a visual inspection was conducted to find out whether a certain pattern in the joint configuration Space S yielded preferred calibration results. No recurrent pattern (e.g., “X”-like, cross-like, circle-like, square-like, etc.) was evident among either of the studied subsets, which had led to quality calibrations of the tables or among the ones with poorer calibrations. Nevertheless, a direct correlation between dispersion of subsets and calibration quality has been found: for any given H, the more uniformly distributed the cloud of K points (θ1, θ2)hCHS, hH, the lower its calibration error ϵ¯H. For instance, in Figure 10, two opposite situations are reported. A wide dispersion can be noted in (a), corresponding to ϵ¯H=0.3445 mm, while a lower dispersion can be noted in (b), which corresponds to ϵ¯H=0.4239 mm.

Figure 10.

Figure 10

Two investigated subsets with the same number K of points (θ1,θ2)h within the joint configuration Space S: (a) H = {5, 13, 25, 33, 43, 47, 69, 77, 81, 87}, K = 10, CH = {(−36°,−30°), (−28°, 70°), (−20°,−30°), (−12°, 70°), (−4°,−70°), (−180°, 10°), (12°, 50°), (20°,−10°), (20°,−70°), (28°, 10°)}, which has a higher dispersion; (b) H = {17, 19, 25, 37, 39, 41, 43, 65, 67, 79}, K = 10, CH = {(−28°,−10°), (−28°,−50°), (−20°,−30°), (−12°,−10°), (−12°,−50°), (−12°,−90°), (−4°,−70°), (12°,−30°), (20°,−10°), (20°,−50°)}, which has a lower dispersion.

5.1. Complete Graph Index

To quantify the scattering of any desired set of arbitrary dimension K, an index (ICG) was devised based on the calculations of the arithmetic mean of all the weights of a weighted complete graph (CG). The subset of Figure 10a can be considered as an example. If its points were regarded as the vertices of a graph, it would be possible to think of their edges as being weighted by their Euclidean distances; hence, they can be summed and finally averaged by the number of links. Among all the weighted undirected graphs, the weighted complete graph (CG) was chosen, since it has the property to take into account all the pairs of points. In Figure 11 the CG constructed from the subset of Figure 10a is shown; it is possible to see its K points (nodes of CG, in red) and their (K2) links (edges of CG, in blue).

Figure 11.

Figure 11

Complete graphs on the nodes in CH of Figure 10: the K red points are the vertices, whereas the (K2) blue dotted lines constitute the edges: (a) CH is the same as Figure 10a; (b) CH is the same as Figure 10b.

Given K points vt=(θ1,θ2)t,t=1,,K, it is advantageous to normalize them so that the index does not depend on the length of S ([θ1,min,θ1,max]×[θ2,min,θ2,max]). The normalized angular positions v^t=(θ^1, θ^2)t,t=1,,K, are obtained by applying the following normalizations:

(θ^1,θ^2)t=(θ1,θ2)t(θ1,min,θ2,min)(θ1,max,θ2,max)(θ1,min,θ2,min),t=1,,K (17)

where (θ^1,θ^2)t are the normalized coordinates of v^t along the ω1-axis and the ω2-axis, respectively. The weighted complete graph of order K considered is the pair (G,w), where

  • V={v^tt=1,,K} is the set of vertices (normalized angular positions);

  • E={(v^t,v^u)t,u=1,,K,u>t} is the set of edges;

  • G=(V,E) is a graph;

  • |E|=K2=K(K1)2;

  • w:ER0 is the weight function;

and the weight function is the Euclidean distance between any pair of vertices:

w=v^tv^u2=(θ^1,tθ^1,u)2+(θ^2,tθ^2,u)2,t,u=1,,K (18)

The ICG index reported in (19) sums the weight function w evaluated in every pair of normalized points (v^t,v^u),t,u=1,,K,u>t and K>1 (the case K=1 must be avoided since at least two images are required to calibrate a two-axis rotary table), then divided by 2 times the number of pairs (|E|):

ICG=t=1Ku=1u>tKv^tv^u22|E| (19)

The dividing factor 2|E| is useful for normalizing the index value with respect to the number of chosen images K, so that ICG[0,1]KN,K>1. For instance, the subset in Figure 10a has a ICG=0.4036, while the less scattered subset in Figure 10b gives a ICG of 0.2684.

5.2. Index-Based Analysis and Experimental Results

Let us now consider the joint configuration Space S, the Acquisition set A, the Calibration set C, the Test set T, and all the bK subsets CHC presented in Section 4, as in Figure 6. Given a CH set of K images, the index is

ICG,H=tHuHu>tv^tv^u22|E|,H{3,,2r+1,,NA},r=1,,NC (20)

In order to examine the relationship between ϵ¯H and ICG,H, K=7 has been selected, since it guarantees a relatively low binomial coefficient (Equation (8)), being b7=(507)=99884400. Firstly, ICG,H is calculated for all the b7 possible combinations of CH, obtaining the array Ib7. Then, this is sorted in ascending order of ICG,H, obtaining the ordered array Ib7¯. In order to reduce the computing time, Ib7¯ was downsampled by a factor of Δ=1000, obtaining N=b7Δ=99885 calibrations (ω˜1,ω˜2,q˜)H, equally spaced between minIb7¯ and maxIb7¯. The corresponding T-averaged point-to-point errors ϵ¯H were computed, as expressed in Equation (13), and shown in Figure 12a for all the N unsorted calibrations. Finally, these errors are graphed in function of ICG,H. Such plot is shown in Figure 12b: increasing the index, the errors tend to decrease. Moreover, it is clear that the greater the value of ICG,H, the lower the expected value of ϵ¯H and its variance.-

Figure 12.

Figure 12

Relationship between ϵ¯H and ICG,H for N = 99,885 calibrations made using N CH subsets of K = 7 images. These subsets were uniformly downsampled by a factor of Δ = 1000 among all the b7 combinations of CH, then finally used for estimating (ω1,ω2,q), thus obtaining N (ω˜1,ω˜2,q˜)H: (a) the order is the same as in Ib7; (b) the order is the same as in Ib7¯.

The same analysis was conducted for K=2, K=4, and K=46 to assess whether the parameter ICG,H was reliable regardless the value of K. At first, ICG,H was computed and used for ordering all the b4, b46, and b2 combinations, respectively. Then, at every K, the N CH subsets were selected by uniformly downsampling by a factor—summed and rounded to the nearest integer index—of Δ=b4N, b46N, and 1 among all the b4, b46, and b2 combinations of CH, respectively. Finally, each combination of images was used for estimating (ω1,ω2,q), thus obtaining N (ω˜1,ω˜2,q˜)H.

With reference to Figure 13, it is possible to observe that the trend of ϵ¯H, for K=2,4,46, was the same as for K=7 (Figure 12b), provided that the results were sorted in ascending order of ICG,H. It is worth noting that the higher the value of K, the more flattened the error range. In fact, while for K=2 the errors ranged from around 0.3 mm to 3.7 mm, for K=46 they were between 0.344 mm and 0.346 mm (as could be predicted considering that σ¯2σ¯46). Additionally, Figure 13 confirms the effectiveness of ICG,H as a method to find the sets which yielded better calibration results, i.e., lower calibration errors. Moreover, considering as a reference the E¯K obtained by using all the NC images, i.e., E¯50=0.3446 mm (Figure 9), and given a subset H, it is possible to define the percent relative error as

ηH=E¯50ϵ¯HE¯50·100% (21)

Figure 13.

Figure 13

Relationship between ϵ¯H and ICG,H for N calibrations and for various K: (a) K = 4 and N = 99,885; (b) K = 46 and N = 99,885; (c) K = 2 and N = b2 = 1225; (d) same results as in (c), but zoomed-in at the error range [0.3, 0.6] mm.

It is worth noting that, if the H corresponding to the highest ICG,H was considered, ηH was noticeably low for all the tested K, as shown in Table 2. As expected, the higher K, the lower ηH. However, ηH was lower than 10% also for K=2. In particular, for K=2, there were four subsets corresponding to the highest ICG,H: for the worst ηH= 8.72%, whereas for the best ηH= 1.28%. Hence, high-quality calibration results can be achieved even with K=2, provided that the proposed index ICG,H is used to choose the calibration set.

Table 2.

ηH at different H and at various K.

K ICG,H ϵ¯H[mm] ηH[%]
2 0.8958 0.3747 8.72
0.3643 5.73
0.3533 2.52
0.3490 1.28
4 0.7225 0.3469 0.67
7 0.6313 0.3466 0.58
46 0.4226 0.3445 0.02

It is reasonable to use the index as a criterion for selecting the angular positions (θ1, θ2)h within the joint configuration Space S, that is the K placements of the checkerboard. The main advantage is that it is able to predict whether a set is going to achieve an effective calibration before acquiring the images. An additional benefit is that it is less time-consuming for a computer, compared to an entire calibration. For instance, the code was tested using a computer equipped with Intel® i7-6700HQ CPU (Dell Inc., Round Rock, TX, USA, 4 physical cores at 2.60 GHz and 8 logical cores), and 32 GB of RAM, then running Matlab® R2020a (The MathWorks Inc., Natick, MA, USA) with parallel pool active on Microsoft Windows® 10. It was observed that the time required to calculate b7 times the index ICG,H was about 10 times shorter than the time needed for N calibrations. Thus, it is possible to assume that computing the index is 10·Δ=10000 times faster than repeating the calibration for all the b7 possible configurations.

6. Conclusions

This paper presents a novel approach for the automatic calibration of two-axis rotary tables through optical stereo systems. The proposed optimization algorithm allows for simultaneously calibrating both axes by imaging and processing a checkerboard attached to the rotary table in different poses. A test set of images was defined, which were not exploited during calibration, to assess the quality of the achieved calibration parameters by computing an average reprojection error and its RMS. Moreover, this paper investigated the effect of the number of calibration images on the results. It was shown that the higher the number of images, the lower the achieved mean error and RMS, if the calibration poses are randomly selected. Nevertheless, it was demonstrated that a proper choice of calibration poses can provide high-quality calibration results even with a limited number of images (thus, a shorter calibration time). An index based on the weighted complete graph, ICG, was defined, demonstrating that higher values of ICG (i.e., wider dispersion of the calibration poses) correspond to better calibration results. Thus, once the joint configuration Space S is defined, and given the number of calibration images to be used, it is possible to determine the ideal combination of poses by looking for the highest value of ICG. The experimental measurements demonstrated that, using this strategy, the worst calibration error achievable with only two calibration images is marginally higher, about 8%, than the best calibration error achievable with 50 images, thus confirming the advantages of the proposed approach.

Acknowledgments

A sincere thank you to Francesca Catalogne and Mahmoud Elgeziry for the fruitful discussions and suggestions on this paper.

Appendix A

In this appendix, a brief description of the Graphical User Interface—MATTA: autoMatic Acquisition Tool for Turntable cAlibration—downloadable at [30], is given. The main purpose of the software is to provide a tool that guides the user through the entire calibration process. The software has been developed in the Matlab® R2020a environment [31] and is meant to work on computers equipped with Microsoft Windows® 10, macOS®, or Linux®. The Computer Vision Toolbox, The Image Processing Toolbox, the Optimization Toolbox, and the Matlab® Support Package for Arduino Hardware are required. The GUI also makes use of the open source Camera Calibration Toolbox for Matlab® provided by the California Institute of Technology [32]. The additional hardware required is described in Section 2. The GUI consists of six tabs:

  1. Settings;

  2. Turntable Control;

  3. Image Acquisition;

  4. Stereo-Camera Calibration;

  5. Turntable Calibration;

  6. Error Analysis.

The Settings tab, shown in Figure A1a, allows the user to manage several hardware settings. In more detail, it is possible to

  • activate/deactivate the motors connected to the shield via Arduino and to specify its serial port;

  • activate/deactivate the camera(s) connected to the computer, adjusting several parameters such as exposure, image format, image resolution, and frame rate.

Figure A1.

Figure A1

(a) Settings tab; (b) Turntable Control tab.

Moreover, it is possible to test the stereo-camera system configuration performing an image preview or taking a one-shot acquisition.

The second tab, Turntable Control, is reported in Figure A1b. It allows the user to rotate the table within the working space in a target configuration determined by the pair of angular positions (θ1,θ2). The directions of rotation are according to the rotary table model presented in Section 3, Figure 2. After reaching the desired target configuration, it is possible to set the current table pose as the reference pose X¯r for the image acquisition task by means of the Initialize button.

The Image Acquisition tab, shown in Figure A2a, allows the user to automatically capture the stereo-pair images within the joint configuration Space S needed for the calibration of the stereo-camera system or of the rotary table. As inputs, the user has to provide the following:

  1. the square dimensions of the checkerboard;

  2. the desired image format;

  3. the target poses of the turntable, in the form of pairs of angular positions (θ1,θ2)i, i=1,,NA, where NA is the number of acquisitions, with respect to the reference pose (θ1,θ2)1=(0°,0°).

Figure A2.

Figure A2

(a) Image Acquisition tab; (b) Stereo-Camera Calibration tab.

When the process is completed, the tab automatically creates a folder containing both the stereo-pair images and the associated input variables. It is worth mentioning that the first configuration to be acquired has to be the reference pose.

Subsequently, the Stereo-Camera Calibration tab enables the user to properly calibrate the stereo-camera system. With reference to Figure A2b, the user has to specify, as input, the path of a folder of images previously generated with the Image Acquisition tab. The software automatically recognizes the key variables and calibrates the stereo-camera system according to the Camera Calibration Toolbox for Matlab®. Thus, a stereo-camera calibration file is generated in the Camera Calibration folder (inside the Workspace folder) labeled with reference to the folder of images deployed in the task. Eventually, it is possible to obtain insights of a stereo-camera calibration file such as intrinsic and extrinsic parameters and geometrical displacement of both the NA grids and cameras in the 3D space by means of the Show Results button.

Furthermore, the user is able to calibrate the two-axis rotary table by means of the Turntable Calibration tab, shown in Figure A3a. As inputs the user has to provide the following:

  1. a stereo-camera calibration file previously generated in the Stereo-Camera Calibration tab;

  2. a folder of images previously acquired with the aid of the Image Acquisition tab. The GUI fills the Calibration set panel with a number of checkboxes equal to the number of stereo-pair images contained in the specified folder, i.e., NA. By means of the checkboxes, the user is able to select the K stereo-pair images to be used in the calibration procedure, thus constituting the desired subset H; alternatively, the entire set of NA images is used by default.

Figure A3.

Figure A3

(a) Turntable Calibration tab; (b) Error Analysis tab.

The rotary table calibration method is according to the one presented in Section 3. At the end of the process, a table calibration file is generated, and the estimated values of the unit vectors ω1 and ω2, as well as the intersection point q, i.e., (ω˜1,ω˜2,q˜)H, are displayed in the tab.

The last tab offers an in-depth analysis of the errors committed during a turntable calibration. As input, only a folder of NA images—of which K are previously used for calibrating the rotary table—must be provided. At first, the computed T-averaged point-to-point error ϵ¯H, as well as its standard deviation σ¯H, are displayed. Then, as Figure A3b shows, the Error Analysis tab fills the Target grid panel with X¯i, i=1,,NA, Target grids. Finally, once a desired target grid has been selected by the user, a summarizing figure is displayed, as shown in Figure A4.

Figure A4.

Figure A4

A typical analysis figure displayed once a target grid (in this example, i=2) is selected in the Error analysis tab of Figure A3b, showing the following: at the top, the reference grid (X¯1, in red) and the target grid (in blue) before (X¯2) and after (the reprojected grid X1) the overlapping, respectively; at the center, their point-to-point errors (ϵj,i,H,j=1,,54,i=2, and for a certain H); at the bottom, the norm of these errors (|ϵj,i,H|, blue asterisks), the T-averaged point-to-point error (ϵ¯H, red line) and its standard deviation (±σ¯H, green lines). A (ω˜1,ω˜2,q˜)H previously obtained from the Turntable Calibration tab was used.

It is worthwhile to mention that, for each tab, various errors are properly treated by MATTA, as well as warnings, and that numerous informative messages stating the current status of the running process are displayed.

Author Contributions

Software, L.B., R.M. and M.P.; validation, L.B., R.M. and M.P.; writing–original draft preparation, L.B., R.M. and M.P.; writing–review and editing, P.N. and M.G.; supervision, P.N. and M.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

Footnotes

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Gorthi S., Rastogi P. Fringe projection techniques: Whither we are? Opt. Lasers Eng. 2010;48:133–140. doi: 10.1016/j.optlaseng.2009.09.001. [DOI] [Google Scholar]
  • 2.Bernardini F., Rushmeier H. The 3D Model Acquisition Pipeline. Comput. Graph. Forum. 2002;21:149–172. doi: 10.1111/1467-8659.00574. [DOI] [Google Scholar]
  • 3.Barone S., Paoli A., Razionale A.V. Three-dimensional point cloud alignment detecting fiducial markers by structured light stereo imaging. Mach. Vis. Appl. 2012;23:217–229. doi: 10.1007/s00138-011-0340-1. [DOI] [Google Scholar]
  • 4.Barone S., Paoli A., Razionale A. Computer-aided modelling of three-dimensional maxillofacial tissues through multi-modal imaging. Proc. Inst. Mech. Eng. Part H J. Eng. Med. 2013;227:89–104. doi: 10.1177/0954411912463869. [DOI] [PubMed] [Google Scholar]
  • 5.Ye J., Xia G., Liu F., Cheng Q. 3D reconstruction of line-structured light based on binocular vision calibration rotary axis. Appl. Opt. 2020;59:8272–8278. doi: 10.1364/AO.403356. [DOI] [PubMed] [Google Scholar]
  • 6.Ahmadabadian A., Yazdan R., Karami A., Moradi M., Ghorbani F. Clustering and selecting vantage images in a low-cost system for 3D reconstruction of texture-less objects. Measurement. 2017;99:185–191. doi: 10.1016/j.measurement.2016.12.026. [DOI] [Google Scholar]
  • 7.Sun J., Zhang Z., Zhang J. Reconstructing normal section profiles of 3D revolving structures via pose-unconstrained multi-line structured-light vision. IEEE Trans. Instrum. Meas. 2020;70:1. doi: 10.1109/TIM.2020.3024339. [DOI] [Google Scholar]
  • 8.Wang C., Zhou X., Fei Z., Gao X., Jin R. Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series. Volume 10410. SPIE; Bellingham, WA, USA: 2017. [(accessed on 9 December 2020)]. A three dimensional point cloud registration method based on rotation matrix eigenvalue; p. 1041014. Available online: https://spie.org/Publications/Proceedings/Paper/10.1117/12.2276849. [Google Scholar]
  • 9.Dai M., Chen L., Yang F., He X. Calibration of revolution axis for 360 deg surface measurement. Appl. Opt. 2013;52:5440–5448. doi: 10.1364/AO.52.005440. [DOI] [PubMed] [Google Scholar]
  • 10.Gonzalez-Barbosa J.J., Rico-Espino J.G., Gómez-Loenzo R.A., Jiménez-Hernández H., Razo M., Gonzalez-Barbosa R. Accurate 3D Reconstruction using a Turntable-based and Telecentric Vision. Automatika. 2015;56:508–521. doi: 10.1080/00051144.2015.11828664. [DOI] [Google Scholar]
  • 11.Abdel-Aziz Y.I., Karara H.M. Direct linear transformation from comparator coordinates into object space coordinates in close-range photogrammetry. Photogramm. Eng. Remote Sens. 2015;81:103–107. doi: 10.14358/PERS.81.2.103. [DOI] [Google Scholar]
  • 12.Frugers O.D., Toscani G. The calibration problem for stereo; Proceedings of the CVPR ’86; Miami Beach, FL, USA. 22–26 June 1986; Piscataway, NJ, USA: IEEE; 1986. pp. 15–20. [Google Scholar]
  • 13.Brown D. Close-range camera calibration. Photogramm. Eng. Remote. Sens. 1971;37:855–866. [Google Scholar]
  • 14.Haralick R.M., Shapiro L.G. Computer and Robot Vision. 2nd ed. Addison–Wesley; Reading, MA, USA: 1993. [Google Scholar]
  • 15.Nomura Y., Sagara M., Naruse H., Ide A. Simple calibration algorithm for high-distortion lens camera. IEEE Trans. Pattern Anal. Mach. Intell. 1992;14:1095–1099. doi: 10.1109/34.166624. [DOI] [Google Scholar]
  • 16.Weng J., Cohen P., Herniou M. Camera calibration with distortion models and accuracy evaluation. IEEE Trans. Pattern Anal. Mach. Intell. 1992;14:965–980. doi: 10.1109/34.159901. [DOI] [Google Scholar]
  • 17.Barone S., Neri P., Paoli A., Razionale A. Procedia Manifacturing. Volume 38. Elsevier B.V.; Amsterdam, The Netherlands: 2019. Flexible calibration of a stereo vision system by active display; pp. 564–572. [Google Scholar]
  • 18.Barone S., Neri P., Paoli A., Razionale A. 3D acquisition and stereo-camera calibration by active devices: A unique structured light encoding framework. Opt. Lasers Eng. 2020;127:105989. doi: 10.1016/j.optlaseng.2019.105989. [DOI] [Google Scholar]
  • 19.Barone S., Neri P., Paoli A., Razionale A. Structured light stereo catadioptric scanner based on a spherical mirror. Opt. Lasers Eng. 2018;107:1–12. doi: 10.1016/j.optlaseng.2018.03.004. [DOI] [Google Scholar]
  • 20.Agrawal A., Taguchi Y., Ramalingam S. Analytical Forward Projection for Axial Non-central Dioptric and Catadioptric Cameras. In: Daniilidis K., Maragos P., Paragios N., editors. Computer Vision—ECCV 2010. Springer; Berlin/Heidelberg, Germany: 2010. pp. 129–143. [Google Scholar]
  • 21.Baker S., Nayar S. A theory of single-viewpoint catadioptric image formation. Int. J. Comput. Vis. 1999;35:175–196. doi: 10.1023/A:1008128724364. [DOI] [Google Scholar]
  • 22.Barone S., Carulli M., Neri P., Paoli A., Razionale A.V. An omnidirectional vision sensor based on a spherical mirror catadioptric system. Sensors. 2018;18:408. doi: 10.3390/s18020408. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Mülayim A., Yemez Y., Schmitt F., Atalay V. Vision, Modeling and Visualisation ’99. IOS Press; Amsterdam, The Netherlands: 1999. Rotation axis extraction of a turn table viewed by a fixed camera; pp. 35–42. [Google Scholar]
  • 24.Li J., Chen M., Jin X., Chen Y., Dai Z., Ou Z., Tang Q. Calibration of a multiple axes 3-D laser scanning system consisting of robot, portable scanner and turntable. Optik. 2011;122:324–329. doi: 10.1016/j.ijleo.2010.02.014. [DOI] [Google Scholar]
  • 25.Xu Y., Yang Q., Huai J. Calibration of the axis of the turntable in 4-axis laser measuring system and registration of multi-view. Chin. J. Lasers. 2005;32:659–662. [Google Scholar]
  • 26.Bi C., Hao X., Liu M., Fang J. Study on calibration method of rotary axis based on vision measurement. Infrared Laser Eng. 2020;49 doi: 10.3788/IRLA202049.0413004. [DOI] [Google Scholar]
  • 27.Langming Z., Xiaohu Z., Banglei G. A flexible method for multi-view point clouds alignment of small-size object. Measurement. 2014;58:115–129. doi: 10.1016/j.measurement.2014.08.023. [DOI] [Google Scholar]
  • 28.Ye Y., Song Z. An accurate 3D point cloud registration approach for the turntable-based 3D scanning system; Proceedings of the 2015 IEEE International Conference on Information and Automation (ICIA); Kunming, China. 8–10 August 2015; pp. 982–986. [Google Scholar]
  • 29.Chen P., Dai M., Chen K., Zhang Z. Rotation axis calibration of a turntable using constrained global optimization. Optik. 2014;125:4831–4836. doi: 10.1016/j.ijleo.2014.04.047. [DOI] [Google Scholar]
  • 30.Bisogni L., Pettinari M., Mollaiyan R. MATTA: AutoMatic Acquisition Tool for Turntable cAlibration. [(accessed on 10 December 2020)];2020 Available online: https://www.mathworks.com/matlabcentral/fileexchange/84124-matta-automatic-acquisition-tool-for-turntable-calibration?s_tid=srchtitle.
  • 31.MATLAB . 9.8.0.1451342 (R2020a) The MathWorks Inc.; Natick, MA, USA: 2020. [(accessed on 9 December 2020)]. Available online: https://www.mathworks.com/ [Google Scholar]
  • 32.Bouguet J.Y. Camera Calibration Toolbox for MATLAB. [(accessed on 9 December 2020)];2015 Available online: http://www.vision.caltech.edu/bouguetj/calib_doc/

Articles from Sensors (Basel, Switzerland) are provided here courtesy of Multidisciplinary Digital Publishing Institute (MDPI)

RESOURCES