A point cloud decomposition by the 3D level scanning for planes detection

A point cloud represents a set of measurement points. Usually it is a group of points in a defined coordinate space without any information how individual points relates to each other. For a simple shapes and objects description additional methods are needed. In this paper we would like to present a new 3D point cloud scanning method for planes detection. Our developed algorithm includes several image processing methods like the connected component labeling and the shape borders detection which allows computing important plane properties end even detect object shapes. The scanning algorithm is described on a testing example and verified on real measured data. The paper concludes by algorithm properties summarization and recommendations where this method can be used


Introduction
* During a 3D range scanning process is created a resulting 3D point cloud. If measurement data are not additionally processed, the measurement result is a simple set of individual points with coordinates in a defined coordinate system. Points covering objects in a surrounding space to describe objects and shapes present in scene, additional detection methods are need to classify individual points into groups with common parameters.
Well-known algorithm for a plane and object detection is the RANSAC. This algorithm finds in several iterations all points which belongs to the searched model. There are many variants and modification (Kurban et al., 2015;Fujiwara et al., 2013;Cupec et al., 2009;Schnabel et al., 2007). For example, Kurban et al. (2015) shows the algorithm ability on data measured by the Microsoft Kinect with combination of Point Cloud Library functions. Cupec et al. (2009) showed an implementation on stereo vision images. An implementation by Schnabel et al. (2007) can detect different shapes like planes, spheres, cylinders and cones. Planes can be detected by different techniques like Hough transform, which presenting (Borrmann et al., 2011). A next approach showed (Deschaud and Goulette, 2010), their algorithm uses filtered normals and voxel growing and it is able to detect planed in large and noisy point clouds. Interesting methods evaluation offers (Palnick, 2014), where they comparing different methods to select the best and fast plane detection processes combination for an implementation on a robot.
In this paper we want to use a different method which uses the 3D level scanning. Planes are detected on the base of statistical data representation and its area size. Our method includes using of several image processing algorithms to improve plane detection and get important object's properties for a future processing and classification.
The rest of the paper is organized as follows. Section 2 describes individual 3D level scanning algorithm steps. Section 3 shows algorithm results and practical using of proposed methods, which follows the conclusion in Section 4.

Scanning algorithm
This section describes a 3D level scanning algorithm. At the algorithm start it is useful to have some initial characteristic about the input point cloud. Its knowledge can help to set appropriate scanning conditions for achieving the best result. The algorithm uses two main parameters; the level step lvlS and the level range step lvlRS.
Both represents statistical plane properties, which algorithm detects and set the selection level range. These parameters meaning is described in next sections. The input point cloud is organized as row vectors with three dimension columns X, Y and Z. Individual algorithm steps are described on the following 3D point cloud, see Fig. 1. This example is not a real measurement, but for better illustration we set the distance units to the centimeters.
Each point from this point cloud is represented as a vector in the Cartesian coordinate space R 3 . Coordinates of a single point p are defined as (Eq. 1) where pX, pY and pZ are coordinates in appropriate axis. For points rotations and transformations, the rotation matrixes in the 3D space (2), (3) and (4) are needed, described in paper (Beran et al., 2015). (2) (3) symbols α, β and γ are rotation angles in corresponding axes X, Y and Z.

Scanning dimension and range selection
The first step is selection of an appropriate scanning dimension. The choice of X, Y or Z dimension is arbitrary, because there is an influence only on the scanning direction. Usually appropriate dimension is selected according scanning purpose. From the testing point cloud data nature it is selected the dimension Z in our example.
The scanning range is a distance range, where individual levels are analyzed. Typically, the range PCrng (5) from the input point cloud is estimated as maximum PCrngH and minimum PCrngL point's position in the appropriate dimension.
The selection of different range depends on level decomposition purpose and a what result is expected from a scanning.

Level step estimation
The scanning process starts by the first detection range selection. The value PCrngL is selected as a low detection range DRL. The high range DRH is calculated as This selection (6) ensures the suitable range for the first level estimation. The parameter step level lvlS characterizes the acceptable amount of noise or points standard deviation; acceptable as a plane. The parameter step level range lvlRS is used as a range, where the level is estimated. The minimal value of lvlSR should be at least 1 and recommended is about 3.
The symbol colon in the Eq. 7 means all points in appropriate dimension. The number 3 is the Z dimension.
You can noticed, that the red level in Fig. 2 is closer to the low border DRL. The way how level estimation borders DR are set according (6) and (8) during the algorithm processing and proper lvlS, lvlRS parameter settings for a plane detection with desired standard deviation ensures the right detection level estimation dL in the highest data concentration in an appropriate scanning dimension. Firstly the detection range DR is selected by using both parameters lvlS and lvlRS, than the mean data value dL is estimated in scanning dimension. Finally point cloud data are extracted by using estimated mean value dL and the level step lvlS parameter (7). The higher range value for the next step is selected again according (6). The algorithm ends, when the scanning level dL reach to the higher range limit PCrngH.

Data statistic properties and level image
The main algorithm substance is already mentioned, but this section moves closer to the statistical data representation and point cloud data connection with image processing methods, to achieve more useful information.
When a level dL is estimated by Eq. 7 during one algorithm step, other statistical data are calculated for all dimensions; µ -mean value;  2 -variance; standard deviation and x -data mode. These statistical data can help with choosing desired planes with specific properties.
Very useful feature is the image construction from a plane. Once the image is created there is information about a plane area and plane borders. Area estimation only from points in point cloud is difficult task. For image construction it is necessary the quantization parameter qD. Choosing the wrong parameter leads to incorrect results. The parameter qD allows getting information about one-pixel physical size in a point cloud image.
Point cloud data positions are quantized into a plane image. When the dimension Z is used in this example, dimension X a Y determine positions on a plane image. The pixel's intensity in appropriate positions are set as the true. The left top plane image corner physical coordinates Iphys (x, y) are also retain for the future using.
The next illustration, in Fig. 3, shows the image example created from "bottom" level of the input data point cloud. If the parameter qD has small value or the point's density is lower, there can be some undesired pixel holes in a compact image. For this purpose, it is recommended to use morphological operations like image close to fill undesired gaps and image open to suppress small outlying points.
A resulting image plane can consist of several areas, see Fig. 4. This can happen when two independent planes are at the same level or there are some perpendicular planes or planes with a different rake angle. This situation is solved by the using connected component labeling with eight connections, to cover all connected pixels. In this case for all connected components are recalculated statistical data. Fig. 5 illustrates different statistics data for individual components.
where x, y are pixel coordinates in a plane image and variables marked by phys are physical dimensions. Desired points are extracted from a component physical range. All statistical properties; the area size and position can be used for planes classification.

Planes decomposition
Previous sections describing one level scan through a selected dimension. For all planes  =0.9  = 3.17  =0.83 segmentation it is necessary to rotate input point cloud according the next illustration.
Rotation angles in the horizontal plane and in the vertical plane are marked in Fig. 6. The horizontal rotation is 360 degrees always and for the vertical plane the angle of 180 degrees is sufficient, because this rotation covers all planes in space without a needles plane repeating in the second half of the rotation sphere.
If there is found a bigger area for a point during the scanning process, this point is labeled, that belongs to the bigger plane area.
To provide these rotations in the same way how it is depicted in Fig. 6 the two rotations are needed. The first rotation is in scanning dimension (horizontal rotation h) Rh and the second is around one of two left dimensions (vertical rotation v) Rv. The second rotation is various in dimensions, because the 360 degrees rotation is used in scanning dimension and only the algorithm direction is changed.
We can combine rotation matrixes by the multiplication and create the final rotation matrix (11) like using (Dunn and Parberry, 2015). The matrix combination order depends on the real rotations order. Rotation matrixes are square, which makes possible to combine them in any order.
Our example uses the Z scanning dimension, the rotation matrix around Z axis (4) is used and as the vertical, the rotation around Y axis (3) is selected. In the next section are evaluated results and shown some practical examples.

Results evaluation and examples of using
The decomposition result of the input point cloud, which illustrating individual algorithm steps is shown in Fig. 7.
The 9 planes are decomposed from approximately 12 500 input points. The area and the rotation angle characterize each detected plane. All planes data are summarized in the Table 1, where the selected important statistical data denoted Section 2.3 is included too.  Fig. 7 takes about 65 000 scanning level step which is significantly time consuming. The one level scan processing time can be significantly decreased by using suitable hardware resources or using effective and image processing libraries. Time crucial parts are morphological operations.
From this drawback it is taken the advantage that the algorithm is well parametrized. Sometimes can be useful to detect only planes in specific orientations and conditions. Usually can be required to get planes only in a specific dimension and if the decomposing point cloud is well oriented only three algorithm steps are needed.  Fig. 7. The first column are plane numbers from Fig. 7; the second column is plane areas; the column marked by R shows vertical v and horizontal h rotations, where individual planes were detected; the next column contains physical origin of plane images; the following column is estimated detection level dL and .

7
. 4 360° 180° the last include a mean values of points, which belongs to individual planes. According rotation angles from the Table 1. it is obvious, that five planes were found during the first 3D level scan. Negative values in the table are caused by angle rotations. Standard deviation for the Z dimension in the last column shows the proof of concept; all detected planes have this value lower than used parameter lvlS. For a plane reconstruction as in Fig. 7, the rotation angles R(v,h) are needed and the original plane point cloud. Data from this point cloud are rotated in R(v,h); then the plane image is created. Extracted plane borders from a plane image with using inverse form of matrix (11) are used for a plane visualization as illustrates Fig. 7. Rotation matrixes are orthogonal and an inverse matrix can be done by a simple matrix transposition.
One important plane property is its area and this can be used for example in exploring space in front of the scanning device. Fig. 8 shows the range view in front of the autonomous scanning system introduced in (Chmelar and Dobrovolny, 2013). This range view was used in our previous work, where we introduced the depth map construction from a 3D point cloud (Chmelar et al., 2016).
From this view we need for example information about doors area and wall area. The rangefinder view is oriented in X direction. Only one 3D level step is required to get this information. The point cloud area which covers the wall, see Fig. 9, is 9.16 m 2 and the door's area in Fig. 10 is 4.08 m 2 . By this information we can easily analyzed the point cloud properties and an object dimension present in a scene.
For illustration the parameters lvlS = 2, lvlRS = 3 and qD = 2 were used in this example. New algorithm possibilities are wide and it can be used in different situation. For the planes and objects detection can be used other effective and fast detection methods, which used the mathematic models for its detection, which were introduced in Section 1. The main paper contribution is the object point cloud connection with the well-known image processing methods to get important object properties.

Conclusion
The paper describes the point cloud decomposition algorithm by using the 3D level scanning. The planes detection is its primary goal. The advanced statistical plane properties are available for all individual planes. Results evaluation shows its detection capability, advantages and few disadvantages. The main disadvantage can be time processing of unorganized point cloud, especially its orientation, in case of all presented planes detection. This lack it is possible to compensate by using suitable image processing libraries or by appropriate hardware resources. Usually the detection is done only in desired angles and if the point cloud orientation is known the whole scanning process is simplified.
The algorithm connects point cloud data with often used image processing methods. This offers to easily observe very important object properties, which can be used for future processing. For detection individual objects or shapes can be used sophisticated mathematical methods and once an object points are extracted, the described image processing methods in this paper enables getting important object properties. Even if a 3D volumetric object like spheres, humans and others are present, we can suppress depth information and follows object shapes, which are useful features for object recognition in many image processing areas. Our future research will be focused in this area.