Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Measurement 198 (2022) 111430

Contents lists available at ScienceDirect

Measurement
journal homepage: www.elsevier.com/locate/measurement

An adaptive grid search algorithm for fitting spherical target of


terrestrial LiDAR
Yintao Shi a, *, Gang Zhao b, Maowei Wang b, Yi Xu b
a
School of Geomatics Science and Technology, Nanjing Tech University, Nanjing 211816, China
b
Jiangsu Hydraulic Research Institute, Nanjing 210017, China

A R T I C L E I N F O A B S T R A C T

Keywords: The spherical target is critical in many terrestrial laser scanning applications. Accurately and robustly estimating
Spherical target its geometric center based on a point cloud is a problem of widespread concern. To address this problem, we
Point cloud propose a novel adaptive grid search (AGS) algorithm, which makes full use of the point cloud and geometric
Adaptive grid search
feature of the spherical target, and obtains the optimal fitting parameters through a finite number of iterative
Iterative optimization
Robustness
optimizations. Firstly, we utilize the centroid of the point cloud and the estimated radius of the spherical target as
constraints to establish an initial constraint space. Secondly, we use grid search to determine the initial optimal
solution of the parameters. Finally, we iteratively update the constraint space and the optimal solution utilizing
the previous optimal solution and the parameters scales, and take the solution with the least error metric as the
final optimal solution. We have validated the feasibility and reliability of the algorithm with actual data and
simulated data, respectively, and compared the fitting results with those of the Non-Least Squares algorithm
(NLS) and the M− estimator SAmple Consensus (MSAC) algorithm. The experimental results show that the AGS
algorithm can achieve high-precision fitting of various point clouds of spherical targets and overcome the defects
of the other two algorithms that are easily affected by noise and coverage. Due to iterative optimization, the
running time of the AGS algorithm is slightly longer than the other two algorithms, but it can usually complete
the fitting within 5 s.

1. Introduction spherical target. The spherical target fitting is essential to estimate its
four best-fitting parameters (X, Y, Z, R) based on its point cloud, where
Terrestrial light detection and ranging (LiDAR), sometimes referred (X, Y, Z) denotes the center coordinate and R denotes the radius. Oc­
to as realistic-scenery reproduction, is an advanced high-precision stereo casionally, if the radius of the spherical target is explicitly known, the
scanning technology, and has been widely used in engineering issue transforms into one of a three-parameter estimate of the center
surveying, cultural relics protection, disaster monitoring, reverse three- coordinates. Additionally, the sphere fitting issue is a prevalent chal­
dimensional reconstruction, and many other tasks [1–6]. The raw data it lenge in various research fields, including camera calibration, pattern
captures is referred to as the point cloud, which is a collection of many recognition, object tracking, and robotics[12–17].
discrete measurement points on the surface of the scanning object. As a At present, most of the spherical target fitting methods focus on the
critical auxiliary tool in the application of terrestrial LiDAR, the spher­ strategies of least squares (LS) minimization, such as linear least squares
ical target plays an essential role in the check and calibration of the (LLS) or non-linear least squares (NLLS), and the weighted total least
instrument, the evaluation of measurement accuracy, and the registra­ squares (WTLS) for eliminating the errors of the coefficient matrix
tion of multi-site point clouds [7–11]. In practice, the center coordinate [18–20]. Golub earlier adopted the LLS to carry out the fitting of the
of the spherical target is the crucial information we use, but it is situated standard sphere[21]. Forbes analyzed the application of LLS and NLLS in
within the sphere and cannot be directly obtained by measuring means. sphere fitting, but mainly solved the fitting problem of the noiseless data
What we acquire directly from terrestrial LiDAR is the point cloud on the [22]. Nievergelt adopted LS to minimize the algebraic distance to finish
surface of the spherical target, and its center coordinates can only be the sphere fitting. Although the calculation efficiency was high, the
estimated indirectly through these data, which involves the fitting of the accuracy was unsatisfactory[23]. Späth, Shakarji, Ahn, etc., attempted

* Corresponding author at: Nanjing Tech University, NO.30 Puzhu Road(S), Nanjing, China.
E-mail address: yintaoshi@njtech.edu.cn (Y. Shi).

https://doi.org/10.1016/j.measurement.2022.111430
Received 19 February 2022; Received in revised form 12 May 2022; Accepted 31 May 2022
Available online 4 June 2022
0263-2241/© 2022 Elsevier Ltd. All rights reserved.
Y. Shi et al. Measurement 198 (2022) 111430

to use different improvement strategies to improve the accuracy of the observations to determine these four characteristic quantities, which is a
least square algorithm to fit the sphere[24–26]. Witzgall used two nonlinear inverse problem in itself[38].
strategies of algebraic and geometric fitting to achieve the sphere fitting, Combining the point cloud and geometric features of the spherical
but the core was still the improvement of ordinary least squares (OLS) target, we could effectively determine the value ranges of the unknown
[27]. Fei fitted the sphere using a constrained non-linear least-squares geometric center and radius. In these value ranges, the numbers of so­
fitting (CNLSF) algorithm with a small segment angle strategy[28]. lutions are theoretically infinite. No matter how fine the grid is used to
Theoretically, the LS estimation presumes the mean of noise is zero, divide the value range, the real value accurately can not be approached.
thereby producing an unbiased parameter estimate. Given the noise Therefore, we developed an adaptive grid search algorithm to address
variance, it is possible to estimate the minimal variance parameter by the issue of fitting the geometric center and radius of the spherical
applying suitable weights to the data. Furthermore, LS estimation target. The overall algorithm flow is shown in Fig. 1. Step I is the
implicitly assumes that the whole data set can be described by a preparation of data and algorithms. The meaning of the input parame­
parameter vector of a given model. Numerous researches have shown ters here will be explained in detail in Section 2.1, and the meaning of
unequivocally that the LS estimators often fail to satisfy these assump­ the input error criteria will be described in detail in Section 2.2. Step II is
tions. In some cases, even if the data is mixed with an only slight noise, the process of identifying the initial optimal solutions, which includes
the LS estimation likely is seriously disturbed, resulting in lower accu­ the construction of the initial constraint space (S(1) ), the initial grid
racy or errors in the solution. (G(1) ), the initial sample space (U(1) ), and finally, the solution of the
Apart from the LS approaches, others include the minimal zone initial optimal solution (O(1) ). Step III is an iterative optimization pro­
sphere, the maximum inscribed sphere, and the minimum circumscribed cess that continuously updates the constraint space, spatial grid, and
sphere[29–31]. Clouse utilized conjugate gradient descent (CGD) to sample space to achieve the final optimum solution.
obtain a locally optimal sphere center through iterative processing[32].
Sumith proposed a rapid geometric approach for fitting the center and
2.1. Preset parameters
radius of the sphere that was more robust than OLS[33]. Lesouple
employed an expectation–maximization approach to achieve the sphere
The preset parameters are primarily constituted of the geometric
fitting[34]. These methods mainly realized sphere fitting through line­
radius (Rset ), the sampling number of each characteristic quantity (Nsub ),
arization, but sphere fitting was a non-linear challenge, and precision
the number of iteration optimization (Nopt ), the threshold of the total
loss was unavoidable during the linearization procedure. Meanwhile,
the number of measuring points of the spherical target is frequently in error (Emin ), and the scale factor (λ).
the thousands, and a large coefficient matrix would be generated in
linearization, resulting in low operational efficiency. ● Parameter Rset denotes the estimated radius of the fitted spherical
This study attempts to tackle the issue of spherical target fitting using target. In general, we can easily obtain the nominal value of the
alternative approaches. As was known to all, the spherical target has radius of the spherical target in the instrument handbook. Therefore,
typical geometric features such as spatial rotational symmetry and we set Rset somewhat larger than the actual radius to guarantee that
specific geometric size, implying its point cloud has a specific spatial the initial bounding box encompasses the whole of the spherical
distribution range. Thus, we can construct a rectangular bounding box target. If the radius of the spherical target to be fitted cannot be
containing the complete space range of the spherical target, and the determined, we can set a relatively large guess, and it could be
geometric center and radius of the spherical target must be contained progressively optimized in successive repetitions.
inside this bounding box. We can use the grid search algorithm to solve ● Parameter Nsub represents the sampling number of each character­
the inverse problem whose solution range of the parameter is deter­ istic quantity of (X,Y,Z,R) during the construction of the spatial grid.
mined. The setting of grid spacing in the grid search algorithm is a The bigger Nsub , the smaller the grid spacing and the more finely
challenging problem, which directly determines the accuracy of the divided the grid space. It is essential to remember that the more
solution, but it cannot be clearly defined. Therefore, we develop an precisely the grid area is split, the longer the subsequent search
adaptive grid search (AGS) algorithm for fitting spherical targets, with would take.
the primary objective of fitting a single spherical target. We neglect to ● Parameter Nopt is the maximum number of scheduled iterative opti­
extract the point cloud of a single spherical target from a complicated mizations, which is used to limit the amount of fitting iterations in
scanning scene in this paper since there are already other solutions order to avoid endless loops.
available[35,36]. ● Parameter Emin denotes the total error associated with identifying the
end of the search operation, as determined by the error criterion.
Setting a threshold enables the ensuing search to be terminated
2. Methodology
immediately upon attaining the preset fitting accuracy, increasing
{( )⃒ the efficiency of the algorithm.
Given a point cloud of a spherical target Q = xi , yi , zi ⃒i = 1, 2, ⋯, ● Parameter λ is the adaptive adjustment factor, which will be dis­
} ( )
n acquired using terrestrial LiDAR, define x0 , y0 , z0 as its center co­ cussed in further detail later.
ordinates and r0 as its radius. Theoretically, any measuring point on the
surface of the spherical target should satisfy Eq. (1). The following sections will clarify the exact use of each parameter,
while Section 4.1 will explore their influence on the algorithm in detail.
2 2 2
(xi − x0 ) + (yi − y0 ) + (zi − z0 ) − r02 = 0 (1)

The data is always contaminated with noise during the point cloud 2.2. Error criteria
gathering process, which is impacted by the instrument, the external
environment, and other factors[37]. As a result, some points in Q could The data provided immediately by terrestrial LiDAR is the point
not satisfy Eq. (1), but have a weeny deviation Δ ∕= 0, as shown in Eq. cloud of the spherical target, and the geometric center of the spherical
(2). target is typically unknown and is thus seen as the parameter to be
Δi = (xi − x0 )2 + (yi − y0 )2 + (zi − z0 )2 − r02 (2) solved. Additionally, considering the universality of the algorithm, we
( ) define the radius as an unknown parameter here. To solve the unknown
In this study, the geometric center x0 , y0 , z0 and radius r0 of the geometric center and radius using a search strategy, the judgment
spherical target are all taken as unknown characteristic quantities. The criteria of the ideal solution, namely the error metric, must first be
point cloud with uncertain distribution and noise is used as known defined. The error metric of the existing spherical target fitting algo

2
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 1. Workflow of the adaptive grid search algorithm for fitting spherical target.

rithm may be categorized into geometric error (GE) and arithmetic error solution sets of the parameters for the first time as initial constraint
(AE)[39]. GE is founded on the sum of the squares of the distances be­ space (S(1) ), initial grid (G(1) ), and initial sample space (U(1) ), respec­
tween the given points, and has a relatively straightforward geometric tively. The following describes the specific implementation.
meaning. In contrast, AE lacks a precise geometric definition and is
established mainly on the minimization objective of the function. For (1) Construct the Constraint Space
these two types of error metrics, we have conducted experimental tests
respectively and found that the effect of the GE metric was unsatisfac­ The approximate centroid O(x, y, z) of the spherical target can be
tory. Therefore, we adopt an AE metric (Etotal ) in the proposed algorithm, calculated directly from its point cloud. We use O as the center and Rset
and its definition is shown in Eq. (3). as the constraint, and can determine the space range of S(1) and the value

n ⃒ ⃒ range of the radius by Eq. (4).
Etotal = ⃒(xi − x0 )2 + (yi − x0 )2 + (zi − x0 )2 − r2 ⃒
0 (3) ⎧
i=1 ⎪


⎪ (1)
Xmin (1)
= x − 2Rset ; Xmax = x + 2Rset


( ) ⎪
⎪ (1)
Where xi , yi , zi are the coordinates of each point in the point cloud, n is ⎨ (1)
Ymin = y − 2Rset ; Ymax = y + 2Rset
( ) (4)
the number of points included inside the point cloud, and x0 , y0 , z0 , r0 ⎪ (1) (1)
⎪ Zmin = z − 2Rset ; Zmax = z + 2Rset


are the center and radius of the spherical target. ⎪


⎪ R(1) (1)
min = 0; Rmax = 2Rset
The error metric of Eq. (3) consists of the sum of the squares of the ⎩
errors of all measuring points. Theoretically, the smaller Etotal , the
smaller the deviation of the point cloud from the fitted surface, the Where Xmin , Ymin , Zmin , and Rmin are the respective minimum value of
(1) (1) (1) (1)

higher the precision of the current fitting center coordinates and radius;
four distinctive quantities, while Xmax , Ymax , Zmax , and Rmax are their
(1) (1) (1) (1)
otherwise, the larger the deviation of center coordinate or radius, the
respective maximum values. They directly determine the size and spatial
lower the fitting precision.
position of S(1) . Under normal circumstances, we set Rset to a number
somewhat bigger than the actual radius of the spherical target. As seen
2.3. Initial optimal solution in Fig. 2, the points I ~ N represent the centers of the six faces of S(1) , and
the distances from the centroid O to I ~ N are all 2Rset . In this scenario,
The possible value ranges of the solutions of the parameters must be S(1) comprises the whole point cloud and spatial range of the spherical
firstly determined for using grid search so that it could be used to define target. Because the geometric radius of a spherical target is always
the boundary of the grid. Given the point cloud of a spherical target, the bigger than zero, Rmin is set to zero.
(1)
centroid may be estimated, and an axis-aligned bounding box (AABB)
can be created using the centroid as the center and more than twice the
(2) Calculate the Current Scale
radius as constraints. This AABB contains the point cloud and the whole
spatial range of the spherical target, as defined by the geometric prop­
After determining the value ranges for the four feature qualities (X,Y,
erties of the sphere. Based on this AABB, we can establish a grid space ( )
Z,R), their current scales LX , LY , LZ , LR can be calculated using Eq.
(1) (1) (1) (1)
and regard all grid nodes as the potential solution set for the fitting
parameters[40]. The optimal solution may be identified using the error (5). The scale here refers to the spatial distance of each characteristic
metric defined in Eq. (3). We refer to the AABB, grid, and potential

3
Y. Shi et al. Measurement 198 (2022) 111430

Due to the limitation of Nsub , there is a specific spacing between the


samples in U(1) . The optimal solution determined at this step is often not
the optimal fitting parameter for the spherical target. Theoretically, with
sufficient refinement of the four specific parameters (X,Y,Z,R), the
optimal solution for fitting a spherical target may be approximated
endlessly. However, this strategy is not feasible in practice because as
Nsub increases, the number of samples in U(1) increases exponentially,
resulting in a surge in computations and a significant rise in invalid
sample redundancy. Therefore, with limited samples, we can only
roughly determine the fitting parameters of the spherical target after this
step.

2.4. Optimal solution Update

The resolution of the sample space directly restricts the accuracy of


Fig. 2. Construction of the initial constraint space. the optimal solution obtained by grid search[41]. With a given amount
of samples, further refinement of the sample space is required to
improve the precision of the grid search. Assuming that the optimal
quantity in its dimension. As shown in Fig. 2, IK = LX , JL = LY , and
(1) (1)
sample point obtained in the previous sample space U(i) is
MN = LZ .
The geometric significance of LR is not described here, but ( (i) (i) (i) (i) )
(1) (1)
X , Y , Z , R , its fitting accuracy falls short of the predefined
the principle is the same.
threshold Emin . To obtain more precise fitting parameters, we need to


⎪ (1)

⃒ (1)

(1) ⃒
refine further U(i) by using specific updating rules to obtain finer sample

⎪ LX = ⃒Xmax − Xmin ⃒


⎪ ⃒ ⃒ space U(i+1) . The following describes the specific implementation

⎪ (1) ⃒ (1)

⎨ LY = ⃒Ymax − Ymin(1) ⃒
⃒ procedure.
⃒ ⃒ (5)
⎪ ⃒ (1) ⃒
(1) Update the Scales of Characteristic Quantities
(1)


(1)
LZ = ⃒Zmax − Zmin ⃒



⎪ ⃒ ⃒

⎪ (1) ⃒ (1) (1) ⃒

⎩ LR = ⃒Rmax − Rmin ⃒ In the proposed algorithm, the scale of the feature quantity is a
critical constraint for constructing the constraint space. Here, we update
the scales of the four characteristic quantities (X,Y,Z,R) using Eq. (8).
(3) Establish the Sample Space ⎧

⎪ (i+1) (i)

⎪ LX = λLX
With S(1) as a constraint, we can establish the initial grid G(1) by ⎪

⎨ L(i+1) = λL(i)
sampling the four characteristic quantities (X,Y,Z,R) with Nsub equal
Y Y
(8)
⎪ (i+1)
LZ = λLZ
(i)
intervals. A sample space consisting of four characteristic quantities, ⎪



{( (1) (1) (1) (1) )⃒ } ⎪
⎩ L(i+1) = λL(i)
U(1) = Xm , Ym , Zm , Rm ⃒m = 1, 2, ⋯, N4sub , is established by R R

considering the grid nodes of G(1) as the potential solution set for the ( ) ( )
spherical target fitting parameters and the sampling values of R as the Where LX , LY , LZ , L R
(i) (i) (i) (i)
and LX , LY , LZ , LR
(i+1) (i+1) (i+1) (i+1)
respectively
one for radius. Taking the grid nodes of G(1) as the possible solution set represent the previous and updated scales of the four characteristic
of the center and the sampling values of R as the one of radius, we can quantities. λ ∈ (0, 1) is a scaling factor that is used to control the speed at
establish a sample space composed of four characteristic quantities, which each feature quantity is scaled. The smaller the value is, the faster
{( (1) (1) (1) (1) )⃒ }
U(1) = Xm , Ym , Zm , Rm ⃒m = 1, 2, ⋯, N4 . The value of each
sub the shrinkage speed is.
sample point is calculated by Eq. (6).
⎧ (2) Update the Constraint Space

⎪ { }

⎪ (1)
X (1) ∈ Xmin + (j − 1)*LX(1) /(Nsub − 1)|j = 1, 2, ⋯, Nsub ( )

⎪ ( )
With X(i) , Y (i) , Z(i) as the center and LX , LY , LZ , LR as
⎪ (i+1) (i+1) (i+1) (i+1)

⎪ { }

⎪ (1)
⎨ Y (1) ∈ Ymin + (j − 1)*L(1)
Y /(Nsub − 1)|j = 1, 2, ⋯, Nsub constraints, we can rebuild a new constraint space S(i+1) . The eight
{ } (6)

⎪ (1) (1) (1)
⎪ Z ∈ Zmin + (j − 1)*LZ /(Nsub − 1)|j = 1, 2, ⋯, Nsub positioning coordinates of S(i+1) can be calculated using Eq. (9). As seen





{ } in Fig. 3, O’ symbolizes the optimal sample point in U(i) , which is treated
⎪ R(1) ∈ R(1) (1)

⎪ min + (j − 1)*LR /(Nsub − 1)|j = 1, 2, ⋯, Nsub as the center of S(i+1) . The eight corners of S(i+1) are labeled by the points

A′ ~H′ , and the centers of every face of S(i+1) are marked by the points
I′ ~N′ . Under these circumstances, I’ K’ = LX , J ’ L’ = LY , and M’ N’ =
(i+1) (i+1)

(4) Seek for the Current Optimal Solution


LZ . As the constraint space is further reduced and gradually ap­
(i+1)

proaches the real solution, the probability that we use the grid search
According to the error metric defined in Section 2.2, we calculate the
strategy to obtain the optimal solution of the parameters of the spherical
total error Etotal of each local point in U(1) one by one and compare it
target will become larger and larger.
with the preset parameter Emin . If the total error of the current sample is
smaller than Emin , it indicates that the current sample has attained the
predefined fitting accuracy and may be considered the optimal solution
of the parameter. Instead, the search was repeated till all the samples in
U(1) are detected. After scanning every sample in U(1) , if no sample
fulfills Etotal less than Emin , the sample point with the minor total error is
adopted as the current optimal solution.

4
Y. Shi et al. Measurement 198 (2022) 111430

process, the algorithm may be terminated in advance.

2.5. Accuracy evaluation

Given that the real centers and radius of the spherical target are
( )
(Xreal , Yreal , Zreal , Rreal ), and the fitted ones are Xfit , Yfit , Zfit , Rfit , the de­
viation between the two can be calculated by Eq. (11).
⎧ ⃒ ⃒
⎪ dX = ⃒Xfit − Xreal ⃒

⎨ ⃒ ⃒
dY = Yfit − Yreal ⃒

⃒ ⃒ (11)

⎪ dZ = ⃒Zfit − Zreal ⃒
⎩ ⃒ ⃒
dR = ⃒Rfit − Rreal ⃒

The point position deviation (dC) of the fitted center can be evalu­
Fig. 3. The rebuilt constraint space.
ated by the distance between two points, and calculated by using Eq.
⎧ (12). Theoretically, the smaller the value of dC, the less the deviation of


⎪ (i+1) (i+1) (i+1) the fitted center and the more accurate the solution of the fitting
⎪ Xmin = X (i) − LX (i+1)
/2; Xmax = X (i) + LX /2



⎪ (i+1) parameters.
⎨ Ymin = Y (i) −
(i+1)
LX /2; Ymax (i+1)
= (i) (i+1)
Y + LY /2 √̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
(9) dC = dX 2 + dY 2 + dY 2 (12)
⎪ Z (i+1) = Z (i) −
⎪ (i+1)
LX /2; Zmax (i+1)
= (i) (i+1)
Z + LZ /2

⎪ min

⎪ (i+1)
⎪ (i)
L(i+1) /2; R(i+1) R(i) + L(i+1) The center of the spherical target is contained inside the sphere and
⎩ Rmin = R −
⎪ X max = R /2
therefore cannot be directly measured. As a result, it was impossible to
precisely assess the fitting precision of the center in practical operations.
For the geometric centers of the real spherical targets in this study, we
(3) Update the Sample Space
utilize the commonly used commercial software of processing point
cloud to obtain their centers and take them as the true values.
Under the constraint of S(i+1) , we can establish a new grid space S(i+1)
by evenly sampling the four characteristic quantities (X,Y,Z,R). By
3. Experiment and results
considering the grid nodes of G(i+1) as the potential solution set for the s
center and the sample values of R as the one for the radius, a new sample
{( (i+1) (i+1) (i+1) (i+1) )⃒ } In order to test the feasibility and applicability of the algorithm, we
space U(i+1) = Xm , Ym , Zm , Rm ⃒m = 1, 2, ⋯, N4 is gener­
sub use two sets of real point clouds and one set of simulated point clouds for
ated. Each sample point in U(i+1) can be determined by Eq. (10). experimental tests. The actual point clouds are collected by terrestrial
⎧ 3D laser scanning, and the point clouds of five spherical targets are

⎪ { } manually extracted from them. The first set of test data selects the point
⎪ X (i+1) ∈ X (i+1) + (j − 1)*L(i+1) /(N − 1)|j = 1, 2, ⋯, N


⎪ clouds of five spherical targets that have been deeply denoised, and the
min X sub sub

⎪ { }


⎪ (i+1)
⎨ Y (i+1) ∈ Ymin + (j − 1)*LY(i+1) /(Nsub − 1)|j = 1, 2, ⋯, Nsub second one selects the original point clouds of five spherical targets
{ } (10) without denoising. The fitting accuracy of the center of the spherical
⎪ (i+1)
+ (j − 1)*L(i+1) target is a key concern in practical applications. To effectively estimate
⎪ (i+1)
⎪Z
⎪ ∈ Zmin Z /(Nsub − 1)|j = 1, 2, ⋯, Nsub

⎪ { }


⎪ (i+1) (i+1) the fitting accuracy of the algorithm, a practical reference is essential.
⎪ R(i+1) ∈ Rmin + (j − 1)*LR /(Nsub − 1)|j = 1, 2, ⋯, Nsub

⎩ However, the center of the spherical target is located inside the sphere
and cannot be obtained directly through measurement. Although it can
be obtained indirectly through measurement equipment such as a total
(4) Determine the Final Optimal Solution station, it will inevitably introduce new measurement errors. Therefore,
we choose the solution result of FARO’s commercial software SCENE as
Based on the error criteria defined in Section 2.2, we calculate the the reference value, which is also a more common practice at present.
total error Etotal associated with each sample point in U(i+1) one by one, In addition, to better evaluate the fitting effect of the algorithm, we
and compare it with the preset parameter Emin . If the Etotal of a sample simulated a set of point clouds of spherical targets with well-known
point is smaller than Emin , we consider it to have fulfilled the preset centers and radii as the third set of test data. To compare the pros and
fitting accuracy and hence to be the final optimal fitting parameters of cons of the algorithm we designed with other algorithms, we use both
the spherical target. Otherwise, the search was repeated till all the the Non-Least Squares algorithm (NLS) and the M− estimator SAmple
samples in the sample space U(i+1) are detected. After scanning all Consensus (MSAC) algorithm to solve the center and radius. MSAC al­
samples in U(i+1) , if no sample meet Etotal < Emin , the sample with the gorithm is an improved RANSAC algorithm widely used in feature
least Etotal is adopted as the current optimal solution. extraction and fitting. All test algorithms are written in Matlab, and the
Based on the optimization approach described in this section, we test platform is an Intel i5-6500 CPU, 16G memory, and Intel Graphics
continuously adapt the sample space and gradually refine the fitting 530 graphics card.
parameters of the spherical target we iteratively optimize. In most cases,
the near-optimal solution may be obtained in less than twenty iterative 3.1. Data acquisition
optimizations. During iterative optimization, execution may terminate if
Etotal is less than Emin or if the preset Nopt iterations have been finished. The terrestrial 3D laser scanner comprises a high-speed and accurate
Due to the influence of noise, Etotal may still fall short of Emin after a laser rangefinder and mirrors that could guide the laser and scan at a
limited number of iterations of Nopt , but after multiple rounds of opti­ uniform angular velocity[42]. The laser rangefinder actively emitted the
mization, Etotal may cease to decline, indicating that the fitting accuracy laser and synchronously received the signal reflected from the surface of
will no longer increase. Thus, we should add an end judgment condition, the natural object. The distance (S) from the instrument to the scanning
so that if Etotal does not decline or converge throughout the iteration point could be calculated by the time of the pulse laser propagation or

5
Y. Shi et al. Measurement 198 (2022) 111430

the phase difference. The precision clock control encoder synchronously center coordinates of each spherical target fitted by SCENE, R is the
measured the horizontal angle (ρ) and zenith angle (θ) of two continu­ preset radius, Position Deviation (PD) refers to the deviation of the fit
ously rotating mirrors used to reflect the pulsed laser during the firing of center, and Coverage refers to the percentage of the surface area of the
each laser pulse. According to the geometric spatial relations of S, ρ, and spherical target occupied by the point cloud, which is obtained by the
θ, we can easily obtain the coordinate values of each measuring point subsequent calculation.
relative to the survey station. The principle of obtaining coordinates of Due to the influence of instrument performance, parameter config­
any measuring point on the surface of the spherical target can be seen in uration, the external environment, and other factors during data
Fig. 4. acquisition, the point cloud obtained by terrestrial LiDAR cannot avoid
According to the working principles of the laser scanner, its laser mixed noise. The SCENE software adopts a strategy of first denoising and
beam emits isometrically, causing the point cloud to be divergent in then fitting for spherical target fitting. According to the fitting results of
space; that is, as range increases, the distance between points on the SCENE, the deviation of SCENE fitting center is about 1 mm. Due to the
spherical target progressively increases, while the spatial density grad­ limitation of equiangular emission characteristics of scanner, the num­
ually decreases[43]. Additionally, according to the calculation formula ber of measuring points and the coverage of the spherical target decrease
of measuring points and the error propagation law, the noise of gradually with the increase of distance. Theoretically, terrestrial LiDAR
measuring points is mainly caused by errors in measuring angle and can obtain the point cloud of spherical target with a coverage of 50%,
ranging. With the increase of ranging, the noise intensity will gradually but due to the influence of the instrument and the edge scattering effect
increase[44]. When selecting experimental data, we should consider the of the spherical target, the coverage of the point cloud obtained by
influence of these elements and choose multiple types of sample data as actual scanning is basically less than 40%. In our experiments, all the
far as possible. distances from each spherical target to the scanner are within 15 m, and
To validate our algorithm, we use Faro laser scanner to acquire the all the coverages are more than 20%. In this case, SCENE can basically
point clouds of five actual spherical targets. The experimental location is be solved accurately. We have found in practical work that SCENE often
selected in the Shijun Garden of Nanjing Tech University, which is built- fails to fit the spherical target when the number of measuring points is
in memory of the famous chemical engineer, Academician Shijun. In the small, or the coverage is less than 15%.
experimental field, we uniformly distribute five standard spherical tar­
gets with an actual geometric radius of 0.0725 m and mark them Target 3.2. Noiseless data
1 ~ 5 based on their distance from the scanner. The overall scanning
scene and spherical target arrangement are shown in Fig. 5a. The in­ The noiseless point cloud here is not a genuine noise-free point cloud,
strument selected for the experiment is the Faro Laser Scanner FocusS but one whose error is basically negligible after the denoising algorithm
350, and the point spacing of 3.15 mm@10 m is used for scanning. The is utilized. This type of data is primarily obtained through the use of
plane projection of the acquired point cloud is shown in Fig. 5b, and it manual denoising combined with algorithms. With the aid of the visual
clearly shows the spatial distribution of the experimental spherical tar­ interaction provided by point cloud processing software, we can directly
gets. According to the technical manual of the instrument selected, its identify and delete those sparse and scattered points that are located far
nominal ranging error is 1 mm, its ranging noise is 0.3 mm when the from the main body. For the noise confused with the valid points, we
reflectivity is 90%, and its 3D point accuracy is 2 mm@10 m. have to use the denoising algorithm to detect and eliminate them. In this
To effectively compare the fitting results of our algorithm to those of experiment, we use the mean shift algorithm to denoise the experi­
other software or algorithms, the actual center and radius of the mental data[45]. The point clouds of five spherical targets after
spherical target must theoretically be known. The radius of the spherical denoising can be seen in Fig. 6, and the measuring points of target A1 ~
targets used for the experiment are specified explicitly in the technical A5 are 14953, 2937, 2328, 1632, and 571, respectively. After acquiring
manual, and they are all 0.0725 m. Because the geometric center of the the experimental data, we utilize the AGS algorithm to finish their
spherical target is contained within the sphere and could not be fitting, where the preset parameters Rset , Nsub , Nopt , Emin , and λ required
measured directly, its actual value could not be determined. This study by the algorithm is 0.08 m, 10, 30, 0.001, and 0.5, respectively. The
takes the centers of five spherical targets extracted by FARO’s com­ fitting process of each spherical targets is illustrated in Fig. 6.
mercial software SCENE as the reference values (truth values). In the Additionally, to compare with the current commonly used algo­
SCENE software, calculating the center of the spherical target requires rithms, we use the NLS algorithm and the MSAC algorithm to fit five
that its radius must be specified in advance; in this case, we set it to the spherical targets, respectively. After completing the fitting of all spher­
value of the actual radius (0.0725 m). The fitting results are presented in ical targets, we take the fitting results of SCENE as the true values, and
Table 1, where Distance refers to the distance between the spherical analyze the fitting result of each spherical target, including triaxial de­
target and the scanner, Points represents the number of measuring points viation (dX, dY, dZ), radius deviation (dR), center deviation (dC), total
contained in the point cloud of every spherical target, (X,Y,Z) is the error at the end, the number of iterations, and the run time. The results

Fig. 4. The measurement principle of the point cloud.

6
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 5. Acquisition of the real point cloud. (a) Real experiment scene and the arrangement of the spherical target. (b) The plane projection of the scanning
point cloud.

Table 1
Parameters of five spherical targets obtained from SCENE.
Target Distance/m Points X/m Y/m Z/m R/m PD/mm Coverage

1 3.189 11,342 2.102202 2.397408 55.007172 0.0725 0.471406 37.5%


2 6.599 2848 − 4.145983 5.134010 55.085632 0.0725 0.406655 27.5%
3 7.463 2249 − 0.601329 7.438200 55.586513 0.0725 0.236330 25.4%
4 9.875 1284 2.647992 9.513670 55.729305 0.0725 0.298728 33.6%
5 14.133 223 − 3.310180 13.739808 56.747138 0.0725 0.647315 22.8%

Fig. 6. The morphology of the noiseless point clouds and the fitting process of the AGS algorithm.

are summarized in Table 2. In this case, the three-axis and radius de­ error threshold (Emin = 0.001). At the completion of the fitting, the
viations can be calculated using Eq. (11); dC can be calculated using Eq. number of iterations and total error did not reach the specified Nopt and
(12); the total error is the total error of the optimal solution obtained at Etotal , indicating that, despite significant denoising processing, the point
the end of the iteration, which can be calculated using Eq. (3); Iterations cloud still contains noise, which is also determined by the performance
is the number of iterative optimizations performed at the end of the of the instrument.
algorithm. The results of the noiseless experiment show that for the noiseless
The statistical results for total error and iterations indicate that the point cloud, the fitting accuracy of AGS and NLS is basically the same as
AGS completed the fitting process within 20 iterations, and the final that of SCENE, and their center deviation and radius deviation are both
total error for each data did not reach the predefined threshold (Emin ), less than 1 mm, while the deviation of MSAC is larger, as shown in Fig. 7.
indicating that the fitting process should be terminated when Etotal no From the perspective of execution efficiency, the running time of the
longer converges. Theoretically, assuming the point cloud is noise-free, AGS algorithm is longer than that of the other two algorithms, which is
Etotal should steadily approach zero and eventually hit a predefined total mainly caused by the iterative design of the algorithm.

7
Y. Shi et al. Measurement 198 (2022) 111430

Table 2
Statistics of the fitting results of the noiseless point clouds.
Algorithm Target dX/mm dY/mm dZ/mm dR/mm dC/mm Total Error Iterations Time/s

AGS A1 0.3770 0.3550 0.2878 0.4881 0.5924 0.4842 20 5.0960


A2 0.0603 0.1091 0.0387 0.1236 0.1306 0.0838 19 1.1368
A3 0.0105 0.6537 0.0940 0.5436 0.6605 0.0522 19 0.9280
A4 0.0516 0.1098 0.0188 0.1155 0.1228 0.0540 19 0.5756
A5 0.2279 0.1714 0.0912 0.3955 0.2993 0.0170 18 0.2991
NLS A1 0.4027 0.3882 0.2923 0.5164 0.6311 0.4845 1 0.0025
A2 0.0895 0.1526 0.0521 0.1449 0.1844 0.0841 1 0.0062
A3 0.0054 0.6902 0.0902 0.5701 0.6961 0.0522 1 0.0043
A4 0.0430 0.0541 0.0386 0.0469 0.0791 0.0545 1 0.0011
A5 0.2280 0.4448 0.0388 0.2102 0.5013 0.0174 1 0.0013
MSAC A1 1.7270 2.3278 0.0905 1.7984 2.8999 1.4048 1 0.0022
A2 4.4731 2.9549 0.0848 3.7561 5.3616 0.3947 1 0.0015
A3 0.6501 1.8979 0.2505 1.3982 2.0217 0.1583 1 0.0016
A4 1.3009 0.4845 1.3924 0.6725 1.9662 0.1772 1 0.0014
A5 0.4283 1.8945 1.2804 1.8443 2.3264 0.0611 1 0.0012

Fig. 7. Comparison of the fitting results of the three algorithms for the noiseless point clouds. (a) Comparison of center deviation; (b) Comparison of radius deviation.

Experiments on noiseless point cloud demonstrate that the proposed time is slightly increased. Due to the limitation of random sampling
AGS algorithm is suitable for the fitting of noiseless point cloud of the characteristics of MSAC algorithm, its fitting results are obviously un­
spherical target, and its fitting accuracy is basically comparable to that stable. In our experiments, although we take the best value in the 20
of NLS algorithm and the commercial software SCENE, but the running fittings of the MSAC algorithm as the statistical result, there is still a

Fig. 8. The morphology of the noisy point cloud and the fitting process of the AGS algorithm.

8
Y. Shi et al. Measurement 198 (2022) 111430

large deviation. B3, B4, and B5 are low, and the deviations of the NLS fitting results are
all less than 3 mm, as shown in Fig. 9. Due to M− Estimator constraints,
the MSAC algorithm demonstrates a certain anti-noise performance, and
3.3. Noisy data
its fitting deviation is less than 5 mm. In this experiment, the instability
of the MSAC algorithm is still obvious, the results of each fitting are
In the terrestrial 3D laser scanning operation, no matter whether we
different, and the maximum difference between the results is more than
use any denoising algorithm to denoise the acquired point cloud, the
50 mm. We select the optimal value of the 20 fitting results as the sta­
measurement error in the data cannot be removed entirely, which is
tistics. The execution time of the AGS algorithm is still slightly more
determined by the instrument itself and the external operating envi­
than that of the NLS algorithm and the MSAC algorithm.
ronment. To test the applicability of the algorithm to the noisy point
These experimental results show that the proposed AGS algorithm
cloud, we use the original and un-denoised point clouds of five target
has better robustness than the currently commonly used NLS algorithm
balls as test objects with different intensities of noise. These five target
and MSAC algorithm, especially when the noise intensity increases
balls are the same as those of Experiment 1, but they are not denoised.
dramatically, the fitting accuracy becomes significantly better than the
We number them as B1 ~ B5, as shown in Fig. 8. The measuring points of
latter two. Under strong noise interference, the fitting results of the NLS
target B1 ~ B5 are 15937, 3945, 2986, 1777, and 753, respectively. The
algorithm become highly unreliable, while the AGS algorithm can still
noise included in the test data mostly consists of drift points (DP), iso­
achieve a fitting accuracy within 1 mm.
lated points (IP), redundant points (RP), and mixed points (MP), which
are primarily caused by the influence of the instrument itself and the
surrounding environment [52]. Drift points (DP) are those sparse and 3.4. Simulated data
scattered points that are clearly far away from the main body of the
point cloud and float above it; isolated points (IP) are those small and In the actual point cloud experiment, since it is difficult to directly
dense point clouds that are far away from the center of the point cloud; obtain the center of the spherical target by means of measurement, we
redundant points (RP) are those extra scan points that exceed the choose the solution results of SCENE as the reference values and conduct
intended scan area; mixed points (MP) are those noise points that are a lateral comparison test and analysis. To better quantitatively evaluate
confused with the valid point cloud. The point clouds of target B1 ~ B5 the fitting accuracy of the algorithm, we simulated a set of point clouds
mainly contain noise types of [DP, IP, RP], [DP, IP, RP], [MP], [DP, MP] whose center coordinates and radii were explicitly known as test objects.
and [DP, MP] respectively. We fit point clouds of five spherical targets The center and radius (X, Y, Z, R) of the spherical target are set to (1000,
using the AGS algorithm with the same preset settings as in the noiseless 1000, 100, 0.0725), the sampling interval of the angle is set to 3◦ , and
fitting experiments, as seen in Fig. 8. Simultaneously, we apply the NLS the coverage from C1 to C5 is set to 50%, 40%, 30%, 20%, and 10%,
algorithm and the MSAC algorithm to fit the five spherical targets, respectively. In addition, to simulate the noise effect, we randomly
respectively. sample 80% of the points from the generated points and add 5 mm noise
After finishing all fittings, we take the center retrieved by SCENE as that satisfies the Gaussian distribution to them. The morphology of the
the true value and make statistics on the triaxial deviation (dX, dY, dZ), generated point cloud is shown in Fig. 10. The number of measuring
radius deviation (dR), center deviation (dC), total error at the end, the points of target C1 ~ C5 is 3751, 3267, 2783, 2178, and 1573 respec­
number of iterations, and the run time (see Table 3). The statistics here tively. During the fitting process of the AGS algorithm, the required
have the same meaning as those in Table 2. input parameters are kept the same as those used in the actual experi­
The experimental results demonstrate that AGS can generally com­ ments. The specific fitting process is shown in Fig. 10. At the same time,
plete the fitting within 20 times for the noisy point cloud. Neither the we also used the NLS algorithm and the MSAC algorithm to fit this set of
total error nor the iterations reach the preset thresholds Emin and Nopt , data.
implying that the fitting process should terminate when the total error After all fitting work is done, we still make statistics on the triaxial
no longer converges. The various deviations of the AGS fitting results are deviation, radius deviation, center deviation, final total error, number of
all less than 1 mm, and its accuracy is basically equivalent to that of iterations, and running time (see Table 4). In this experiment, the AGS
SCENE. The fitting results remain highly stable, especially when targets algorithm still ends when the total error is no longer reduced because
B1 and B2 contain apparent DP and RP noise. It is proven that the AGS both the total error and the number of iterations have not reached the
algorithm has good noise immunity. The NLS algorithm is very suscep­ predetermined threshold.
tible to noise, and as the intensity of the noise grows, its fitting results The experimental results show that when the coverage of the point
exhibit significant deviations. For example, the noise intensities of tar­ cloud is more than 30%, the AGS algorithm can accurately calculate the
gets B1 and B2 are high, and the deviations of the NLS fitting radius and true center; when the coverage is 20%, the fitting error of the AGS al­
center are all more than 10 mm. However, the noise intensities of targets gorithm is less than 0.5 mm; and when the coverage is 10%, the fitting

Table 3
Statistics of the fitting results of the noisy point clouds.
Algorithm Target dX/mm dY/mm dZ/mm dR/mm dC/mm Total Error Iterations Time/s

AGS B1 0.3856 0.3631 0.2865 0.4883 0.6022 1.4695 20 5.1603


B2 0.4547 0.6436 0.1847 0.6328 0.8094 1.1557 19 1.5503
B3 0.0261 0.7008 0.0525 0.5760 0.7033 0.1090 20 1.3290
B4 0.0861 0.2164 0.0753 0.2064 0.2448 0.0983 19 0.6558
B5 0.3815 0.0770 0.0407 0.1438 0.3913 0.0531 19 0.3565
NLS B1 7.2646 7.9475 4.4788 8.6082 11.6618 5.5464 1 0.0021
B2 15.0682 20.9104 2.6550 19.7885 25.9103 3.2021 1 0.0012
B3 0.0235 0.9195 0.0803 0.7314 0.9233 0.1139 1 0.0013
B4 0.7426 1.9749 0.3045 1.5484 2.1317 0.1429 1 0.0013
B5 1.0390 2.4980 0.5243 2.2268 2.7558 0.0711 1 0.0012
MSAC B1 3.2288 0.7151 3.4565 2.5937 4.7837 4.4671 1 0.0025
B2 0.1728 1.5338 0.0452 1.3278 1.5442 1.4676 1 0.0039
B3 0.0892 0.3320 1.1090 0.2169 1.1611 0.2487 1 0.0036
B4 1.0519 4.3010 1.4833 3.7259 4.6696 0.2761 1 0.0015
B5 2.3589 2.2580 1.1171 3.3066 3.4512 0.1553 1 0.0017

9
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 9. Comparison of the fitting results of the three algorithms for the noisy point clouds. (a) Comparison of center deviation; (b) Comparison of radius deviation.

Fig. 10. The morphology of the simulated point clouds and the fitting process of the AGS algorithm.

Table 4
Statistics of the fitting results of the simulated point clouds.
Algorithm Target dX/mm dY/mm dZ/mm dR/mm dC/mm Total Error Iterations Time/s

AGS C1 0.0000 0.0000 0.0000 0.0000 0.0000 1.6201 26 3.8533


C2 0.0000 0.0000 0.0000 0.0000 0.0000 1.4253 26 3.1889
C3 0.0000 0.0000 0.0000 0.0000 0.0000 1.2136 25 2.3150
C4 0.1250 0.0492 0.5997 0.9295 0.6146 0.9449 19 1.0411
C5 0.0788 0.4466 1.3050 1.8211 1.3816 0.5777 18 0.5238
NLS C1 0.7460 0.4577 1.7011 0.7355 1.9130 1.6933 1 0.0012
C2 0.1187 0.3617 2.7478 1.5903 2.7740 1.4876 1 0.0016
C3 0.0796 0.5072 4.8987 3.4307 4.9255 1.2694 1 0.0016
C4 0.6469 0.3074 13.1211 10.6945 13.1406 0.9832 1 0.0023
C5 0.6592 0.9412 33.4004 28.8925 33.4202 0.5962 1 0.0016
MSAC C1 3.3228 5.6422 2.8348 4.7355 7.1352 2.6048 1 0.0018
C2 6.7640 0.6886 7.3046 2.7477 9.9791 2.6296 1 0.0016
C3 1.8859 0.3233 1.3827 1.4932 2.3607 1.2916 1 0.0017
C4 0.0500 10.3811 5.7674 0.4819 11.8757 2.3647 1 0.0015
C5 2.6791 8.1699 7.3509 6.7616 11.3120 0.7578 1 0.0495

accuracy of the AGS algorithm is about ± 1 mm. The NLS algorithm among the 20 fitting results as the final statistical value, its fitting ac­
shows obvious reliability in this experiment, and the center deviation curacy is still not ideal. Due to iterative optimization, the running time
and radius deviation of the fitting results both increase significantly with of the AGS algorithm is still slightly more than that of the NLS algorithm
the decrease of coverage, as shown in Fig. 11. The instability of the and the MSAC algorithm.
MSAC algorithm is still pronounced. Although we choose the best value The results of this experiment prove that the proposed AGS algorithm

10
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 11. Comparison of the fitting results of the three algorithms for the simulated point clouds.

overcomes the problems that the NLS algorithm is easily affected by the
coverage and the MSAC algorithm is unstable, and has good feasibility
and reliability in the spherical target fitting. Especially in the ill-
conditioned situation when the coverage is less than 10%, the point
cloud almost presents plane-like features, and most algorithms almost
fail or have poor solution accuracy, while the AGS algorithm can still
achieve a fitting accuracy of about ± 1 mm.

4. Discussion

4.1. Parameters

The AGS algorithm proposed in this paper involves the setting of


multiple related parameters, and different parameter settings will have
different impacts on the algorithm.

(1) Rset directly affects the size of the initial constraint space. The
spherical target utilized in scanning works has a specific geo­
metric radius. As a result, Rset may be easily and precisely set. If
the radius of the spherical target cannot be specified precisely, an
Fig. 12. Relation between Nsub and the sample points.
experienced guess can be made. Its range could be basically
determined after several iterative optimizations. Under normal
circumstances, Rset should be set within 3 times the real radius large, the running time will increase significantly, otherwise, the
value as much as possible, so that the approximate value of the final solution will be less accurate.
fitting radius can be basically obtained after less than 5 iterations. (3) Nopt is the preset maximum number of iterations to prevent
If Rset is set too large, it was easy to cause that the desired fitting infinite iterations of the algorithm. When the point cloud contains
precision could not be achieved after a preset number of iterative noise, Etotal may never reach the specified Emin value, and the
optimizations. iteration will continue indefinitely. If the number of iterations in
(2) Nsub directly determines the grid spacing and the number of the fitting process is not restricted, the algorithm will fall into an
sample points. The number of sample points rises exponentially infinite loop. Therefore, to prevent this from happening, Nopt
as Nsub increases, which indicates that we must choose a must be preset. Additionally, owing to the influence of noise, Etotal
reasonable value for Nsub , as seen in Fig. 12. In our experiments, may not decrease after reaching a certain level. At this point, the
Nsub is set to 10, and 10,000 sample points would be generated fitting should be terminated, since subsequent iterations will not
during each iterative optimization. If the fitting procedure exe­ improve the fitting accuracy. As a result, we added the conver­
cutes 19 iterative optimizations, this may need to perform gence detection of Etotal to the algorithm, that is, when the Etotal
190,000 calculations and judgments. Additionally, the efficiency between the adjacent two iterations is no longer reduced, we will
of the algorithm is not exponentially related to Nsub , because as terminate the execution of the algorithm, and regarde the solu­
Nsub increases, the number of sampling points in each dimension tion at this time as the final optimal solution. The experimental
will increase, and the probability of obtaining the optimal solu­ results demonstrate that regardless of whether the point cloud
tion will also increase, which may result in a reduction in the contains noise or not, fitting can generally be accomplished in
number of iterative optimizations and thus in a reduction in fewer than 20 iterations. At this time, the preset Nopt (30) does not
execution time. Based on the results of many tests we have con­ play a role, as seen in Fig. 13. However, this does not indicate that
ducted, Nsub is recommended to be set to a value between 8 and the setting of Nopt is meaningless since the noise intensity in a
15, and should not be set too large or too small. If Nsub is set too point cloud is commonly challenging to estimate. Without a limit

11
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 13. Iterations and final total error of real experimental point cloud. (a) Statistics of iterations; (b) Statistics of final total error.

on the number of iterations, the algorithm may fall into endless deviation is within 1 mm, we can basically consider the fitted center
iterations. In general, setting this parameter to 30 almost gua­ reliable; otherwise, we need to re-adjust the parameters to improve the
rantees an ideal fitting result. Furthermore, the setting of Nopt fitting accuracy as much as possible.
should be compatible with the setting of Nsub . If Nsub is set rela­
tively small, Nopt should be increased suitably; Otherwise, Nopt
4.2. Efficiency
should be decresed appropriately.
(4) Emin is a preset threshold value for detecting the termination of
The efficiency of an algorithm refers to the time and space it takes to
iterative optimization. During each iteration, if it is detected that
solve a problem, which directly determines its scope of application. The
the Etotal of a particular sample point is less than Emin , we can
core of the AGS algorithm for spherical target fitting proposed in this
immediately terminate the iteration, and use this sample point as
paper is to seek the optimal solution of parameters through continuous
the optimal solution for spherical target fitting. The setting of this
iterative optimization, and its time complexity is O(nlog(n)). In the
parameter should take into account the noise intensity in the
design of the algorithm, we choose two iterations, one of which is the
point cloud, which should generally be less than 0.001. Experi­
iteration for the number of optimizations, and the other is the iteration
ments demonstrate that the case that Etotal is smaller than Emin
for screening the optimal samples. From our experimental results, these
does not occur during the fitting procedure of an actual point
two iterations are not the key to affecting the time-consuming of the
cloud. As a result, the algorithm must apply the constraint of Nopt
algorithm. Taking the fitting of real targets 1 and 5 as an example, the
and the convergence of Etotal to terminate the fitting process, as
two use the same parameter configuration, and the number of final it­
seen in Fig. 13.
erations is basically the same, but the running time of the two is quite
(5) λ represents the shrinkage rate of the scale of the four charac­
different. After analyzing the experimental results of the two groups of
teristic quantities at each iteration. The smaller the value, the
real point clouds, we have found a significant positive correlation be­
faster the shrinkage. The experimental findings demonstrate that
tween the number of points in the point cloud and the running time of
the ideal fitting result can be guaranteed when λ is set to be about
the algorithm (see Fig. 14). Under the same parameter settings, no
0.5. Additionally, the setting of λ needs to consider the intensity
matter whether the point cloud contains noise or not, the running time
of the noise. When the noise intensity is high, λ should be
will decrease with the decrease of the number of measurement points.
decreased to accelerate the search; otherwise, when the noise
For example, the contrast effect of targets 1 and 2 is pronounced. This
intensity is low, λ should be increased accordingly to improve
provides us with a feasible strategy to improve the efficiency of the al­
fitting accuracy. The judgment of noise intensity here is mainly
gorithm, which is to compress or subsample the point cloud before
based on the type of noise points contained in the point cloud.
fitting moderately.
Generally, drift points, isolated points, and redundant points are
In the design of the algorithm, to improve the execution efficiency as
all regarded as strong noise, and mixed points are regarded as
much as possible, we add two judgment conditions for ending the iter­
weak noise.
ative optimization early. The first is to detect whether a sample with a
total error less than a predetermined threshold (Emin ) is found in the
In the proposed algorithm, we design the sampling number of the
current sample space, and the second is to detect whether the total error
grid, the number of iterative optimizations, and the scaling factor of the
continues to decrease during optimization iterations. From the experi­
scale as adjustable parameters as much as possible to improve the
mental results, the AGS algorithm generally ends in advance when the
flexibility of the algorithm and expand its more comprehensive appli­
second condition is satisfied after about 20 iterative optimizations,
cation range. In practical applications, we generally only need to adjust
which also improves the efficiency of the algorithm to a certain extent.
the parameter of the estimated radius (Rset ), and keep other parameters
Compared with the NLS algorithm and the MSAC algorithm, the
as the default values we recommend, which can basically complete most
running time of the AGS algorithm is relatively slightly longer, which is
of the fitting work. Taking the three experiments we conducted as an
mainly due to the iterative optimization characteristics of the algorithm.
example, the AGS algorithm uses the same parameter settings and all
However, compared with the robustness of the other two algorithms, the
achieves the satisfying fitting results. When fitting the real spherical
AGS algorithm has obvious advantages, especially for the ill-conditioned
target, its radius is usually known clearly, and we can roughly estimate
cases with low coverage or strong noise, it still achieves higher fitting
the accuracy of the fit with the help of the radius deviation. If the radius
accuracy. In the practical application of terrestrial LiDAR, the spherical

12
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 14. Statistics of the number of points in the point cloud and the running time of the algorithm. (a) Statistics of experimental results on noiseless data, (b)
Statistics of experimental results on noisy data.

target is mainly used for registration, instrument calibration, deforma­ further. Simultaneously, to visualize the iterative process of the algo­
tion monitoring, etc. Among them, we mainly focus on the fitting ac­ rithm more clearly, we plot the curve of total error change of sample
curacy of the center and the robustness of the algorithm. The run time of points throughout the fitting process for each spherical target in the two
several seconds required for fitting is perfectly acceptable, as it is not a groups of actual experimental data (see Fig. 15b). These curves pri­
job with high real-time requirements. If it is essential, we can reduce the marily describe the evolution of the total error of sample points as the
running time of the algorithm by subsampling or denoising the point number of iterations increases. The change in the total error of the
cloud in advance, which will not affect the fitting accuracy of the AGS sample points indicates that regardless of whether the point cloud
algorithm. In this regard, we have also carried out a certain degree of contains apparent noise or not, as the number of iterations increases, the
proof in our experiments. sample space becomes more and more refined, making the total error of
the sample point smaller and smaller, until it gradually approaches the
optimal solution. Compared with the noiseless point cloud, the total
4.3. Robustness error of the sample points in the first few sample spaces of the noisy
point cloud is relatively large, but with the continuous iterative opti­
Affected by multiple factors such as instrument performance and mization, it would gradually become smaller and tend to be stable.
complex external environment, the acquired point cloud may inevitably Compared with the AGS algorithm, the NLS algorithm heavily relies
be mixed with noise, and its intensity is brutal to evaluate accurately. on point cloud information, and its fitting accuracy is easily affected by
Although we can remove noise as much as possible through various the coverage and noise of the point cloud. Especially when the coverage
denoising algorithms, it is almost impossible to obtain completely noise- is low or the intensity of noise is high, the fitting results of the NLS al­
free data[46]. Additionally, we sometimes cannot perform denoising in gorithm are prone to large deviations. There is also an improved NLS
advance to retain as much information as possible in the point cloud algorithm that tries to improve the fitting accuracy with the help of some
[47,48]. Simultaneously, since the geometric center of the real spherical prior assumptions, such as an error in variables (EIV), observation value
target cannot be obtained by direct measuring means, the fitting accu­ weighting, etc. [49–51]. However, these prior assumptions are often not
racy cannot be accurately evaluated, which requires the fitting algo­ feasible in practical work, such as equal accuracy of all measurement
rithm to have good robustness. While making full use of point cloud points, reflection intensity or incident angle weighting. The MSAC al­
information, the AGS algorithm considers the geometric characteristics gorithm improves noise immunity to a certain extent due to adding
of the spherical target, and gradually approaches the actual center and M− estimation as a constraint. However, due to the limitation of random
radius by continuously optimizing the sample space, which should be sampling, the accuracy of the fitting center of the MSAC algorithm is
more robust in theory. According to the designed error criteria, the unstable, and the mutual difference sometimes reaches more than ± 50
closer the obtained optimal solution is to the actual value throughout the mm. This situation is unacceptable for spherical target fitting because
iterative process, the smaller the total error would be. If there is no noise we cannot effectively judge which solution of the multiple fitting results
in the data, the final total error should be close to 0. Nevertheless, the of the MSAC algorithm is reliable for the spherical target whose center is
noise in actual data always exists, so the total error can never be zero; unknown. The AGS algorithm adopts the solution strategy of the inverse
however, with the help of its convergence, we take the sample point with problem, comprehensively utilizes the point cloud and geometric
the least total error as the final optimal solution, which fully conforms to feature of the spherical target, and gradually obtains the final optimal
the discrete geometric properties of a sphere. solution through continuous iterative optimization. The experimental
Three sets of experimental results prove that the AGS algorithm can results show that with the increase of the noise intensity or the decrease
effectively overcome the effect of noise. Through continuous iterative of the coverage, the fitting accuracy of the NLS algorithm and the MSAC
optimization, the total error (Etotal ) is continuously approached to the algorithm is getting lower and lower, but the AGS algorithm can still
minimum to find the optimal solution of parameters. From the change of guarantee the fitting accuracy within 1 mm. This reveals that the AGS
the step curve of the total error throughout the fitting process, the total algorithm overcomes the defects of NLS algorithm and MSAC algorithm
error tends to converge basically after about 6 iterations, and there will that are easily affected by noise or coverage and proves its inherent
be no apparent downward trend in the subsequent iterations (see robustness.
Fig. 15a). The following iterations are used to optimize the fitting results

13
Y. Shi et al. Measurement 198 (2022) 111430

Fig. 15. Fitting process of two groups of actual experimental data. (a) The relation between total error and number of iterations. (b) The change of the total error of
the sample points during the fitting process of each spherical target.

The robustness of the spherical target fitting algorithm is mainly control effectively. We can use the denoising algorithm to remove all
affected by noise and coverage. To improve the fitting accuracy of the kinds of noise as much as possible before fitting. However, the choice of
algorithm, improving the quality of data is a good solution. The the denoising algorithm is a complicated issue because different algo­
coverage is affected by various factors such as instrument performance, rithms have different filtering criteria for noise points. We can improve
external environment, scanning distance, et al., and it is not easy to the fitting accuracy in the AGS algorithm by adding a noise removal

14
Y. Shi et al. Measurement 198 (2022) 111430

function in the iterative process. For instance, after each iteration is [5] W. Matwij, W. Gruszczyński, E. Puniach, P. Ćwiąkała, Determination of
underground mining-induced displacement field using multi-temporal TLS point
complete and the optimal solution is determined, the distance between
cloud registration, Measurement 180 (2021) 109482.
each measurement point and the fitting center can be estimated. At this [6] H. El-Din Fawzy, 3D laser scanning and close-range photogrammetry for buildings
point, we can improve the data quality to a certain extent by removing documentation: A hybrid technique towards a better accuracy, Alexandria
some particular points with relatively large distances to improve the Engineering Journal 58 (2019) 1191–1204.
[7] M. Guo, B. Yan, T. Zhou, D. Pan, G. Wang, R. Bernini, Accurate Calibration of a
fitting accuracy. This treatment is reasonable from the geometric Self-Developed Vehicle-Borne LiDAR Scanning System, Journal of Sensors 2021
properties of the spherical target since those points that are obviously off (2021) 1–18.
the center can basically be treated as noise. [8] E. Bretagne, P. Dassonvalle, G. Caron, Spherical target-based calibration of
terrestrial laser scanner intensity, Application to colour information computation,
ISPRS Journal of Photogrammetry and Remote Sensing 144 (2018) 14–27.
5. Conclusion [9] T. Tóth, Z. Pusztai, L. Hajder, Automatic LiDAR-Camera Calibration of Extrinsic
Parameters Using a Spherical Target, 2020 IEEE International Conference on
Robotics and Automation (ICRA), France, Paris, 2020.
In this study, we propose an adaptive grid search algorithm suitable [10] B. Muralikrishnan, Performance Evaluation of Terrestrial Laser Scanners - A
for the spherical target fitting. Based on the inverse problem-solving Review, Meas Sci Technol 32 (7) (2021) 072001.
strategy, we make full use of the point cloud and geometric feature of [11] D. Yun, S. Kim, H. Heo, K.H. Ko, Automated registration of multi-view point clouds
using sphere targets, Adv. Eng. Inf. 29 (4) (2015) 930–939.
the spherical target, and obtain its optimal fitting parameters via a [12] H. Zhang, K.-Y. Wong, G. Zhang, Camera calibration from images of spheres, IEEE
limited number of iterative optimizations. To validate the feasibility and Trans Pattern Anal Mach Intell 29 (3) (2007) 499–502.
reliability of the algorithm, we have conducted experiments on actual [13] K.-Y. Wong, G. Zhang, Z. Chen, A stratified approach for camera calibration using
spheres, IEEE Trans Image Process 20 (2) (2011) 305–316.
data and simulated data, respectively, and compared them with the [14] Y. Tang, L. Li, W. Feng, F. Liu, X. Zou, M. Chen, Binocular vision measurement and
results of the current commonly used NLS algorithm and MSAC algo­ its application in full-field convex deformation of concrete-filled steel tubular
rithm. The experimental results show that the AGS algorithm is suitable columns, Measurement 130 (2018) 372–383.
[15] D. Epstein, D. Feldman, Quadcopter Tracks Quadcopter via Real-Time Shape
for high-precision fitting of various point clouds of spherical targets and Fitting, Ieee Robot Autom Let 3 (1) (2018) 544–550.
overcomes the defects of the other two algorithms that are easily [16] Y. Tang, M. Zhu, Z. Chen, C. Wu, B. Chen, C. Li, L. Li, Seismic performance
affected by noise and coverage. Due to the limitation of iterative opti­ evaluation of recycled aggregate concrete-filled steel tubular columns with field
strain detected via a novel mark-free vision method, Structures 37 (2022) 426–441.
mization, the running time of the AGS algorithm is slightly longer than [17] D. Epstein, D. Feldman, Sphere Fitting with Applications to Machine Tracking,
that of the other two algorithms. However, we can improve this problem Algorithms 13 (8) (2020) 177.
with appropriate preprocessing, such as moderate compression or sub­ [18] X. Fang, J. Wang, B. Li, W. Zeng, Y. Yao, On total least squares for quadratic form
estimation, Stud. Geophys. Geod. 59 (3) (2015) 366–379.
sampling of the point cloud before fitting, or adding appropriate
[19] J. Kim, D. Kim, Weighted Total Least Squares based Online Calibration Method for
denoising during the iterative process. When designing the algorithm, RSS based Localization, IEEE/RSJ International Conference on Intelligent Robots
we try to set several key steps in the form of adjustable parameters to and Systems (IROS) 2018 (2018) 117–122.
make it more flexible. [20] A. Amiri-Simkooei, S. Jazaeri, Weighted total least squares formulated by standard
least squares theory, Journal of Geodetic, Science 2 (2012) 113–124.
In the future work, we will further improve the execution efficiency [21] G.H. Golub, C.f., Van Loan, Matrix computations, JHU press (2013).
of the algorithm and the intelligent configuration of parameters and try [22] A.B. Forbes, Robust Circle And Sphere Fitting By Least Squares, National Physical
to extend the algorithm to solve more generalized sphere fitting prob­ Laboratory, Teddington, 1989.
[23] Y. Nievergelt, Computing circles and spheres of arithmitic least squares, Comput.
lems in other fields, such as object tracking, pattern recognition, et al. Phys. Commun. 81 (1994) 343–350.
[24] H. Späth, Least-square fitting with spheres, J. Optim. Theory Appl. 96 (1998)
191–199.
CRediT authorship contribution statement [25] S.J. Ahn, W. Rauh, H.J. Warnecke, Least-squares orthogonal distances fitting of
circle, sphere, ellipse, hyperbola, and parabola, Pattern Recogn. 34 (2001)
2283–2303.
Yintao Shi: Conceptualization, Methodology, Validation, Writing – [26] M. Franaszek, G.S. Cheok, C. Witzgall, Fast automatic registration of range images
original draft, Writing – review & editing. Gang Zhao: Conceptualiza­ from 3D imaging systems using sphere targets, Autom. Constr. 18 (2009) 265–274.
tion, Supervision, Funding acquisition. Maowei Wang: Formal analysis, [27] C. Witzgall, G.S. Cheok, A.J. Kearsley, Recovering Circles and Spheres from Point
Data, Perspectives in Operations Research, in: F.B. Alt, M.C. Fu, B.L. Golden (Eds.),
Validation, Investigation. Yi Xu: Visualization, Software, Data curation. Operations Research/Computer Science Interfaces SeriesPerspectives in Operations
Research, Springer US, Boston, MA, 2006, pp. 393–413.
[28] Z. Fei, J. Fu, J. Ma, W. He, Y. Xiao, A new high-precision sphere-fitting method
Declaration of Competing Interest with small segment angles, Meas. Sci. Technol. 32 (1) (2020) 015012.
[29] T.H. Hopp, C.P. Reeve, An algorithm for computing the minimum covering sphere
in any dimension, NIST IR5381, NIST, Gaithersburg, MD, 1996, pp. 1–8.
The authors declare that they have no known competing financial [30] Z. Zhang, Parameter Estimation Techniques-A Tutorial with Application to Conic
interests or personal relationships that could have appeared to influence Fitting, INRIA (1995).
the work reported in this paper. [31] Y. Nievergelt, Median spheres: theory, algorithms, applications, Numer. Math. 114
(2010) 573–606.
[32] D. Clouse, C. Padgett, Estimating the position of a sphere from range images,
Acknowledgement Proceedings, IEEE Aerospace Conference, IEEE, 2002, pp. 5-5.
[33] Y. Sumith, Fast geometric fit algorithm for sphere using exact solution, arXiv:
1506.02776, (2015).
This work was supported by the project of hydraulic science and [34] J. Lesouple, B. Pilastre, Y. Altmann, J.-Y. Tourneret, Hypersphere Fitting From
technology of Jiangsu province (No.2018005, No.2019001, No. Noisy Data Using an EM Algorithm, IEEE Signal Process Lett. 28 (2021) 314–318.
[35] T.T. Tran, V.T. Cao, D. Laurendeau, eSphere: extracting spheres from unorganized
2020007, No.2021063, No.2021074).
point clouds How to extract multiple spheres accurately and simultaneously, Visual
Comput 32 (2016) 1205–1222.
References [36] W.I. Liu, Novel method for sphere target detection and center estimation from
mobile terrestrial laser scanner data, Measurement 137 (2019) 617–623.
[37] G. Petrie, C.K. Toth, Terrestrial laser scanners, CRC Press, Topographic Laser
[1] L. Zhang, C.a. Hu, L. Kong, F. Lv, S. Defilla, W. Chu, Application of 3D laser
Ranging and Scanning, 2017, pp. 87–128.
scanning technology in engineering field, E3S Web of Conferences, 2021.
[38] R.C. Aster, B. Borchers, C.H. Thurber, Parameter estimation and inverse problems,
[2] Y. Jo, S. Hong, Three-Dimensional Digital Documentation of Cultural Heritage Site
Elsevier, Amsterdam, The Netherlands, 2018.
Based on the Convergence of Terrestrial Laser Scanning and Unmanned Aerial
[39] P. Rachakonda, B. Muralikrishnan, L. Cournoyer, G. Cheok, V. Lee, M. Shilling,
Vehicle Photogrammetry, ISPRS Int. J. Geo-Inf. 8 (2019) 53.
D. Sawyer, Methods and Considerations to Determine Sphere Center from
[3] Q. Wang, M.-K. Kim, Applications of 3D point cloud data in the construction
Terrestrial Laser Scanner Point Cloud Data, Meas Sci Technol 28 (10) (2017)
industry: A fifteen-year review from 2004 to 2018, Advanced Engineering
105001.
Informatics, 39 (2019) 306-319.
[40] H.A. Fayed, A.F. Atiya, Speed up grid-search for parameter selection of support
[4] K. Dai, A. Li, H. Zhang, S.-E. Chen, Y.i. Pan, Surface damage quantification of
vector machines, Appl. Soft Comput. 80 (2019) 202–210.
postearthquake building based on terrestrial laser scan data, Structural Control and
Health Monitoring 25 (8) (2018) e2210.

15
Y. Shi et al. Measurement 198 (2022) 111430

[41] X. Ma, Y. Zhang, Y. Wang, Performance evaluation of kernel functions based on [46] Y. Zheng, G. Li, S. Wu, Y. Liu, Y. Gao, Guided point cloud denoising via sharp
grid search for support vector regression, 2015 IEEE 7th international conference feature skeletons, The Visual Computer 33 (2017) 857–867.
on cybernetics and intelligent systems (CIS) and IEEE conference on robotics, [47] X. Yang, K. Matsuyama, K. Konno, Y. Tokuyama, Feature-preserving simplification
automation and mechatronics (RAM), IEEE, 2015, pp. 283-288. of point cloud by using clustering approach based on mean curvature, The Society
[42] Y. Arayici, An approach for real world data modelling with the 3D terrestrial laser for Art and Science 14 (2015) 117–128.
scanner for built environment, Autom. Constr. 16 (6) (2007) 816–829. [48] Z. Liu, X. Xiao, S. Zhong, W. Wang, Y. Li, L. Zhang, Z. Xie, A feature-preserving
[43] T.P. Kersten, K. Mechelke, M. Lindstaedt, H. Sternberg, Methods for geometric framework for point cloud denoising, Comput. Aided Des. 127 (2020), 102857.
accuracy investigations of terrestrial laser scanning systems, Photogrammetrie- [49] X. Fang, Weighted total least squares: necessary and sufficient conditions, fixed and
Fernerkundung-Geoinformation 2009 (4) (2009) 301–315. random parameters, J. Geod. 87 (2013) 733–749.
[44] A. Aryan, F. Bosché, P. Tang, Planning for terrestrial laser scanning in construction: [50] S. Van Huffel, P. Lemmerling, Total least squares and errors-in-variables modeling:
A review, Autom. Constr. 125 (2021) 103551. analysis, algorithms and applications, Springer Science & Business Media, 2013.
[45] D. Demirović, An implementation of the mean shift algorithm, Image Processing [51] V. Mahboub, S. Ebrahimzadeh, Non-linear block least-squares adjustment for a
On Line 9 (2019) 251–268. large number of observations, Survey Review (2021) 1–11.

16

You might also like