Материал: [2.1] 3D Imaging, Analysis and Applications-Springer-Verlag London (2012)

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

6 3D Shape Registration

245

as the sum of Nd squared residual vectors:

 

Nd

2

 

 

 

E(a) =

 

,

ei (a) = Rdi + t − mj .

(6.12)

ei (a)

 

 

i=1

 

 

 

 

Defining the residual vector as:

 

 

 

 

e(a) = e1(a)

 

e2(a) . . . eNd (a) T,

(6.13)

we rewrite the error function as E(a) = e(a) 2.

The Levenberg-Marquardt algorithm combines the methods of gradient-descent and Gauss-Newton. The goal at each iteration is to choose an update to the current estimate ak , say x, so that setting ak+1 = ak + x reduces the registration error.

We first derive the Gauss-Newton update. Expanding E(a + x) to second order

yields:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E(a

+

x)

=

E(a)

E(a)

·

x

+

1

 

 

2E(a)

·

x

·

x

+

h.o.t.

(6.14)

 

 

 

 

+

 

2

!

 

 

 

 

 

 

 

This is rewritten in terms of e as:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E(a) = eTe

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E(a) = 2( e)Te

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2E(a) = 2 2e e + 2( e)T e.

 

 

 

 

 

 

We now define the Nd × p Jacobian matrix J = e, with block (i, j ) as Ji,j =

∂Ei

∂aj

(p is the number of elements in a). Introducing the Gauss-Newton approximation (i.e., neglecting ( 2e)e) we get:

E(a + x) ≈ eTe + xTJTe + xTJTJx.

(6.15)

Differentiating with respect to x and nullifying yields:

 

xE(a + x) = JTe + JTJx = 0,

(6.16)

and gives the Gauss-Newton update:

 

xGN = − JTJ −1JTe.

(6.17)

Gauss-Newton is usually fast for mildly nonlinear problems (it has superlinear convergence speed), but there is no guarantee of convergence in the general case (an update may increase the error).

We now derive the gradient descent update. Since we deal with a Least Squares problem, the gradient descent update is simply given by:

xGD = −λ−1JTe,

(6.18)

246

U. Castellani and A. Bartoli

where λ is the inverse step length. Gradient descent has the nice property that, unless a local minimum has been reached, one can always decrease the error by making the step length small enough. On the other hand, gradient descent is known to be slow and rather inefficient.

The Levenberg-Marquardt algorithm combines both Gauss-Newton and gradient descent updates in a relatively simple way:

xLM = − JTJ + λI −1JTe.

(6.19)

A large value of λ yields a small, safe, gradient-descent step while a small value of λ favor large and more accurate steps of Gauss-Newton that make convergence to a local minimum faster. The art of a Levenberg-Marquardt algorithm implementation is in tuning λ after each iteration to ensure rapid progress even where Gauss-Newton fails. The now standard implementation is to multiply λ by 10 if the error increases and to divide it by 10 if the error decreases (with an upper bound at 108 and a lower bound at 10−4 for instance). In order to make the method robust to outliers, one may attenuate the influence of points with a large error by replacing the square error function by an M-estimator ε and an Iterative Reweighted Least Squared (IRLS)- like reweighting procedure. For instance, the following robust functions can be used:

Lorenzian: ε(r) = log 1 +

r2

 

or

σ

Huber: ε(r) =

r2

 

r < σ

2σ |r| − σ 2

 

otherwise.

6.6.2 Computing the Derivatives

An important issue in how Levenberg-Marquardt is applied to ICP is the one of computing the derivatives of the error function. The simplest approach is based on using finite differencing, assuming that the error function is smooth. However, this leads to a cost of p extra function evaluations per inner loop. In [32] a more effective solution was proposed based on the distance transform which also drastically improves the computational efficiency. The distance transform is defined as:

 

=

j

 

 

−

 

 

 

 

Dε (x)

 

min ε2

 

mj

 

x

 

,

(6.20)

where x X and X is a discrete grid representing the volume which encloses the model-view M. Indeed, each data-point di can be easily associated to grid-points by obtaining the residual error ei = X(di ) in one shot.5 In other words, LM-ICP merges

5Note that the volume is discretized into integer values, therefore the data-point di should be rounded to recover X(di ).

6 3D Shape Registration

247

the two main steps of ICP, namely closest point computation and transformation estimation, in a single step. Note further that when the mapping x → ε2( x ) is monotonic, we obtain that Dε (x) = ε2( D(x) ), so existing algorithms to compute D may be used to compute Dε , without requiring knowledge of the form of ε.

By combining Eq. (6.12) with Eq. (6.20) the new formulation of the registration problem becomes:

Nd

 

 

 

E(a) = Dε T (a, di ) .

(6.21)

i=1

This formulation makes it much easier to compute the derivatives of E. In fact, since the distance transform is computed in a discrete form, it is possible to compute finite differences derivatives. More specifically,

 

 

 

 

 

 

∂Dε

 

∂Dε

 

∂Dε

 

 

xDε =

 

,

 

,

 

 

 

∂x

∂y

∂z

is computed by defining

 

 

 

 

 

 

 

 

 

 

 

∂Dε (x, y, z)

 

=

Dε (x + 1, y, z) − Dε (x − 1, y, z) ,

 

 

∂x

 

 

 

 

 

 

2

 

 

 

 

∂Dε (x, y, z)

 

=

Dε (x, y + 1, z) − Dε (x, y − 1, z) ,

 

 

∂y

 

 

 

 

 

 

2

 

 

 

and

 

 

 

 

 

 

 

 

 

 

 

 

∂Dε (x, y, z)

=

 

Dε (x, y, z + 1) − Dε (x, y, z − 1)

.

 

 

 

 

 

 

 

∂z

 

 

 

 

 

2

 

 

 

In practice, xDε remains constant through the minimization, and we get:

Nd

aE(a) = xDε T (a, di ) aTT (a, di ). (6.22)

i=1

Note that the computation of aTT (a, di ) depends on the rigid transformation parametrization being used. In [32], the author proposed to model rotations by unitary quaternions for which the derivatives can be easily computed analytically. Finally, in order to compute the derivatives using matrix operators the Jacobian matrix is defined as Ji,j = ( xDε (T (a, di )) · aTj T (a, di )), where aj T (a, di ) =

[

∂Tx (a,di )

,

∂Ty (a,di )

,

∂Tz (a,di )

].

∂aj

∂aj

∂aj

6.6.3 The Case of Quaternions

Let the quaternion be defined by q = [s, v] where s and v are the scalar and vectorial components respectively [97]. Let d be the point on which the rotation must be

248

U. Castellani and A. Bartoli

applied. To this aim such a point must be represented in quaternion space, leading to r = [0, d]. Therefore, the rotated point is obtained by:

r = qrq−1.

By multiplying in quaternion space6 we obtain:

r = 0, s2d + (d · v) · v + 2s(v × d) + v × (v × d) .

We represent this rotated point as:

r = [0, Tx , Ty , Tz],

where:

Tx = s2dx + (dx vx + dy vy + dzvz)vx + 2s(vy dz − vzdy ) + vy (vx dy − vy dx )

−vz(vzdx − vx dz)

=s2dx + vx2dx + vx vy dy + vx vzdz + 2svy dz − 2svzdy + vx vy dy − vy2dx

−vz2dx + vx vzdz

=s2 + vx2 − vy2 − vz2 dx + 2(vx vy − svz)dy + 2(vx vz + svy )dz

Ty = s2dy + (dx vx + dy vy + dzvz)vy + 2s(vzdx − vx dz) + vz(vy dz − vzdy )

−vx (vx dy − vy dx )

=s2dy + vx vy dx + vy2dy + vy vzdz + 2svzdx − 2svx dz + vy vzdz − vz2dy

−vx2dy + vx vy dx

=2(vx vy + svz)dx + s2 − vx2 + vy2 − vz2 dy + 2(vy vz − svx )dz

Tz = s2dz + (dx vx + dy vy + dzvz)vz + 2s(vx dy − vy dx ) + vx (vzdx − vx dz)

−vy (vy dz − vzdy )

=s2dz + vx vzdx + vy vzdy + vz2dz + 2svx dy − 2svy dx + vx vzdx − vx2dz

−vy2dz + vy vzdy

=2(vx vz − svy )dx + 2(vy vz + svx )dy + s2 − vx2 − vy2 + vz2 dz.

Now we introduce the translation component [tx , ty , tz] and normalize the quaternion by obtaining:

6A multiplication between two quaternions q and q is defined as [ss − v · v , v × v + sv + s v].

6 3D Shape Registration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

249

 

 

(s2 + vx2 − vy2 − vz2)dx

 

 

 

2(vx vy

svz)dy

 

 

2(vx vz

 

svy )dz

 

Tx =

 

 

 

 

 

 

 

 

+

 

 

 

 

−

 

 

 

 

+

 

 

 

+

 

 

+ tx

 

s2

+

v2

v2

+

v2

 

s2

+

v2

v2

+

v2

s2

+

v2

v2

+

v2

 

 

 

 

 

x +

 

y

z

 

 

 

 

 

x

+

y

 

z

 

 

 

x

+

y

z

 

 

 

2(vx vy

svz)dx

 

(s2 − vx2 + vy2 − vz2)dy

 

 

2(vy vz

 

svx )dz

 

Ty

=

 

 

 

+

 

 

+

 

 

 

 

 

 

 

 

 

 

 

 

+

 

 

 

−

 

 

+ ty

s2

+

v2

v2

+

v2

 

 

s2

+

v2

v2

+

v2

 

 

 

s2

+

v2

v2

+

v2

 

 

 

x

 

+ y

 

z

 

 

 

 

 

 

x +

y

 

z

 

 

 

 

 

 

x

+

y

z

 

 

 

2(vx vz

svy )dx

 

 

2(vy vz

 

svx )dy

 

 

 

 

(s2 − vx2 − vy2 + vz2)dz

 

Tz

=

 

 

 

−

 

 

+

 

 

 

 

+

 

+

 

 

 

 

 

 

 

 

 

 

 

+ tz.

s2

+

v2

v2

+

v2

s2

+

v2

v2

v2

 

 

 

s2

+

v2

+

v2

+

v2

 

 

 

 

x

 

+ y

 

z

 

 

 

x

+ y +

z

 

 

 

 

 

x

y

z

 

 

According to this model for rotation and translation, the vector of unknowns is a = [s, vx , vy , vz, tx , ty , tz] (i.e., a R7). Therefore, the Jacobian part aTT (a, d) is a 3 × 7 matrix:

 

 

∂Tx

 

∂Tx

 

∂Tx

 

∂Tx

 

∂Tx

 

∂Tx

 

∂Tx

 

 

 

 

∂s

 

∂vx

 

∂vy

 

∂vz

 

∂tx

 

∂ty

 

∂tz

 

 

 

T

∂Ty

 

∂Ty

 

∂Ty

 

∂Ty

 

∂Ty

 

∂Ty

 

∂Ty

 

 

a T (a, d)

=

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(6.23)

 

 

∂vx

 

∂vy

 

∂vz

 

∂tx

 

∂ty

 

∂tz

 

∂s

 

 

 

 

 

 

 

 

 

∂Tz

 

∂Tz

 

∂Tz

 

∂Tz

 

∂Tz

 

∂Tz

 

∂Tz

 

 

 

 

∂s

 

∂vx

 

∂vy

 

∂vz

 

∂tx

 

∂ty

 

∂tz

 

 

where Tx , Ty , and Tz have been defined above. For instance we can compute the

derivative component ∂Tx as:

 

 

 

 

 

 

 

 

 

 

∂vx

 

 

 

 

 

 

 

 

∂Tx

=

 

2vx dx

−

 

2vx (s2 + vx2 − vy2 − vz2)dx

 

∂vx

s2 + vx2 + vy2 + vz2

 

 

(s2 + vx2 + vy2 + vz2)2

 

 

 

 

+

2vx dy

 

 

−

4vx (vx vy − svz)dy

 

 

 

 

s2 + vx2 + vy2 + vz2

 

(s2 + vx2 + vy2 + vz2)2

 

 

 

 

+

2vzdz

 

 

−

4vx (vx vz + svy )dz

.

 

 

 

s2 + vx2 + vy2 + vz2

 

(s2 + vx2 + vy2 + vz2)2

 

 

Similarly, all the other components of the Jacobian can easily be computed.

6.6.4 Summary of the LM-ICP Algorithm

The algorithm for LM-ICP can be summarized as:

1.Set λ ← λ0 = 10,

2.compute distance transform Dε (x),

3.set ak ← a0,

4.compute ek = e(ak ),

5.compute J,

6.repeat

Источник: https://studfile.net/preview/16498100/