Primitive Shape Fitting in Point Clouds Using the Bees Algorithm

: In this study the problem of ﬁtting shape primitives to point cloud scenes was tackled as a parameter optimisation procedure, and solved using the popular bees algorithm. Tested on three sets of clean and differently blurred point cloud models, the bees algorithm obtained performances comparable to those obtained using the state-of-the-art random sample consensus (RANSAC) method, and superior to those obtained by an evolutionary algorithm. Shape ﬁtting times were compatible with real-time application. The main advantage of the bees algorithm over standard methods is that it doesn’t rely on ad hoc assumptions about the nature of the point cloud model like RANSAC approximation tolerance.


Introduction
Point clouds (PCs) are widely used in machine vision and robotics to represent 3D scenes and objects sensed through laser scanning devices.Understanding PC models, and extracting concise and meaningful high-level descriptions such as the shape and properties of objects, is necessary for many industrial applications like robotic grasping and pick-and place [1,2].This ability is naturally acquired by humans and animals, but difficult to reliably automate [3], particularly in real-time applications where time and hardware limitations require very efficient procedures.
This paper is concerned with the identification of the shape of objects in 3D PCs for robot manipulation.In many industrial applications, man-made artefacts can be associated with good approximation to a set of geometrical primitive shapes like spheres, boxes, and cylinders.The problem becomes then to fit these primitive shapes to clusters of points in PC models (the primitive fitting problem).Since PCs are composed of a very large number of points, the efficiency of the identification algorithms is of primary importance.At the same time, for the sake of generality, problem-specific assumptions should be limited.
The primitive fitting problem is well known in the literature, and many of the solutions are based on two popular and very successful algorithms: the Hough transform (HT) [4] and random sample consensus (RANSAC) [5].Given a 3D scene, the HT looks for parameterisations of primitive shapes that fit the largest number of data points.To increase the efficiency of the HT, the space of the parameterisations may be quantised, and in that case the granularity of the quantisation becomes an important parameter [6].RANSAC randomly picks from the PC minimal sets of points that are used to parameterise candidate primitive shapes.RANSAC verifies the candidate shapes against the remaining points in the scene, and picks the instance that fits the largest number of points.An approximation tolerance is usually set to decide whether a point is an inlier or outlier to a given shape.The main limitations of the HT and RANSAC are their computational complexity, and the sensitivity of the results to the algorithm parameterisation (the quantisation of parameters in the HT, the approximation tolerance in RANSAC).
The approach proposed in this paper is to tackle primitive fitting as a parameter optimisation problem.Similarly to the HT approach, the goal of the procedure is to manipulate the parameters of a given type of primitive to maximise its fit to the point data.The fit is measured by a primitive-specific fitness function which is used to guide the optimisation process.The bees algorithm (BA) [7] will be used as the parameter optimisation routine, and the results compared with those achieved using an evolutionary algorithm (EA) [8] and RANSAC.
The main advantage of metaheuristics like swarm (bees algorithm) and evolutionary algorithms over standard primitive fitting techniques is the generality of the approach, which does not require prior scene knowledge (e.g., the noise level to set the approximation tolerance in RANSAC).These metaheuristics can be used to fit any kind of shape, as long as its goodness of fit can be defined via a fitness function.Thank to their intelligent sampling of the solution space, swarm and evolutionary algorithms are also computationally reasonably efficient.
Section 2 presents a critical overview of the primitive fitting literature.Section 3 describes the bees algorithm, and the two control algorithms.Section 4 details the experimental method used, whilst Section 5 presents the experimental results.The results are discussed in Section 6, and Section 7 concludes the paper and outlines suggestions for further work.

Literature Review
The HT aims to fit primitive shapes to sets of points in the scene.Primitive fitting is regarded as a search problem in the space of the shape parameters, and sequential search algorithms are typically used to find the instances that include the largest number of points.The HT is widely used in machine vision [9], but is computationally demanding and becomes rapidly inefficient as the number of parameters needed to define the shape increases.As a consequence, the HT has been mainly used to fit elementary shapes such as lines and circles [10].Only a few implementations of the HT transform were proposed for 3D primitive shape recognition, either based on parameter search heuristics [11], or customising the search to detect one particular instance of shape [12].Alternative methods to the HT [13] have been developed to fit geometric primitives to point data, often based on robust statistical estimation of the shape parameters.
The RANSAC algorithm randomly picks from the scene minimal sets of points that uniquely define a given type of geometric primitive.Candidate shapes are tested against all points, and the shape that approximates the largest number of points is extracted.The procedure is then sequentially repeated on the remaining data.RANSAC approaches have shown promising results for 3D scenes in terms of accuracy and efficiency [14,15], and were shown able to fit candidate primitives in environments of 90% noise with little error [15].Advanced subroutines can be applied to pre-emptively terminate bad hypotheses [16].Much effort has been dedicated to optimise RANSAC sampling (OP-RANSAC) and shape evaluation efficiency (R-RANSAC): OP-RANSAC has shown "substantial speedup for highly contaminated sets" with as much as 96% noise [17], whilst R-RANSAC has been shown to run 2-10 times faster than standard RANSAC [18].By combing these optimisation strategies, some forms of RANSAC were able to fit primitive shapes to a field of millions of points in less than one minute [15].
The success of RANSAC greatly depends on the trade-off between accuracy and computational complexity, namely, by the number of candidate shapes evaluated.The results obtained using RANSAC are also sensitive to the setting for the tolerance threshold used to judge whether a data point is an inlier or an outlier to a given candidate shape.Some RANSAC implementations do not utilise tolerance threshold and score candidate shapes based on histogram analysis [19].However, these implementations were usually tested only on PCs of varying levels of background noise (henceforth called noise, Figure 1), instead of the more deceptive case of local error (henceforth called error, Figure 1) which may arise from granularity or low precision of sensors.Some examples of EA methods for primitive fitting have been proposed.Lutton and Martinez [20], Roth and Levine [21] used a population of many possible shapes.Each individual (candidate solution) in the population represents the minimal set of points that uniquely define the primitive, whilst the fitness function counts the number of points inside a fixed boundary around the primitive.Similarly, Gotardo et al. [22] used an EA for tackling a sub-task of the surface extraction problem.In this case the population of candidate solutions is composed uniquely of planes, and each individual represents the minimum set of points (three) needed to define a plane, sampled in a sub-region of the cloud.The optimisation strategy of the above EA approaches is clearly based on the RANSAC procedure, and still needs a careful setting of the approximation tolerance.Ugolotti et al. [23] tested one instance of swarm algorithm [24] and one instance of evolutionary algorithm [25] for object fitting.Each candidate solution encoded the six parameters defining a rigid transformation (rotation+translation) of a template PC shape.The fitness function evaluated the difference between the rotated and translated template and the target shape.The main drawback of this approach is the computational complexity, which required the implementation on Graphics Processing Unit (GPU).

Primitive Fitting Methods
In this paper primitive fitting is tackled as an optimisation problem, and solved using a biologically inspired technique: the bees algorithm.The results obtained using the bees algorithm will be compared to those obtained using a standard RANSAC procedure, and another popular metaheuristics, namely an EA.This section describes the three algorithms in detail.These algorithms will be tasked to recognise instances of three types of shape primitives in PCs: spheres, boxes, and cylinders.
The choice of which shape types to consider was made based on a trade-off between representativeness and conciseness.The shape types used in this study present a good mix of curved and straight surfaces and are known [26] to be an accurate abstraction of many manufactured objects.
The bees algorithm and EA encode a primitive using the same representation scheme, and use the same fitness evaluation function to assess how a candidate solution fits the data points.Therefore, it can be said that they operate in the same fitness landscape.The bees algorithm and EA also share the same local search operator.They differ the kind of metaheuristics they employ, which determines the way the results of the local search (the heuristics) are used.
In the following of the section, the representation scheme, fitness function, and local search heuristics used in the bees algorithm and EA will be presented first.The bees algorithm, the EA, and finally the RANSAC implementation used in this study will be then described.

Representation Scheme
A primitive in a 3D scene is unequivocally described by a finite set of parameters that determine its position (the geometric centre, or centroid, henceforth simply referred to as centre), rotation and other geometrical properties.A solution I is thus naturally encoded as a vector of real values representing the primitive parameters.The size of the vector is shape-specific: Sphere Four parameters: three to locate the centre, and one to represent the radius; Box Ten parameters: three to locate the centre, four to describe the orientation (rotations are described using quaternions), and three parameters to encode the width, depth, and height; Cylinder Nine parameters: three to locate the centre, four to describe the orientation, and two parameters to encode the radius and height; For the sake of clarity, henceforth a distinction will be made between pose parameters which include the position and, when applicable, the orientation, and the size parameters, namely: the radius of the sphere; the width, depth, and height of the box; and the radius and height of the cylinder.

Fitness Function
The term 'fitness function' is adopted from the EA terminology, and is widely used in the wider metaheuristics literature.In the proposed application, the fitness function quantifies the goodness of fit of a primitive shape I to a given point cloud P C = {p 1 , . . ., p N } of N elements.The evaluation criterion for the goodness of fit takes into account two factors: the distance δ(p i , I) between each of the individual points p i ∈ P C and the surface of the primitive I; and the concordance NC(p i , I) of the normals, calculated at each point p i ∈ P C, and its projection π(p i , I) on the closest surface of the primitive: where the normalisation factor δ max is the distance between the centroid and the outmost element of the PC.Given a point p i ∈ P C, the projection π(p i , I) is the closest part of the candidate primitive surface to the point p i .The computation of π(p i , I) is easy for primitive shapes, and it can be computed very efficiently.The calculation of NC(p i , I) necessitates of a method to calculate the normals to the elements of a PC.If the normals are not known, the reader is referred to the literature [27,28] for a suitable extraction method.The function in Equation ( 1) is the same for each type of primitive, whilst the concordance of normals NC(p i , I) and distance δ(p i , I) are type-specific.For a given sphere S, the distance δ(p i , S) between an arbitrary point p i and I = S is computed as: where the function d(A, B) measures the Euclidean distance between points A and B, and S c and S r are respectively the centre and radius of S. For the box and cylinder, δ(p i , I) is computed as the distance between point p i ∈ P C and its projection π(p i , I): The concordance of normals NC(p i , I) is computed using the cosine similarity between the normal N(p i ) to point p i ∈ P C and the normal N(π(p i , I)) of its projection on the candidate primitive surface: where • denotes the dot product between two vectors.Using Equation ( 4), only normals that agree in direction contribute to the calculation of the goodness of fit.
From Equation (1), it is easy to see that is minimum and equal to zero when the shape fits perfectly the data.In this case, the denominator of Equation ( 1) is minimum and equal to 1.The numerator is maximum and equal to 1 when the shape fits perfectly the data, and all the normals agree.Hence, the parameter fitting problem consists of maximising the output of F (I, P C).

Local Search Operator
Mutation in the EA and the local search in the BA are performed using the same shape modification operator.Each of the parameters g I i describing a candidate primitive shape I may be modified in the following way: where is a random sample drawn with uniform probability in the [−δ I , δ I ] range, u i and l i are respectively the upper and lower bound of the i-th parameter, and i = {1, ..., n}.The number n of parameters is equal to four if I is a sphere, ten if it is a box, and nine if it is a cylinder (Section 3.1).Should one parameter g I i be modified to a value outside the [u i , l i ] interval, it will be placed on the closest extreme.
The shape modification procedure works as follows.The first step is to establish which features (centre, orientation, or size) of the shape are to be modified.If the sought primitive is a sphere, all the features (centre and size) are modified with probability p f .If it is a cylinder or a box, only one feature is changed: either the centre, or the orientation, or the size.The probabilities of changing each of the features is given in the left-hand side of Table 1.
Once it has been established which features to change, the second step of the procedure is to determine which parameters (the g I i ) are to be changed.Each parameter g I i is modified with a probability p p .For each parameter, the mutation probability is given in the right-hand side of Table 1.For example, if the centre of a box is to be changed, each of its X, Y, and Z coordinates will be changed with probability p p = 0.7.If a change of orientation is drawn, the four values describing the orientation are all modified with probability p p .Since orientation is expressed in the form of a unit quaternion, the modified quaternion vector is then normalised.Preliminary tests have shown that in many cases the optimisation process tended first to fit some surfaces of the candidate primitive to the PC (e.g., the four lateral faces of a box), and then to adjust the remaining ones (e.g., the top and bottom faces).This often led the algorithm to become stuck in shape configurations (i.e., local fitness optima) that could not be further optimised with one single modification event.For example, a box of width λ that fits a box-shaped PC of width λ + δ perfectly on five faces, is short on the sixth face.One single change of width would very unlikely fit the sixth face to the data, and at the same time would certainly destroy the alignment of the opposite face to the data (if the width modification is applied symmetrically respect to the centre).To avoid this problem the modification procedure keeps one face of the shape fixed.For example, the height of a box or cylinder may be changed keeping the bottom or top face fixed, and modifying the height.
The differences in the way the shape modification procedure is applied to the different shapes reflect the different levels of disruptiveness the procedure has on said shapes.

The Bees Algorithm
The bees algorithm (BA) is a popular intelligent optimisation technique that found wide application in optimisation problems [29].Inspired by the honeybees foraging behaviour, it performs multiple simultaneous local searches at different sites of the solution space.The bees algorithm considers candidate solutions as food sources, and employs artificial bees to evaluate their quality (fitness) and exploit the most promising regions of the search space.
The algorithm begins sending ns artificial scout bees to randomly sampled locations (candidate solutions) in the search space.The scout bees evaluate the quality of the food sources where they landed using Equation (1).Each visited solution becomes the centre of a neighbourhood delimited by a hypercube of side ngh = 2δ I .The algorithm then enters the main loop, which consists of a number of steps.The first step is called waggle dance, in analogy with the waggle dance behaviour of honey bees where foragers are recruited for harvesting the richest food sources.In this step, the neighbourhoods around the fittest nb solutions visited by the scouts are selected for local search.
The second step is where the simultaneous exploitative searches are performed, that is the neighbourhoods are harvested (local search).Namely, nre forager bees are sent to exploit the neighbourhood of the very best ne ≤ nb visited solutions, and nrb ≤ nre foragers are sent to the remaining nb − ne sites.Each forager lands on a food source in the assigned neighbourhood, and evaluates its quality.The landing site of the foragers is determined using the procedure described in Section 3.3.That is, in the local search step the bees algorithm concurrently samples the neighbourhoods around the most promising solutions.The forager that visited the fittest solution within a neighbourhood becomes the new scout, and the centre of the neighbourhood is moved to that solution.
If no forager finds a solution that is fitter than the centre of the neighbourhood, the scout remains unchanged, and the local search is said to stagnate.In this case, the size of the neighbourhood is reduced (neighbourhood shrinking procedure).After stlim consecutive stagnation cycles the neighbourhood is abandoned and the scout is re-initialised at a new randomly picked location in the search space (site abandonment procedure).
Global explorative search (third step) is performed by the remaining ns − nb scouts, which keep on randomly sampling the solution space looking for new promising regions.At the end of one cycle of the main loop, nb scouts mark the neighbourhoods resulting from local search, and ns − nb scouts mark the neighbourhoods found through global search.The algorithm terminates after a given number of iterations returning the best solution found.
For more details on the bees algorithm and its capabilities, the reader is referred to [7,30,31].

Evolutionary Algorithm
Evolutionary algorithms (EAs) are global search techniques modelled on the process of natural selection of species as described by Darwin, and on the laws of inheritance of traits postulated by Mendel and Wilson [32,33].In analogy with biology, in EA terminology the vectors encoding the solutions (Section 3.1) are called chromosomes, and their elements (the parameters) are called genes.
The optimisation process is started randomly initialising a population of p candidate solutions.The algorithm then enters the main loop, which consists of a number of steps.In the first step, the fitness of the population is evaluated using Equation (1).In the second step (selection scheme), the population is ranked in decreasing order of fitness, and sampled with replacement to select p − 1 seeds (parents).Population sampling is done allocating selection probabilities proportionally to the position in the ranking [8].In the third step (mutation), the p − 1 selected parents are used to generate p − 1 offspring using Equation (5).The mutation procedure employs the parameter modification operator described in Section 3.3.The main difference between the EA and the bees algorithm in the use of the parameter modification operator is that the former encodes the neighbourhood size (δ I ) in one extra chromosome, and lets it undergo evolution.The EA thus adapts the scope of the local search using the same evolutionary process used to evolve the solutions.The bees algorithm progressively shrinks δ I via the neighbourhood shrinking procedure.
A new population is formed from the p − 1 offspring and the fittest individual of the current population, according to the generational replacement with elitism procedure [8].
The EA used in this study iterates gen cycles (generations) of evaluation, selection, and mutation.Genetic crossover [8] is not implemented; for this reason, and the fact that the mutation width δ I undergoes evolution, the EA is close to the evolutionary programming approach [8].

RANSAC
As seen in Section 2, a number of RANSAC implementations were proposed in the literature.The main variations over the standard procedure concerned the use of heuristics for faster execution, rather than changes in the search procedure.Often, the precise algorithmic details of these RANSAC variants were not fully reported, and for this reason the standard procedure was implemented in this study [5].RANSAC is an iterative process, where one new candidate shape is created and scored every cycle.Each iteration comprises of three primary subroutines.
The first RANSAC subroutine creates a minimal subset P ms of points, where P ms ⊂ P C = {p 1 , . . ., p N } and ms < N. The subset P ms contains the minimum number of points needed to fully define a candidate shape.Namely, four points are needed to define a sphere, five to define a cylinder and six to define a box (Figure 2).For the sphere, all four points are randomly sampled at once, and resampled if they are coplanar.For the cylinder and box, one point is picked from the PC at a time, and a set of tests are performed to determine if the newly sampled point is on the same or a different shape face to the points already populating P ms (i.e., all normals must be perpendicular or of opposite direction to each other).The newly sampled point is added if it lies on a different face respect to all points in P ms , otherwise is discarded.In the case of the box, the goal of the sampling procedure is to have a point on every face.In the case of the cylinder, the goal is to have three points on the cylindrical outer surface, and one point on each of the end faces.
The second RANSAC subroutine defines a candidate primitive shape from P ms .The parameters required to fully define a shape are similar to those defined in Section 3.1, with the sole difference of the use of Euler's angles (i.e., roll, pitch, yaw) instead of quaternions to define orientation.For spherical primitives, the parameters were found using Schmitt's technique [34].For cylinders and boxes, the orientation of the shape is found using the normals to two of the points in P ms (once the orientation of two perpendicular faces is found, the third dimension can be retrieved from the right-hand rule).After the orientation of the candidate shape is found, the size is determined from the whole set of points in P ms (pairs of points in P ms on opposite faces delimit the boundaries of the candidate shape).Finally, the centre is calculated from the reconstructed shape.
The third and final step is to score the candidate primitive shape.The score is calculated as follows: where N is the number of points in the PC, δ(p i , I) is the shortest distance between p i and the surface of the candidate shape I, and is the approximation tolerance.In the RANSAC implementation used in this paper = 0.3.A perfectly fitting shape scores zero.

Experimental Method
The performance of the bees algorithm, the EA, and RANSAC was evaluated on three data sets, using a purpose-built error function.This function is different from the goodness of fit function used in the individual algorithms, and this guarantees an unbiased evaluation of the results.For each data set, forty independent runs of each algorithm were performed, and the results statistically analysed.The three data sets are available at the following GitHub repository: https://github.com/lucabaronti/BA-Primitive_Fitting_Dataset.

Data Sets Used
Each data set comprised of 591 3D models of 10 3 data points each.Each model represented one primitive shape (sphere, box, or cylinder) of different proportions and orientation.Namely, each data set was composed of: • 181 individual models of spheres.where the radius was varied from 1 to 10 units in steps of 0.05; • 220 individual models of boxes, where the width, height and depth were varied from 1 to 10 units in steps of 1, and took all possible combinations of these levels (full factorial design).
The orientation was randomly determined; • 190 individual models of cylinders, where the radius was varied from 0.5 to 5 units in increments of 0.25, the height from 1 to 10 units in steps of 1, and radius and height took all possible combinations of these levels (full factorial design).The orientation was randomly determined; The centre of the shapes was set at the origin.Each PC was created first forming and rotating the primitive shape, and then uniformly sampling 10 3 data points from its surface.The three data sets differed for the amount of noise (error, see Figure 1) in the sampling of the points.Namely:

•
Clean set: there is no error, the data points lie exactly on the surface of the primitive shape; • Error set: the position of each point was randomly perturbed with uniform probability within a 0.1 unit radius; • Double error: the position of each point was randomly perturbed with uniform probability within a 0.2 unit radius; In the tests, it is assumed that the type of sought shape is known, and the goal is to find the shape size and orientation.That is, each algorithm is run three times on each data set, each time to fit one specific kind of shape.Each time an algorithm is run on one data set, it is shown only the subset of shapes that needs to be fitted: for example, if the algorithm is required to find the size and orientation of cylinders in the clean data set, only the subset of 190 cylinder models will be used.

Error Evaluation Function
The best scoring solution F found by an algorithm in a PC (i.e., the found shape) is compared with the real shape I, namely the reference shape used to generate said PC.
A fair evaluation of the solutions needs to take into account several issues.First, it involves the comparison of parameters of mixed units (angle degrees for orientation, linear units for size and position), and thus standard metrics (e.g., Euclidean distance) would not be appropriate.Second, differences in the centre or orientation have a larger impact on the matching of the two shapes (and hence on robotic manipulation) than a comparable offset in the size parameters.Finally, the data sets include shapes with differences in size up to one order of magnitude, and the evaluation function should be invariant to size.
The error evaluation function considers the match and alignment of the three segments corresponding to the height, width, and depth of the F and I shapes.Each of the three segments is placed along one of the principal axes of symmetry of the shape (Figure 3).In the case of the box, the lengths of the three segments correspond to the three size parameters of the solution, in case of the cylinder the length of one segment corresponds to the height and the other two to the diameter of the circular section, in case of the sphere they are all equal to the diameter.If the principal axes are not unique (e.g., the three axes of the sphere), they are aligned with the Cartesian axes of the reference frame.The error is measured from the overlap between the projection of each segment of F onto the three segments of I.In case of perfect matching and alignment, each segment of F (e.g., the height of a box) will project exactly onto the corresponding segment of I, and on a point (i.e., zero overlapping) onto the other two segments (the width and depth) of I.In case of misalignment or incorrect dimensions of F, the projection of one segment (e.g., the height of a box) will not cover exactly the corresponding segment (the height) of I (Figure 4a), and will be non-zero on the other two segments (the width and depth).4. Projection of the i th segment of F (F i ) onto the j th segment of I (I j ); that is, the intersection of the projections of F i and I j onto the j th Cartesian axis.The green part of the segment marks the match (intersection) of the two projections, the red parts the mismatch.In case of perfect match, the green part will be equal to the length of I j , and there will be no red parts.There are six possible cases of partial or no match between the two axes.
Given a solution F, let us denote as F 1 , F 2 and F 3 its three segments (the width, depth, and height respectively), sorted in decreasing order of length, and as Fi j the projection of the i th segment of F on the j th Cartesian axis, where j = 1 denotes the X axis, j = 2 denotes the Y axis, and j = 3 denotes the Z axis.Likewise, for the three axes of I. Finally, let us denote henceforth as |A| the length of a given segment A.
To simplify the calculations, a rigid transformation is applied to express F and I in a new Cartesian frame that corresponds to the three principal axes of I.Note that now The error Err(F, I) in the alignment and match of F to I is calculated as follows: M(F i , I i ) denotes the matching and alignment of F i with the corresponding segment I i , and is calculated as the length of the intersection Fi i ∩ Îi i (green sub-segment in Figure 4a), minus the sum of the lengths of the non-intersecting parts of Fi i and Îi i (red sub-segments in Figure 4a).
Note that if the found shape F matches perfectly I, ), all the other terms are equal to zero, and M(F i , I E(F i , I k ) denotes the mismatch and misalignment of F i , and is measured as the length of the intersection of its projection with the non-corresponding axes I k of I.That is: Note that if the found shape F corresponds perfectly to I, | Fi k ∩ Îk k | = 0 for all i = k (F i is aligned with I i ), and E(F i , I k ) = 0.In case F i is perpendicular to I i (total mismatch), F i will be aligned with one of the I k and E(F i , I k ) = 1.
Equation ( 9) is equal to zero in case F corresponds to I (M(F i , I i ) = 1 and E(F i , I k ) = 0), is greater than zero otherwise, and is maximum in case of total mismatch (M(F i , I i ) < −1 and E(F i , I k ) = 1).The maximum and minimum operations are meant to penalise the main mismatches in length and alignment, whilst being more forgiving on minor discrepancies.

Parameters Used
The parameterization of the two metaheuristics has been optimised via extensive trial and error, and is shown in Table 2.It is different for each shape type, but the same across the three data sets (noisy, error, double error, Section 4.1).The two metaheuristics have been parameterized so as they sample the same number of solutions in one complete optimisation trial.

Results
The five-number summary [35] of the primitive fitting tests is shown for each algorithm in Table 3 for the clean, error, and double error data sets.The five-number summary is a popular set of robust descriptive statistics that provide the central tendency (median), spread (first and third quartile), and range (minimum and maximum) of the distribution of the results.
In terms of accuracy (median value), the bees algorithm performed particularly well on spheres and boxes, where it obtained errors that were smaller than or comparable to the errors obtained by the EA and RANSAC.On cylinders, although the performances of the bees algorithm and RANSAC were close, the latter obtained the best results.capability of the bees algorithm to solve effectively and efficiently the primitive fitting problem, with performances comparable to or better than the state-of-the-art.The strength of the bees algorithm is that it does not need any assumption to be made on the model.
It should also be noted that in the comparison of Section 5 RANSAC was advantaged by the initialisation subroutine.Candidate shapes were in fact initialised with points sampled from the PC, making sure that these points lied on opposite sides of the shape Figure 2. It is arguable that a similar seeding of the candidate solutions could boost the performance of the bees algorithm and the EA.

Conclusions
In this paper the ability of the bees algorithm to solve the primitive fitting problem was evaluated.The performance of the bees algorithm was tested on the recognition of three kinds of primitive shapes from artificially generated data sets, and compared to the performance of the state-of-the-art RANSAC algorithm and the EA metaheuristics.
The tests showed that the bees algorithm is more precise and consistent than the EA, and performs with comparable accuracy to and consistently as RANSAC.Although not optimised for speed, the efficiency of the bees algorithm was compatible with real-time applications.Like the other two algorithms, the bees algorithms showed considerable robustness to error in the PC models.This result indicates the suitability of the bees algorithm to handle data from noisy and imprecise sensors.
The main advantage of the bees algorithm over techniques like RANSAC is that it doesn't need ad hoc assumptions to be made on the models.In particular, RANSAC is sensitive to the choice of the error tolerance threshold, which usually requires careful optimisation for top performance.RANSAC needs also a seeding procedure to generate the candidate shape, which is then scored on its fit to the rest of the PC model.In its present implementation, the bees algorithm does not need any seeding of the candidate solutions.
The tests performed in this work featured only PCs representing single objects.Further tests will be carried out to investigate the ability of the bees algorithm to recognise multiple and possibly different shapes in a scene.One possible scheme would be to carry out parallel searches for different shapes, for example one kind of shape for each neighbourhood.At the end, the best fitting shapes for each region of the scene would be retained.The performance of the bees algorithm on partial shapes needs also to be evaluated, in order to assess its suitability to cluttered environments.
Finally, the current implementation of the bees algorithm is also extendable to other kinds of shapes, as long as a measure of the distance of the points from the candidate shape can be expressed, and the concordance of the normals can be evaluated.Further work should include validation of the proposed algorithm on more shapes and less geometrically regular objects.

Figure 1 .
Figure 1.(Left) clean point cloud, no noise or error.(Middle) point cloud with error, no noise.(Right) point cloud with noise, no error.

Figure 2 .
Figure 2. Four non coplanar points are used to define a sphere (see left).Five points are used to define a cylinder, with one on each end face and three on the outer cylindrical surface (see top right).Six points are used to define a box, one point for each side (see bottom right).Note that the cylinder and box require estimated surface normals to the PC to validate the minimal set of points.

Figure 3 .
Figure 3.The found shape F is compared to the real shape I projecting its height, depth, and width onto the height, depth, and width of the real shape.

Table 1 .
Shape modification probabilities.Probabilities marked with an asterisk are mutually exclusive (e.g., either the centre, or the orientation, or the size of a cylinder is changed).

Table 2 .
Parameterization of the bees algorithm and avolutionary algorithm.