Skip to main content
Journal of Research of the National Institute of Standards and Technology logoLink to Journal of Research of the National Institute of Standards and Technology
. 2010 Dec 1;115(6):461–470. doi: 10.6028/jres.115.032

Variances of Plane Parameters Fitted to Range Data

Marek Franaszek 1
PMCID: PMC4548868  PMID: 27134798

Abstract

Formulas for variances of plane parameters fitted with Nonlinear Least Squares to point clouds acquired by 3D imaging systems (e.g., LADAR) are derived. Two different error objective functions used in minimization are discussed: the orthogonal and the directional functions. Comparisons of corresponding formulas suggest the two functions can yield different results when applied to the same dataset.

Keywords: LADAR, nonlinear least squares, variances of fitted parameters

1. Introduction

3D imaging systems are line-of-sight instruments that provide range images of objects in a given region of interest, I(ϑ,φ), where I denotes the distance from an instrument to a point on a surface of the object and ϑ and φ are the elevation and the azimuth angles to that point. Usually a point cloud in a Cartesian coordinate system associated with the instrument is derived from the range image. Current 3D imaging systems may collect point clouds containing hundreds of thousands of points within a few seconds [1]. Frequently, these data points are used to model the objects by geometrical primitives that are characterized by attributes such as location, pose, width, height, etc. Numerical values of these attributes may be obtained by fitting a model to the segmented dataset. Here, we discuss the Nonlinear Least Squares (NLS) fitting procedure applied to range data obtained by scanning a plane. Specifically, we address the following problem: how do the uncertainties of range measurements by an instrument propagate to uncertainties of the fitted plane parameters [2]?

Usually, variances of fitted parameters (which are useful for uncertainty analysis) are derived from the Jacobian matrix of a model function used in a given fitting problem. This common approach is based on a linearization of the nonlinear error function near its minimum [37]. In this paper we do not follow this path but estimate the variances directly from the sensitivities for which we provide analytical formulas.

2. Variances of Fitted Plane Parameters

A plane in a three-dimensional Cartesian coordinate system is defined as a set of points P(x, y, z) satisfying the following equation

P(x,y,z)w(ϑ,φ)=D (1)

where w(ϑ,φ) is a unit vector perpendicular to a plane, parameterized by two angles: the elevation ϑ (a zero elevation being horizontal) and the azimuth φ, and where • stands for the dot product of two vectors. The Cartesian coordinates of w(ϑ,φ) may be written as

w(ϑ,φ)=[cosϑcosφ,cosϑsinφ,sinϑ]. (2)

The absolute value of parameter D is the distance from the plane to the origin of the coordinate system, and D may be expressed as

D=P0(x0,y0,z0)w(ϑ,φ), (3)

where P0 is any point on a plane. A plane can be fit to the experimental dataset P{N} = {Pj, j = 1,…, N}, where N denotes the number of points; the goal being to calculate the numerical values of the three parameters defining the plane: ϑ, φ and D. Within the framework of the Least Squares method, the fit parameters are obtained by minimizing the error function

E(ϑ,φ,D,P{N})=1Nj=1NEj2(ϑ,φ,D,Pj), (4)

where Ej is the distance between the experimental point Pj and its corresponding “theoretical point.” Different definitions of the theoretical point yield different error functions. In this paper we study two error functions: the orthogonal error function EO and the directional error function ED, as explained in Fig. 1 and in the next two sections.

Fig. 1.

Fig. 1

Due to instrument error in measurement of range r, experimental points P do not lie exactly on a plane (thick line). Points O are perpendicular projections of experimental points on a plane. Points D are intersections with the plane of rays originating from the instrument and passing through the experimental points. Distances PO are used in the orthogonal error function EO while PD are used in the directional error function ED. The difference between both functions depends on the Angle of Incidence (AOI).

It is not surprising that due to nonlinear dependence of the normal vector w on both angles ϑ and φ, plane fitting requires nonlinear minimization. However, as is shown in the next two sections, for both error functions EO and ED the distance Ej depends linearly on the third parameter D. Therefore, D may be explicitly expressed as a function of both angles (ϑ, φ) and P{N} from the condition

ED(ϑ,φ,D,P{N})=0. (5)

For any error function E defined by Eq. (4) with Ej depending linearly on D, the linear parameter can be expressed as a function of the remaining non-linear parameters and dataset P{N}

D=D(ϑ,φ,P{N}). (6)

When the error function E reaches its minimum at [ϑ*, φ*, D*], a gradient of the function has to be zero. This implies that the original 3D search space may be reduced to a 2D space and the error function may be re-written as

E(ϑ,φ,P{N})=1Nj=1NEj2(ϑ,φ,Pj), (7)

the minimum of E being located at

ϑ*=ϑ*(P{N}),φ*=φ*(P{N}),D*=D(ϑ*,φ*,P{N}). (8)

The variances of the fitted plane parameters var(ϑ*) and var(φ*) may be calculated following the same general approach developed for fitting a sphere to range data [8], [9]. In the current study, the same assumption is made as in the previous studies: for the 3D imaging systems relevant to this study, the uncertainty in the range measurement is typically much larger than the uncertainty in the angular measurements. Thus, an acquired point Pj can be expressed as

Pj=rjpj(ϑj,φj), (9a)

where rj is a range measured at bearings (ϑj, φj) and ||Pj|| = rj. In this approximation the bearings are treated as noise-free control variables and a unit vector pj is defined as

pj(ϑj,φj)=[cosϑjcosφj,cosϑjsinφj,sinϑj]. (9b)

Note that for other types of instruments, for example Coordinate Measuring Machines (CMM), the above assumption may not be valid and the formulas for variances of fitted plane parameters developed in this paper may not be applicable. In addition, it is assumed that the correlation in the measured ranges rj and rk is negligible for any jk. When both assumptions are valid, the variances of the fitted plane parameters may be estimated by applying to Eq. (8) the uncertainty propagation formula [2]

var(ϑ*)j=1N[ϑ*(P{N})rj]2var(rj), (10a)
var(φ*)j=1N[φ*(P{N})rj]2var(rj), (10b)

and the covariance may be estimated as

cov(ϑ*,φ*)j=1N[ϑ*(P{N})rj][φ*(P{N})rj]var(rj). (10c)

The variance of the third parameter D* may be calculated from the uncertainty propagation formula [2] applied to a general function D(ϑ,φ,P{N}) defined in Eq. (6),

var(D*)=j=1N[Dϑϑ*rj+Dφφ*rj+Drj]2var(rj) (11)

where the derivatives of D are calculated at (ϑ*, φ*, P{N}).

The individual sensitivities ϑ*rj,φ*rj used in Eqs. (10) and (11) may be calculated as in [8] by solving for each j the following 2 × 2 system of linear equations

H(ϑ*,φ*,P{N})Sj(P{N})=Vj(ϑ*,φ*,P{N}), (12)

where the vectors Sj and Vj are defined as

Sj(P{N})=[ϑ*(P{N})rjφ*(P{N})rj], (13a)
Vj(ϑ,φ,P{N})=[2E(ϑ,φ,P{N})rjϑ2E(ϑ,φ,P{N})rjφ]. (13b)

The matrix H is the Hessian of the error function E(ϑ, φ, P{N})

H(ϑ,φ,P{N})=[2Eϑ22Eϑφ2Eφϑ2Eφ2]. (14)

These general formulas are now applied to two specific error functions: the orthogonal error function EO and the directional error function ED.

3. Orthogonal Fitting

For the orthogonal plane fitting (see Fig. 1) the theoretical point Oj corresponding to the experimental point Pj is defined as the orthogonal projection of Pj on a plane. Thus, Eq. (4) takes the form

Eo(ϑ,φ,D,P{N})=1Nj=1N[w(ϑ,φ)PjD]2. (15)

Applying condition (5), Equation (6) can be expressed as

D(ϑ,φ,P{N})=w(ϑ,φ)(1Nj=1NPj)=wP0, (16)

where P0 here is the centroid of all experimental points P{N}. This condition states that the plane fitted with the orthogonal error function has to contain the centroid, P0. Defining a scalar product dj of two vectors w and pj given by Eqs. (2) and (9b)

dj(ϑ,φ)=w(ϑ,φ)pj(ϑj,φj), (17)

then Eq. (16) for the parameter D when using Eqs. (17) and (9a) can be rewritten as

D(ϑ,φ,P{N})=1Nj=1Ndj(ϑ,φ)rj, (18)

where rj is a measured range. In this notation, Eq. (7) describing the error function in the reduced 2D search space of angles (ϑ, φ) can be written as

Eo(ϑ,φ,P{N})=1Nj=1N(wUj)2, (19a)

where

Uj=PjP0. (19b)

Then, the elements of the gradient of the error function ∇EO defined in Eq. (19a) can be calculated as

Eoϑ(ϑ,φ,P{N})=2Nj=1N(wUj)(wϑUj), (20a)
Eoφ(ϑ,φ,P{N})=2Nj=1N(wUj)(wφUj), (20b)

while the elements of the Hessian matrix H defined in Eq. (14) are

2Eoϑ2(ϑ,φ,P{N})=2Nj=1N[(wϑUj)2+(wUj)(2wϑ2Uj)], (21a)
2Eoφ2(ϑ,φ,P{N})=2Nj=1N[(wφUj)2+(wUj)(2wφ2Uj)], (21b)
2Eoϑφ(ϑ,φ,P{N})=2Nj=1N[(wϑUj)(wφUj)+(wUj)(2wϑφUj)]. (21c)

Finally, the elements of vector Vj defined in Eq. (13b) can be obtained by differentiating with respect to rj the elements of the gradient ∇EO given by Eqs. (20a) and (20b). Taking into account the definition of vector Uj given by Eq. (19b) and the definition of centroid P0 of all points Pj as well the dependence of Pj on rj given by Eq. (9a), the elements of vector Vj can be evaluated as

2Eorjϑ(ϑ,φ,P{N})=2Nk=1NUkrj[(wϑUk)w+(wUk)wϑ], (22a)
2Eorjφ(ϑ,φ,P{N})=2Nk=1NUkrj[(wφUk)w+(wUk)wφ], (22b)

where

Ukrj=(δj,k1N)pk, (22c)

δj,k is the Kronecker delta, and pk is the unit vector defined in Eq. (9b). First and second order derivates of the vector w(ϑ,φ), defined in Eq. (2), are provided in Appendix A, Eqs. (A1A5). Once the matrix H and vectors Vj are known, the sensitivity vectors Sj can be calculated for every j by solving the 2 × 2 system of linear Eq. (12). The variances of the fitted angles var(ϑ*) and var(φ*) and the covariance cov(ϑ*,φ*) can then be determined from Eqs. (10a, b, c). The variance of the third parameter D*, defined in Eqs. (1618), can be now evaluated from Eq. (11) using the following equations:

Dϑ=wϑP0, (23a)
Dφ=wφP0, (23b)
Drj=1Ndj, (23c)

where the derivatives of D are calculated at [ϑ*,φ*, P{N}].

4. Directional Fitting

For the directional plane fitting (see Fig. 1) the theoretical point Dj corresponding to the experimental point Pj is defined as an intersection of a ray originating from the instrument through Pj with the plane

Dj=tjPj (24a)

where a parameter tj has its value close to 1, and the theoretical points satisfy Eq. (1) of the plane

Dj(xj,yj,zj)w(ϑ,φ)=D. (24b)

The distance Ej in Eq. (4) is the Euclidian norm and the directional error function ED can thus be written as

ED(ϑ,φ,D,P{N})=1Nj=1NDjPj2 (25)

where the parameter tj can be calculated from Eq. (24) using the dj defined in Eq. (17)

tj=Drjdj (26)

if dj is different from zero, i.e., if the vector pj is not orthogonal to w. Two vectors pj and w are orthogonal only if the corresponding AOI = ± 90°, which causes the theoretical point Dj to be undefined. For all other AOIs, tj can be calculated and substituted into Eq. (24a). Then, using Eq. (9a) and the fact that rj = ||Pj||, Eq. (25) yields the following expression for the directional error function

ED(ϑ,φ,D,P{N})=1Nj=1N(Ddjrj)2. (27)

Applying condition (5) to Eq. (27), Eq. (6) can be expressed as

D(ϑ,φ,P{N})=j=1Nrjdj1j=1Ndj2. (28)

In this notation, Eq. (7) describing the error function in the reduced 2D search space of angles (ϑ,φ) can be written as

ED(ϑ,φ,P{N})=1Nj=1N(D(ϑ,φ,P{N})dj(ϑ,φ)rj)2. (29)

Using the following auxiliary functions

Aϑ,j(ϑ,φ,P{N})=ϑ(Ddjrj)=(djDϑDdjϑ)dj2, (30a)
Aφ,j(ϑ,φ,P{N})=φ(Ddjrj)=(djDφDdjφ)dj2, (30b)

it is possible to calculate the elements of the gradient of the error function ∇ED

EDϑ(ϑ,φ,P{N})=2Nj=1N(Ddjrj)Aϑ,j, (31a)
EDφ(ϑ,φ,P{N})=2Nj=1N(Ddjrj)Aφ,j, (31b)

and the elements of the Hessian matrix H defined in Eq. (14)

2EDϑ2(ϑ,φ,P{N})=2Nj=1N[Aϑ,j2+(Ddjrj)Aϑ,jϑ], (32a)
2EDφ2(ϑ,φ,P{N})=2Nj=1N[Aφ,j2+(Ddjrj)Aφ,jφ], (32b)
2EDφϑ(ϑ,φ,P{N})=2Nj=1N[Aϑ,jAφ,j+(Ddjrj)Aϑ,jφ]. (32c)

The derivatives Dϑ and Dφ in Eqs. (30a,b) are calculated in the Appendix B, Eqs. (B17, B18), djϑ and djφ in (A6, A7), Aϑ,jϑ, Aφ,jφ and Aϑ,jφ in (C1C3). Finally, the elements of vector Vj defined in Eq. (13b) can be expressed as

2EDrjϑ(ϑ,φ,P{N})=2Nk=1N[(Drjdk1δj,k)Aϑ,k+(Ddkrk)Aϑ,krj], (33a)
2EDrjφ(ϑ,φ,P{N})=2Nk=1N[(Drjdk1δj,k)Aφ,k+(Ddkrk)Aφ,krj], (33b)

where the derivative Drj is calculated in Appendix B, Eq. (B22), Aϑ,krj and Aφ,krj in Eqs. (C4, C5), and δj,k is the Kronecker delta. Once the matrix H and vectors Vj are known, the sensitivity vectors Sj can be calculated for every j by solving a 2 × 2 system of linear equations (12). The variances of fitted angles var(ϑ*) and var(φ*) and the covariance cov(ϑ*,φ*) can then be determined from Eqs. (10a, b, c). The variance of the third parameter D*, defined in Eq. (28), can now be evaluated by substituting in Eq. (11) the Eqs. (B17, B18, B22), for the derivatives Dϑ, Dφ and Drj calculated at [ϑ*,φ*, P{N}].

5. Discussion

Figure 1 shows that the orthogonal plane fitting behaves differently from the directional fitting. The difference between orthogonal and directional fitting depends on the Angle of Incidence (AOI) of the laser beam. For AOI approaching 90°, the optimal value of the orthogonal error function EO(ϑ*,φ*, P{N}) is decreasing, even when the uncertainty of the measured ranges rj is large. The optimal value of the error function is usually interpreted as a gauge of noise level in experimental data (assuming that a right model is fitted to the data). For 3D imaging systems, due to a divergence of a laser beam, range measurements collected for large AOI have large uncertainty. Thus, the behavior of EO is in a sharp contrast with the common experimental observation. The directional fitting is free of this flaw and a residual value of the directional error function ED(ϑ*,φ*, P{N}) correctly estimates a level of noise in the acquired experimental dataset P{N} for any AOI. When EO is minimized, the sensitivities of the fitted angles ϑ*rj and φ*rj may be underestimated for large AOI. The flawed sensitivities entered in the Eqs. (10) and (11) will cause an underestimation of the variances of the plane parameters fitted with the orthogonal function for large AOI. For small AOI, the difference between EO and ED is diminishing and both error functions are expected to provide correct estimates for the variances of fitted parameters.

Individual sensitivities Sj of fitted angles are calculated from Eq. (12). The vector Vj on the right hand side of this equation behaves differently for the orthogonal and the directional error function, see Eqs. (D1, 2) and (D7, 8) in the Appendix D. This may cause a much larger variability of Sj calculated for the orthogonal fitting and a poorer estimate of variances of fitted parameters than for the directional fitting.

As was already pointed out, a plane fitted by minimizing the orthogonal error function has to contain the centroid P0 of the acquired points P{N}, see Eq. (16). Directional fitting does not have this constraint. Thus, a minimization of two error functions discussed in this paper may lead to different results.

6. Conclusions

In this paper we derived formulas for the variances (which are useful for uncertainty analysis) of plane parameters fitted to a dataset acquired with 3D imaging systems. Two error functions were investigated: the orthogonal and the directional error function. Comparison of corresponding formulas suggests the two functions may yield different results when applied to the same range data. However, in order to quantify the anticipated difference, laboratory experiments and computer simulations are needed.

Biography

About the author: Marek Franaszek is a physicist with the Engineering Laboratory of NIST. The National Institute of Standards and Technology is an agency of the U.S. Department of Commerce.

7. Appendix A

From the definition of w (ϑ,φ) in Eq. (2), the following derivates can be calculated

wϑ=[sinϑcosφ,sinϑsinφ,cosϑ] (A1)
wφ=[cosϑsinφ,cosϑcosφ,0] (A2)
2wϑ2=w (A3)
2wφ2=[cosϑcosφ,cosϑsinφ,0] (A4)
2wϑφ=[sinϑsinφ,sinϑcosφ,0]. (A5)

Then, the corresponding derivatives of dj(ϑ,φ) defined in Eq. (17) can be expressed as

djϑ=wϑpj (A6)
djφ=wφpj (A7)
2djϑ2=2wϑ2pj (A8)
2djφ2=2wφ2pj (A9)
2djφϑ=2wφϑpj (A10)

8. Appendix B

Auxiliary functions defined for calculation of derivatives of D(ϑ,φ, P{N}) defined in Eq. (28) for the directional fitting are given by:

a(ϑ,φ,P{N})=j=1Ndj2 (B1)
b(ϑ,φ,P{N})=j=1Nrjdj1 (B2)
cϑ(ϑ,φ,P{N})=j=1Ndjϑdj3 (B3)
cφ(ϑ,φ,P{N})=j=1Ndjφdj3 (B4)
dϑ(ϑ,φ,P{N})=j=1Nrjdjϑdj2 (B5)
dφ(ϑ,φ,P{N})=j=1Nrjdjφdj2. (B6)

Their respective derivatives are:

aϑ=2cϑ (B7)
aφ=2cφ (B8)
bϑ=dϑ (B9)
bφ=dφ (B10)
cϑϑ=j=1N[2djϑ2dj33dj4(djϑ)2] (B11)
cφφ=j=1N[2djφ2dj33dj4(djφ)2] (B12)
dϑϑ=j=1N[2djϑ2dj22dj3(djϑ)2]rj (B13)
dφφ=j=1N[2djφ2dj22dj3(djφ)2]rj (B14)
cϑφ=j=1N[2djϑφdj33dj4djφdjϑ] (B15)
dϑφ=j=1N[2djϑφdj22dj3djφdjϑ]rj (B16)

where the derivatives of dj are defined in (A6-A10). Using the above functions, the derivatives of D(ϑ,φ, P{N}) can be expressed as

Dϑ=(2bcϑadϑ)a2 (B17)
Dφ=(2bcφadφ)a2 (B18)
2Dϑ2=a2(2bϑcϑ+2bcϑϑaϑdϑadϑϑ)2a3aϑ(2bcϑadϑ) (B19)
2Dφ2=a2(2bφcφ+2bcφφaφdφadφφ)2a3aφ(2bcφadφ) (B20)
2Dφϑ=a2(2bφcϑ+2bcϑφaφdϑadϑφ)2a3aφ(2bcϑadϑ) (B21)

For the calculation of variances of fitted plane parameters, the following derivatives of D(ϑ,φ, P{N}) are also needed

Drj=1dj(ϑ,φ)a(ϑ,φ) (B22)
2Drjϑ=djϑa+djaϑdj2a2 (B23)
2Drjφ=djφa+djaφdj2a2 (B24)

9. Appendix C

The derivatives of the functions Aϑ,j and Aϕ,j defined in Eqs. (30a,b) and used in the gradient and Hessian calculations can be expressed as

ϑAϑ,j(ϑ,φ,P{N})=[dj2(dj2Dϑ2D2djϑ2)2dj2djϑDϑ+2djD(djϑ)2]dj4 (C1)
φAφ,j(ϑ,φ,P{N})=[dj2(dj2Dφ2D2djφ2)2dj2djφDφ+2djD(djφ)2]dj4 (C2)
φAϑ,j(ϑ,φ,P{N})=[djφDϑ+dj2DφϑDφdjϑD2djφϑ2djdjϑAϑ,j]dj2 (C3)

where the derivatives of D(ϑ, ϕ, P{N}) and dj are calculated in Appendices A and B. For the evaluation of sensitivities of fitted plane parameters, the following derivatives are also required

Aϑ,krj=dk2(dk2DrjϑDrjdkϑ) (C4)
Aφ,krj=dk2(dk2DrjφDrjdkφ), (C5)

where the derivatives of D are given by Eqs. (B22B24).

10. Appendix D

Using Eq. (22c), Eqs. (22a) and (22b) can be rewritten in the following form

2Eorjϑ(ϑ,φ,P{N})=2N[Fϑ,j(ϑ,φ,P{N})F¯ϑ(ϑ,φ,P{N})] (D1)
2Eorjφ(ϑ,φ,P{N})=2N[Fφ,j(ϑ,φ,P{N})F¯φ(ϑ,φ,P{N})], (D2)

where

Fϑ,j(ϑ,φ,P{N})=pj[(wϑUj)w+(wUj)dwϑ] (D3)
Fφ,j(ϑ,φ,P{N})=pj[(wφUj)w+(wUj)dwφ], (D4)

and F¯ϑ, F¯φ are the averaged values

F¯ϑ(ϑ,φ,P{N})=1Nk=1NFϑ,k(ϑ,φ,P{N}) (D5)
F¯φ(ϑ,φ,P{N})=1Nk=1NFφ,k(ϑ,φ,P{N}). (D6)

Equations (D1) and (D2) show that the components of the vector Vj in Eq. (13b) applied to EO depend explicitly on the measured range rj.

Equations (33a) and (33b) can be rewritten in the following form

2EDrjϑ(ϑ,φ,P{N})=2N{k=1N[Aϑ,kDrjdk1+(Ddk1)Aϑ,krj]Aϑ,j} (D7)
2EDrjφ(ϑ,φ,P{N})=2N{k=1N[Aφ,kDrjdk1+(Ddk1)Aφ,krj]Aφ,j}. (D8)

From the Eqs. (C4), (C5), and (B22) it follows that none of the derivatives Aϑ,krj, Aφ,krj, or Drj depends on rj. In fact, a measured range rj enters the right hand side of Eqs. (D7) and (D8) only indirectly in the formula for D and its angle derivatives; see Eqs. (28), (30a,b), (B17) and (B18). Thus, the influence of a particular j-th range measurement on the components of the vector Vj in Eq. (13b) applied to ED is negligible for typical datasets with large N.

11. References


Articles from Journal of Research of the National Institute of Standards and Technology are provided here courtesy of National Institute of Standards and Technology

RESOURCES