• No results found

Acceleration Structures for Storing Point Clouds

This section briefly describes data structures used to store point clouds. Given the size of point clouds produced by scanners, it is important to use data structures which scale efficiently with the size of the data. Naively, a set of points can be stored as a array, however this does not facilitate operations such as locating nearby points. In this work, both grid-based and tree-based data structures are used, which are briefly outlined next.

Y

X Y

X

Figure 2.15: A set of points is partitioned using a uniform grid (12 cells) and a kd-tree with k=2 using median split to decide the parameters of the partitioning plane (8 cells).

2.4.1

Uniform Grid

Grid-based structures employ spatial hashing to organise points in a 3D grid. Figure 2.15 illustrates a set of points (left-hand side) partitioned using spatial information in a uniform grid (middle). Although very efficient to compute, a uniform grid does not adapt to the distribution of points. In this case, some cells have 1 point in them whereas others have four. If taken to the extreme, a uniform grid might degenerate to a simple list if all the points end up in a single cell. Cell size plays an important factor in the efficiency of the data structure.

2.4.2

Kd-tree

The kd-tree (Friedman et al., 1977) is an acceleration structure that recursively subdivides space in two using an axis-aligned plane. There are various heuristics to determine both the splitting axis and the position of the partitioning plane. The initial axis can be chosen randomly or according to the most variance among the points. A median-split operation can be used to determine the position of the partitioning plane. The resultant spaces are then recursively partitioned. During each split, the points are added to the half-space in which they are contained. The recursion is terminated when the number of points in a leaf does not exceed a minimum amount specified or the depth of the tree has reached a predetermined value. The asymptotic time complexity for searching nearest points in a kd-tree is O(nlogn) (see Algorithm 1). Figure 2.15 (right), gives an example of a 2D kd-tree, showing a set of points partitioned using the acceleration structure.

2.5

Local operations on points

This section details a number of operation of points which are generally used when processing point clouds.

2.5.1

Neighbourhood

The neighbourhood of a point pis defined using set comprehension as follows:

Definition The neighbourhood of point p ∈ P, within a distance r is the set

Nr(p) ={q:P|distance(p, q)< r•q}.

Given this subset of points from P, it is usually useful to limit the number of points and thus produce the k-neighbourhood (k-NN) of p. This is usually done by sorting points in Nr(p) from closest to furtherest to p. If the size of Nr(p) is

less than k, this is increased by iteratively incrementing the distance r from p

until |Nr(p)| ≥ k. Acceleration structures, such as the kd-tree described above,

are used to speed up the computation of the k-NN. Various implementations, based on Algorithm 1, exist which provide this functionality.

2.5.2

Principal Component Analysis

Principal component analysis (PCA) is used to measure data in terms of its prin- cipal components, representing the directions along which there is most variance, the directions where the data is most spread out. In the case of point clouds, PCA is normally applied to a subset of points, generally obtained using a k-NN process, to determine local properties at a specific point. The process computes three orthonormal eigenvectors and corresponding eigenvalues. The eigenvec- tor with the highest eigenvalue represents the principal component, whereas the second and third successively represent lower variance.

2.5.3

Volumes

A number of convex polyhedra can be used to bound the space occupied by a set of points. These bounding volumes are then used to group together points, accelerate general operations by discarding the whole set of points when the operation does not interest the volume, and point decimation and interpolation, amongst others.

Algorithm 1High-level description of k-NN computation using kd-tree 1: Input Point cloud {P}, p∈P,k, distance d.

2: Output Ordered List Q with maximum size k. 3: o = ∅ 4: r = d/2 5: nodeStack =∅ 6: nodeStack.push(root) 7: while nodeStack 6=∅ do 8: node = nodeStack.pop() 9: if node.isLeaf then

10: for eachq ∈node.points do

11: if distance(p, q)≤r then

12: o =o∪q

13: end if

14: end for

15: else

16: if overlap(node.axis, p.P osition[node.axis],−r, node.lef t)then

17: nodeStack.push(node.lef t) 18: end if

19: if overlap(node.axis, p.P osition[node.axis], r, node.right) then

20: nodeStack.push(node.right) 21: end if 22: end if 23: end while 24: sort(o) 25: Q={o1...ok}

AABB

Axis-aligned bounding boxes (AABB) are quadrilaterally-faced hexahedra with the edges parallel to the major coordinate axes. AABBs have a very compact representation in that only two points are required to define the extents of the box. During construction, the extents are determined from the extrema for each coordinate axis, such that:

[minx, miny, minz] = [min(P1x, . . . , P

x n),min(P y 1, . . . , P y n),min(P z 1, . . . , P z n)]

[maxx, maxy, maxz] = [max(P1x, . . . , P

x n),max(P y 1, . . . , P y n),max(P z 1, . . . , P z n)],

where n is the number of points in the set.

OBB

Oriented bounding boxes (OBB) are similar to AABBs but in general provide a tighter fit to the bounded data set due to relaxed constraints on axial-alignment. OBBs are constructed by finding the principal components of a point set using PCA. OBBs can still be represented using the extents, however, an orthonormal basis is also required to describe the orientation of the volume.