1. Introduction
A variety of studies have been conducted in the computer vision field to recognize objects in 3D space. For example, researchers have studied depth information through a camera (stereo matching) or an infrared camera that imitates an eye as well as object recognition and movement by measuring depth through a laser scanner. Among them, measurement using a space scanner is relatively more precise than measurement using a camera; thus, it is widely used to construct point clouds. The 3D scanner emits an infrared laser into space and calculates the distance by measuring the time it takes for the object to be reflected back. The light has several characteristics in a specific time and space. Among these, maintaining straightness and consistent velocity enables a relatively accurate distance measurement. Point clouds obtained from 3D scanners are generally sufficient for human perception but are not recognized by computers. Therefore, the computer is subjected to various preprocessing steps, such as normal estimation, segmentation, and filtering, to recognize objects in the point cloud (shown in
Figure 1).
The normal estimate is obtained by constructing a covariance matrix from the surrounding points using the k-d tree data structure and calculating the eigenvectors. When the normal estimation is completed, it is divided into a set of points with a common normal that meet certain criteria. The divided sets undergo postprocessing to determine what kind of object each set is.
In recent years, plant construction has been based on 3D design, so it is easy to check the structure interference or make modifications/changes, and it is possible to efficiently design and to train in areas such as fire, disaster, and operation using virtual technology. On the other hand, it is more efficient to maintain/repair through reverse design because the existing plant site is huge, and reconstruction is impossible. Reverse design is aimed at obtaining meaningful data through digitization in three dimensions for constructed facilities or facilities under construction. Therefore, the demand for reverse design is increasing.
This paper describes a method for quickly recognizing cylinder-shaped objects that take up a large portion of plant facilities. A plant facility of large scale entails a large opportunity cost for 3D scanning and consists of a very large set of points. Therefore, since matching requires a lot of computer resources (CPU, memory, db, power usage), time, and manpower, relatively fast and accurate matching is the only way to reduce costs. In general, cylinder-shaped objects are matched using region growing, Hough transform, random sample consensus (RANSAC), and machine learning.
Region growing is a process for segmentation and is classified into a set of normals that maintain similar directionality in a point cloud. Hough transform is a method of estimating the direction of a cylinder ultimately by replacing the normal formed by segmented data with a Hough space [
2]. Both of these methods result in an exponential increase in processing time and memory usage as the numbers of data points increase. On the other hand, primitive fitting using RANSAC is relatively fast, but gives inaccurate results due to noise and curved areas. To overcome this drawback, this paper uses RANSAC, estimates the direction of the cylinder through sphere fitting, and computes the cylinder length through principal component analysis (PCA). The proposed method is robust against noise and shows fast matching results while maintaining relative accuracy.
Because the plant is large (the Ulsan Petrochemical Complex site in Korea has 29,916,000 square meters), it takes a significant amount of opportunity cost to handle reverse engineering manually. In addition, since many computer resources are used for reverse design, appropriate filtering and data structure must be used so that it can be processed without overflow. Therefore, complete automation is virtually impossible. This paper is meaningful in terms of reducing the opportunity cost of manual operation rather than perfecting automation and operating computer resources efficiently.
2. Related Research
In general, to estimate an object, a mathematical primitive (parametric shape) is used and accessed through RANSAC [
3], Hough transform, or a machine learning algorithm.
Abusaina estimated spherical structures using Hough transform. In order to speed up the computation, the authors proposed a method to increase speed and maintain accuracy by partially performing the calculation without searching the entire point cloud [
4]. Zhang estimated the roof through RANSAC. The authors proposed a multi model fitting method by applying Bayes’ rule and a PCA algorithm to extend plane fit [
5]. Garcia proposed a mathematical definition of various basic shapes to be applied to RANSAC and a primitive shape decomposition algorithm for estimating objects containing basic shapes in order to apply basic shape fitting to robot grasping [
6]. Su used Hough transform to estimate cylinder shape. Cylinder estimation requires a 5D Hough transform, which is computationally inefficient and generally computed separately in 2D and 3D. The authors proposed a multiple cylinder detection method using a coarse-to-fine approach and a clustering algorithm [
7]. Jones proposed a method of evaluating 3D point cloud histograms through support vector machine (SVM), which is the most similar to the model in the database [
8]. Liu first extracted and removed the data vertically and horizontally from the ground, called T1 and T2. After that, Hough transform was used to project a plane on the normal vector and propose a cylinder shape estimation method through circle fitting [
9,
10,
11]. Son determined the central axis of the pipe by the skeleton extraction algorithm through Laplacian smoothing and estimated the curved region and the T shape of the cylinder by dividing [
12]. Huang classified meaningful data through fast point feature histogram (FPFH) and SVM and segmented it with the classical flood-fill algorithm. Matching was completed through RANSAC in the segmented data. However, the proposed method found only relatively complex shapes such as ball valves and flanges, because those have unique feature points. In other words, a unique feature point is needed for histogram comparisons [
13]. Pang extracted primitive models using FPFH in point clouds and recognized objects through Adaboost with library models. The recognition object is merged/adjusted based on directionality and start/end position, and the automatic modeling is completed. However, it takes more than 30 minutes for 10 million pieces of data [
14]. Rongqi computed one plane of normals on the Gaussian sphere after normal estimation through RANSAC. Projection of segmented points on the plane estimates the radius and length of the cylinder. If there is an intersection point with another cylinder through the estimated starting and ending points of the cylinder, it is judged as an elbow. Experimental results show relatively accurate results, but it required a lot of execution time [
15].
In the existing study, SVM and the method using RANSAC could extract the cylinder shape, but the center axis and the radius could not be confirmed. To solve this problem, the Hough transform was used. The Hough transform is excellent in terms of accuracy but requires a large amount of computation and a segmentation process. In addition, it has the disadvantage of requiring a lot of resources compared with RANSAC. Partitioning is a method of gradually searching for neighboring points and sorting out a group that meets certain criteria. As the point cloud grows, the execution time increases. Therefore, in a point cloud with a large number of points, object estimation requires a relatively large opportunity cost. In order to overcome these disadvantages, constraints are used to filter the data through vertical/horizontal conditions with the ground. Therefore, data filtering using constraints is inevitable in matching pipes with oblique lines.
In this paper, a linear axis/curved region estimation method of constructing a central axis candidate group by fitting RANSAC without constraint, normal estimation, and segmentation is proposed.
The paper is organized as follows:
Section 3 discusses spherical and straight line modeling and RANSAC fitting for a central axis estimation.
Section 4 applies PCA and Catmull–Rom splines for curve estimation.
Section 5 proves the proposed method and
Section 6 offers conclusions.
5. Experiments and Discussions
Verification of the proposed method proceeded through segmented and nonsegmented data. The system used in the experiment has Intel 8250U 3.4 G CPU, 8 G memory, and uses Unity3D. The experiment used the following pseudo-code (shown in
Scheme 1):
Code a is the center axis estimation, where DCL is the matching result, DFLT is the filtered matching result, and is the PCA result. Code b constructs the cylinder candidate group (DEST) when the distance and angle are within a certain range in and finally obtains the cylinder (DCYL). Code c finds the intersection point (DCP) of the surrounding tangents when is a curve and completes the spline (DSPL) through the discriminant.
Figure 11a shows segmented data consisting of 20,107 points. From left to right, the process is: place point clouds in order, map the curved region to the center axis estimation result, map the straight and curved regions. The figure shows results that include most of the curved regions that exist.
Figure 11b is 433,847 points in the segmented point cloud. From left to right, the point clouds, center axis estimation result, curved area mapping, and linear and curved areas are mapped (
Figure 11a).
Figure 11 shows how the proposed method is applied in the segmented point cloud. Since the subject of this paper is to estimate the cylinder shape without normal estimation and segmentation, we verify the proposed method in point clouds where various types of nonsegmentation (railing, footing, valves, noise, etc.) exist.
Figure 12a shows 103,498 points,
Figure 12b shows 2,181,234 points, and
Figure 11b shows the figure before segmentation. In
Figure 12a, 6687 central axis estimation points and 1269 ms execution time were used for the central axis estimation, and 25 straight regions and 13 curved regions were estimated only for 1567 ms execution time. Both appear appropriate in terms of location. In strict criteria, there are 21 curved regions in
Figure 12a.
Figure 12b constitutes the central axis points with execution times of 18,915 ms and 71,481, respectively, and an estimated 157/129 straight/curved regions. The execution time was 11,100 ms. In practice, there are about 200 pipes and about 200 bent areas. The estimated number of curved regions is relatively different because it is estimated that there is only one curved region (S-shape) leading from a 90° shape to a 90° shape again.
Figure 12c constitutes 52,385 central axis points with 1,984,708 data points, and it took 19,748 ms execution time. In total, 128 straight sections and 56 bent sections were found and the time required was 6075 ms. Compared to the other data, there was relatively more noise and many broken areas. Unfortunately, even though the chimney of the building was in the form of a cylinder, it could not be estimated. It is interpreted that the larger the diameter of the cylinder, the more the certain area is close to the plane, and a larger cylinder should search for more neighbors. The fitting ratios are shown in
Table 1.
The reason why the linear ratio of
Figure 12b in
Table 1 is high is because one pipe is estimated to be a plurality of truncated pipes.
Table 1 shows similar results even though there are differences in the size and density of data between
Figure 12a and b. There are many cases where the pipe of the plant is constructed vertically/horizontally on the ground, but there are also cases where it is installed in a diagonal line, which means that additional calculation is necessary when constraints exist [
9]. In addition, the bend area is calculated by finding the intersection point by extending the length from the result of finding the straight pipe and the 90° or T-shaped area. On the other hand, the proposed method can find not only vertical and horizontal regions, but also oblique regions, and S-shaped region estimation is also possible. The execution time is equal to
O(
n(
P)
n(
L)
n(
E)
c), where
n(
P) is the total number of data points,
is the sphere fitting search increment,
n(
L) is the number of linear candidates/estimators,
n(
E) is the number of curved region candidates/estimators, and c is the evaluation cost. Eventually the appropriate
value needs to be set in order to reduce execution time. In other words, the number of central axis data points determined by
affects the amount of computation of
n(
L),
n(
E), and c. Therefore, the proper setting of
has a great influence on overall performance.
In order to verify its efficiency, the proposed method using the data in
Figure 12b compares/verifies the Hough transform method [
10].
Figure 13 shows the left side of
Figure 12b.
Figure 13a shows the pipe estimation through the Hough transform [
10], and
Figure 13b shows no significant difference in the pipe estimation results by the proposed method.
Figure 13a shows an execution time of 591 s.
Figure 13b shows that step 1 took 16 s and step 2 took 10 s. Therefore, it was 591/(16 + 10) = 22.73 times faster to estimate the pipe. A total of 89 left (C
E) pipes exist in the left data, and the proposed method estimated 130 straight lines (C
D) and 90 curves (C
C). This seems to be better than the comparison of 60 C
D. However, since the comparison object is estimated to have detected only the area of the top image of
Figure 13a, the result of linear/curve estimation of the right area added in the top image of
Figure 13b should be removed. The added right-hand region has about 50 straight lines and 15 curved lines. As a result, a straight line/curve of 80 (C
D) and 75 (C
C) was estimated. Here, the error is 10 (C
F). This is a result of estimating a strict standard (constant length/position/angle). C
D/C
E is 0.9 and C
T/C
D is 0.88, which is somewhat greater than the 0.67 and 0.87 of the comparison subjects.
Figure 14 shows the right side of
Figure 12b.
Figure 14a shows that the execution time was 637 s. On the other hand, the proposed method took 19.5 s in step 1 and 17.5 s in step 2. The time required to estimate the pipe was 637/(17.5 + 19.5) = 17.21 times faster. The estimated straight line is 155, and the curve is 86. The number of pipes in the comparative thesis is 107 (C
E), but the proposed method seems to have found too many. However, since the radius is estimated to be at least 8 inches, the number is reduced from 155 to 97 (C
D). On the contrary, there are 72 (C
D) in comparison. The C
F of the proposed method is 14. Finally, C
D/C
E is 0.90 and C
T/C
D is 0.85. Compared with 0.67 and 0.88, C
D/C
E is higher and C
T/C
D is lower. The final results of
Figure 13 and
Figure 14 are shown in
Table 2.
In
Table 2, R
r (recall rate) is C
T/C
E, E
r (error rate) is C
F/C
E, and P
r (precision rate) is C
T/C
D. The proposed method has a relatively high R
r because it limits the minimum radius of the pipe to 8 inches. There are more pipes in the actual data.
Er shows that the comparison method has better results. However, if the error is assumed to be the number not found in the whole of CE, Er = (CE-CT) / CE, the proposed method will be 0.21 and 0.22, and the comparison method will be 0.42 and 0.41. This is because the CT in the proposed method is larger than the comparison method. Also, if 8 inches of cylinders are not excluded, CE will be greater than 89, which will affect Rr and Er. The more pipes it is searched, the better way, so the new Er may be meaningful.
A cylinder of 8 inches or less is shown in
Figure 13b (yellow circle A). These areas are cylinders with a radius of about 2 to 6 inches. Cylinders with small radii are difficult to estimate because their accuracy is low in sensor error and normal estimation. While the comparison method does not estimate the cylinder of this region, the proposed method shows some degree of cylinder estimation even though there are broken and missing parts. If C
E contains less than 8 inches of cylinders, the proposed method will give better results in new E
r. C
E in
Table 2 is in accordance with [
10].
In the experiment of the proposed method, data is sampled by setting = 25 as the first line of pseudo code a. The central axis candidates can be obtained by repeatedly sphere fitting (error 1 cm) on the sampled 25% data (pseudo code a 2-4 lines). When the DCL is completed, average filtering is performed (Pseudo code a 5 lines). Once the filtered center axis candidates DFLT is computed, it is sampled 40% and the PCA is used to calculate the directionality of the local point cloud (pseudo code a 6-8 lines). The pseudo code b estimates the complete cylinders in the directional set . First, algorithm searches for a straight line candidate DEST that matches the angle (<15 degrees) and the distance (<15 cm) between the two vectors as shown in the third row. Since the retrieved DEST means one cylinder, the cylinder is completed using PCA as shown in the line 7. This process is repeated (pseudo code b 1-8 lines) to estimate all the cylinders. The pseudo code c is a code fitting the curve region. The DCYL is the estimated set of cylinders, and curves are retrieved from the based on the end points of each cylinder in the DCYL. The line 2 checks whether the discriminant is within a certain range through the surrounding points in the . When the discriminant value in the experiment is 0.02 ~ 0.06, it is determined as a curve. The straight line is 0.02 or less. Depending on how much noise the data contains, the line and curve discriminant values may have a certain overlapping range (ex: straight line 0.03, curve: 0.01 to 0.06). When the is in the curve range, lines 3-6 are the process of finding the intersection point by estimating the directionality at each neighboring point. If the intersection set DCP is a discriminant value 0.02 ~ 0.06, the DCP finally determines that it is a curve, sets the order of the control points, and finalizes it with the Catmull-Rom spline. Finally, the set of estimated curves is DSPL.
The compared method is an algorithm of structural characteristic that has the disadvantage of slower execution time as the number of data points increases. This is because the segmentation time increases. Also, pipes with small diameters require appropriate restrictions because the normal estimate is somewhat difficult. On the other hand, the proposed method is relatively fast and can maintain accuracy because there is no segmentation and a normal estimation procedure. The results of estimating the cylinder with proposed method by integrating
Figure 13 and
Figure 14 are in the
Appendix.
The compared study uses the intersection point in the curved region estimation. Therefore, it is impossible to estimate an unfixed curved region. However, applying skeletonization may be able to estimate the bend area, but the opportunity cost will be increased accordingly. Skeletonization is mainly used with Laplacian smoothing [
22] or L1-medial [
23]/medial axis [
24], and the opportunity cost of its application is likely to increase due to cylinder bending area loss and noise after object segmentation.
6. Conclusions
The method proposed in this paper shows that it is possible to estimate cylinder shape quickly in a point cloud. Sphere fitting was shown to be suitable for estimating the center axis of the cylinder, and the data were sampled for quick processing. The orientation of the constructed center axis data could be confirmed by PCA.
PCA can be assumed to be the tangent of the estimation curve, since the main directionality can be set from the dispersion of the point data. The intersection of these estimated tangent lines can be a control point of the Catmull–Rom spline, and the curve can be obtained through it. The more accurate the center line estimate through the sphere fitting is, the better the curve can be. However, PCA can be more robust against noise and is relatively fast and accurate compared to spline fitting. The distinction between a straight line and a curve can be easily distinguished by using Equation (6).
The proposed method has the advantage of estimating the linear/curved shape of the cylinder 10 times faster (22 times in
Figure 13 and 17 times in
Figure 14) than the comparison method while maintaining relative accuracy. In addition, more cylinders (less than 8 inches) were estimated. For center axis estimation, sphere fitting was performed with 1 cm error and using 25% data.
Of course, it can be quickly matched to the constraints through vertical/horizontal conditions, but there is a disadvantage in that the oblique pipe cannot be estimated. In addition, the estimation of the curve in the comparison method matches the intersection of two straight lines only in a defined form with a number of cases. On the other hand, since the proposed method estimates along the actual bent path, it can be processed according to angles of all bent shape. Of course, there is a clue that point data should be smoother.
The proposed method has its own merits, but there are disadvantages as well. When the density of point data is too high, it is necessary to search for more neighbors in order to process the curvature as a fit, which means the execution time is longer. Therefore, downsampling is required prior to cylinder fitting. Downsampling does not appear to be a major drawback, because it has a much lower opportunity cost than normal estimation or segmentation.
Reverse engineering of construction modeling requires a lot of manual work. The more data there is, the harder it is for the operator to recognize the shape of the object. In other words, the more objects to recognize, the narrower the distance between objects, and the more difficult it is to distinguish objects on 2D screens. Therefore, fast recognition of primitive shapes is a good way to increase work efficiency. If it is forced to be accompanied by manual labor, it may be an effective alternative to obtain relatively quick estimation results rather than perfect automation. This paper is expected to improve the working efficiency of linear and curved cylinder estimation after center axis estimation without constraints and segmentation. Further study will be conducted in a way that smoothly integrates the estimated straight lines and curved parts into one and can produce consistent results.