• No results found

The RanSaC paradigm (Fischler & Bolles, 1981) has been proposed as a method for fitting geometric models to data, and for outlier rejection in noisy data. In the case of point clouds, it is used to determine whether points can be fitted to a number of parametric shapes. Shape parameters are extracted via random sampling of minimal sets from the input data, where a minimal set contains the smallest number of points required to uniquely define a given type of geometric shape. For instance, in the case of a plane primitive, the minimal set consists of three points. Figure 2.16 shows a set of points on a 2D surface fitted to two types of geometric shapes, namely line and circle. Points which do not fit within the set of extracted shapes are usually discarded as outliers on the assumption that these represent noise within the data set. An error threshold, represented by dotted lines on the right-hand side of Figure 2.16 represents the maximum distance from the specified shape surface.

Algorithm 4 outlines the basic RanSaC process. When applied to point clouds, the input consists of a point cloud P, a set of shape types to fit (e.g.

S={circle, line} for Figure 2.16), an error threshold ε representing the maxi- mum distance of a compatible point to the shape being checked, a trials countc

Figure 2.16: Unstructured points partitioned into two lines and one circle. Note that on the intersection between line and circle points can go to either of the shapes depending on the shape fitting order. Outliers (white dots in central figure) are removed.

Algorithm 4High-level description of General RanSaC

1: InputPoint cloudP, set of Shape TypesS, Toleranceε, Trialsc, Acceptance

r.

2: Output Set partition {Q}of {P}. 3: while f itmoreshapes do 4: bestscore = 0 5: bestshape =<∅, null > 6: for each s ∈ Sdo 7: trialscount= c 8: while (trialscount > 0)do 9: crtshapeminset = {p1..n:P|p1 6=p2 6=. . .6=pn} 10: for each p ∈ P do

11: if compatibles(p, crtshapeminset, ε)then

12: inc(crtscore)

13: end if

14: end for

15: if (crtscore > bestscore) then

16: bestscore = crtscore

17: bestshape =< crtshapeminset, s >

18: end if

19: trialscount-=1; 20: end while

21: end for

22: pointsbestshape = {p:P|compatibles(p, bestshape, ε)}

23: if |pointsbestshape| >(|P| ∗r) then

24: P = P \pointsbestshape

25: Q= QS

{pointsbestshape}

26: end if

27: Determine whether f itmoreshapes should be set to false 28: end while

Figure 2.17: Randomness in the choice of support samples may lead to set partitions which are different from each other and still valid. In general, shape primitive fitting in the RanSaC paradigm is non-deterministic.

representing the number of a trials carried out per shape type and a minimum number of points ratio r with respect to the size of P, required to accept the shape. The algorithm iteratively extracts shape primitives by randomly choosing minimal sets from P (line 9) for the number of trials c specified. Within each iteration (lines 8-20) all points in P are checked for compatibility with the shape primitive described by crtshapeminset (line 11). This process is carried out for all

shape types (lines 6-21) and the best shape parameters which fit the data (points in P) are selected (line 17). The metric which is traditionally used, is the total number of points which fit within the shape parameters. The points compati- ble with the shape chosen are removed from P (line 23) and the set with the compatible points included in the set partition Q (line 24). The function which computes shape compatibility of points can vary, but usually takes in consider- ation the position and surface normal of points. The predicate f itmoreshapes

is used to establish whether to keep on fitting shapes. This predicate takes in consideration a number of parameters, such as the updated cardinality of P. If this is sufficiently low than f itmoreshapes is set to false. Alternatively, this predicate can be set to false if during the previous iteration no shape is fitted to

P. In all cases, the outcome of the algorithm is a set partitionQwhich describes a mapping between points in P and |Q|shapes.

The set partition output by RanSaC is in general non-deterministic given than minimal sets are chosen randomly from the input data. Figure 2.17 illustrates a typical scenario where the same input is partitioned into three different and valid set partitions by fitting line primitives to the data. This might pose a limitation in terms of stability in that results obtained might not be replicable. Notwithstanding, RanSaC also has many desirable properties. It is conceptually easy to understand, is very general thus allowing its application in many domains

and most important can deal with data containing more than 50% outliers (Roth & Levine, 1993). Without optimisations, as outlined in Algorithm 4, its major drawback is the high computational demand. The complexity of RanSaC stems from two factors; the number of minimal sets that are randomly drawn (trials) and the cost of evaluating the score for every candidate shape. In both cases, execution time depends on the size of P. A number of improvements over the standard RanSaC algorithm exist which addresses efficiency. These are further discussed in Chapter 3, which discusses how RanSac has been used in the context of point cloud segmentation.