• No results found

Spherical-Harmonic Transform

3.2 Rotation Registration

3.2.2 Spherical-Harmonic Transform

Correlating two sets of normals in the Frequency domain requires their spherical-harmonic representation. The spherical-spherical-harmonic transform (SHT) provides this conversion from the spatial domain to the frequency domain, though it usually samples a continuous function on the unit sphere. While normals have discrete locations, this issue is circumvented by binning the normals (see Chapter 5), with each bin being formed around the SHT sample points.

34 Mathematical Preliminaries

Figure 3.1: Visualisation of the squared real components of the spherical har-monics up to the third degree; expressed mathematically as Re (Ylm(θ, φ))2. Each row shows a particular degree of a spherical harmonic, along with all of its orders. The lighter colouring is where the spherical-harmonic function is positive, and the darker colouring is where the function is negative.

Figure 3.2: Visualisation of the magnitude of the spherical harmonics up to the third degree. Each row shows a particular degree of a spherical harmonic, along with all of the positive orders.

3.2 Rotation Registration 35

Performing the transform requires that a bandwidth, Bt, specify the upper limit of the calculated frequencies, in which Bt is a positive integer. For these frequencies to represent the function defined on the unit sphere, the surface must be sampled (i.e. discretised) in a sufficient manner. Any number of sample points can be used for the transform to the frequency domain, but if an insufficient number of samples are used, then ambiguous aliasing of the harmonics will occur. The sufficient sample count is related to the bandwidth and is dependent upon the chosen SHT algorithm. There are a variety of SHT algorithms, two of which are used in this work; these are the fast SHT by Healy et al. (2003) and least-squares regression, both of which are described below.

The difference in their efficiency is then outlined.

Fast Spherical-Harmonic Transform

The fast SHT is one of the most efficient SHT algorithms, however it is lim-ited to equiangular sampling. This limitation is one aspect that permits the fast SHT to be fast as it allows the integrals defining the spherical-harmonic coefficients to by efficiently evaluated by the weighted sums of the samples. Ad-ditional improvements to efficiency come from the manner in which the base mathematics are implemented, as the Legendre polynomials can be decom-posed into smaller sub-problems and solved recursively. The work by Driscoll and Healy (1994) and subsequently Healy et al. (2003) describe in detail the efficient mathematical derivations of the fast SHT; these derivations are not presented here as they contain many nuances that unnecessarily complicate the algorithm description. Instead, the algorithm is expressed in its discrete form, allowing its key components to be focussed upon.

The initial step is to sample the unit sphere, as it is the value at these sample points that are converted to the frequency domain. The fast SHT sam-ples points on the unit sphere in an equiangular fashion, with their locations being given in spherical coordinates. Sufficient sampling is achieved when 4Bt2 sample points are distributed about the sphere, with the placement of these points specified by

θj = (2j + 1)π

4Bt j = 0, 1, . . . , 2Bt− 1, (3.6) and

φk = kπ

Bt k = 0, 1, . . . , 2Bt− 1. (3.7)

As the sampling has greater density at the poles, the transform needs to

ac-36 Mathematical Preliminaries

commodate this change in sampling distribution. This is achieved by applying Chebychev weights to the transform which are analogous to the sin (θ) factor present in the integral depiction of the transform (Healy et al., 2003). The Chebychev weights are given as

and are only dependent upon the transform bandwidth and the polar angle position as specified by j.

Sampling at the specified locations gives the value attributed to the func-tion defined on the sphere at that point. If the funcfunc-tion f (which can be complex) is given in the spatial domain, its representation in the frequency domain is ˆf , which is the set of spherical-harmonic coefficients. Having now outlined these components, the formula for the transform at each degree l < Bt and order |m| ≤ l is

π/Btis simply a scaling factor, that is unnecessary for the following spherical-harmonic correlation.

Inverting from the frequency domain back to the original form of the func-tion in the spatial domain is unnecessary for identifying the rotafunc-tion which maximises the correlation. It is provided here purely for completeness, and is given as

Least-squares regression is one approach that has been commonly used to transform a set of points sampled on a sphere into the frequency domain (Blais and Soofi, 2006; Brechb¨uhler et al., 1995). While least-squares is a computa-tionally expensive SHT algorithm, it is capable of transforming any distribu-tion of sample points. This is achieved by constructing the matrix B which contains the spherical-harmonic basis functions in the form

Bs,k = Ylms, φs), (3.11)

3.2 Rotation Registration 37

where each row and column is indexed by

s = 0, 1, . . . , n − 1 (3.12)

and

k = l(l + 1) + m, (3.13)

respectively, in which n is the total number of sample points. The value at each sample point is stored in the vector x which is indexed by s. The least-squares equation is then constructed as

c = (B|B)−1B|x. (3.14)

The vector c then contains the spherical-harmonic coefficients. If however, B|B is ill-conditioned or singular, then it cannot be inverted and the least-squares solution cannot be determined.

Least-squares via singular value decomposition (SVD) is able to determine a solution even if it cannot be found by the prior approach. This is achieved by expressing B in its SVD form, given as

B = USV|, (3.15)

when the null space has been removed (making S a square diagonal matrix).

Least-squares is then calculated by rearranging the SVD equation to

c = VS−1U|x. (3.16)

The fast SHT and least-squares produce the same spherical-harmonic coef-ficients when using the same equiangle sample points and corresponding values.

Computational Efficiency

The computational cost of performing the fast SHT is significantly less than the least-squares approach, both in the necessary processing and the required storage. The work presented by Driscoll and Healy (1994) states that the cost of performing fast SHT is dependent upon the specified bandwidth Bt. The computational cost for transforming the sample points to the frequency domain is then O 4Bt2log2(4Bt2). An array of size B2t is then needed to store the spherical-harmonic coefficients.

Computing least-squares by way of SVD requires that the matrix B, which

38 Mathematical Preliminaries

is of size nBt2, be decomposed into U, S and V; if n = 4Bt2 then the size of B is 4Bt4. The combination of U, S and V has the size n2+ nBt2+ Bt4. The total computational cost is difficult to measure due to the SVD, the matrix inversion of S and the two matrix multiplications.

Because there is a significant difference in the computational cost between the fast SHT and least-squares, least-squares is unable to perform at the same bandwidth as the fast SHT for any given computer system. While there are other approaches for calculating least-squares regression, SVD is the most robust. Least-squares is more versatile than the fast SHT as it handles any distribution of sampling points; the benefit of this versatility with respect to registration performance is compared with the fast SHT in Chapter 5.