Abstract
This article presents a novel line segment extraction algorithm using two-dimensional (2D) laser data, which is composed of four main procedures: seed-segment detection, region growing, overlap region processing, and endpoint generation. Different from existing approaches, the proposed algorithm borrows the idea of seeded region growing in the field of image processing, which is more efficient with more precise endpoints of the extracted line segments. Comparative experimental results with respect to the well-known
Introduction
In order to fulfill high-level tasks, autonomous localization and environment perception are indispensable functions of a mobile robot. 1,2 As for robot localization, proprioceptive sensors such as odometry and inertial sensors cannot avoid the problem of error accumulation, 3 thus exteroceptive sensors need be used together to achieve effective localization and mapping. 4 –7 Among various external sensors, two-dimensional (2D) laser sensors could provide precise and reliable environmental information with a large view angle, and thus they have been widely used in perception tasks including localization, mapping, and place recognition. 8 –11 To make a full use of laser information, in addition to point clouds, point and line features are important for map representation and localization. 12 –16
Compared with point features, line segment features are potentially valuable for higher level understanding of the environment, especially in the hallway, office area, and other semi-structured indoor environments. Therefore, on the basis of line segments, many algorithms of localization, mapping, and place recognition have been proposed. In the study by Lee et al., 17 the authors deal with outdoor place recognition using only line segments, which increases the robustness against changes of environments. The work by Lu and Song 18 proposes a heterogeneous landmark-based visual navigation approach for a monocular mobile robot, using an elegant combination of line segments and other visual features. In the study by Pfister et al., 19 the authors proposed a mapping algorithm to find the line-based map that best fits 2D laser data using Hough transform. Brunskill and Roy 20 presented a new simultaneous localization and mapping (SLAM) approach using incremental probabilistic principal component analysis (PCA), which clusters 2D laser data into line segments using the probabilistic PCA algorithm. Meanwhile, in the study by Nguyen et al., 21 a lightweight SLAM algorithm named OrthoSLAM is presented and experimentally validated, which uses mapping between lines that are parallel or perpendicular to each other in most structured environments. In the study by Abeles, 22 a robust local localization algorithm that uses line segments extracted from raw 2D laser data has been presented. An et al. 23 introduced an algorithm of plane extraction using line segments for three-dimensional mapping, which largely reduces the complexity. In the study by Mazuran and Amigoni, 24 the authors exploited the mutual compatibility for line segment matching in different scans. Although line segment features are widely used, in some practical applications, the performance of existing algorithms online segment extraction is unsatisfactory, in terms of the efficiency, correctness, and precision.
In this article, we propose a novel algorithm of line segment extraction using 2D laser data based on seeded region growing. Different from traditional approaches, the proposed algorithm borrows the idea of seeded region growing in the field of image processing, which is more efficient with more precise endpoints of the extracted line segments. At first, using the orthogonal least square approach together with a bearing-based condition, we present a seed-segment detection approach. Once a seed-segment is detected, it will be extended to be a full line segment through the proposed region growing technique, which helps improve the computational efficiency and correctness without iterative fitting process. In addition, overlap region processing and endpoint generation determine the endpoints of line segments with high precision. Experimental results show that our proposed algorithm has a better performance than the well-known
The main contributions of this article include following aspects: (1) a new line segment extraction algorithm based on seeded region growing with 2D laser data; (2) more precise endpoints of extracted line segments; (3) experimental results show that our algorithm presents better performance in three aspects: efficiency, correctness, and precision.
The organization of the rest article is as follows. In the following section, we review related work. “Line segment extraction” section describes the process of line segment extraction using 2D laser data. The comparison criteria and experimental results are described in the “Experiment” section. Finally, some conclusion and future work are outlined.
Related work
An overview of existing works of line segment extraction is presented in “Existing algorithms” section. In “Seeded region growing” section, it is shown how seeded region growing is related to our algorithm. Finally, a summary is given to justify the proposed idea.
Existing algorithms
Line extraction using 2D laser data has been studied in many existing works.
15,26
Pavlidis and Horowitz
27
proposed

Iterative-End-Point-Fit algorithm.
However, the process of

A typical example, using
Seeded region growing
Seeded region growing 31 is an effective method for image segmentation, which is widely used in image processing. The main function of seeded region growing is to partition an image into regions. Fan et al. 32 conducted an extensive and comparative studies about seeded region growing, and then they propose an automatic seeded region growing algorithm and a seed tracking algorithm. The work by Fan and Lee 33 relaxes the constant grey value assumption and proposes a stable seeded region growing algorithm.
Conventional seeded region growing is a local method with no global view of the problem and thus it is sensitive to noise. However, laser data are more reliable and accurate compared with image data, seeded region growing using laser data presents satisfactory performance. 34,35
Summary
In this article, we treat the line segment extraction problem as a special kind of region segmentation. Different from existing algorithms, our proposed algorithm uses seed-segment and region growing instead of recursion and breakpoint detectors. Thus, the efficiency and correctness are improved in the extraction process. In order to obtain the precise endpoints of line segments, the processes of overlap region processing and endpoint generation are proposed. In the summary, through the design of seed-segment detection, region growing, overlap region processing, and endpoint generation, the proposed algorithm achieves superior performance, in terms of efficiency, correctness, and precision.
Line segment extraction
This section presents the proposed line segment extraction algorithm using 2D laser data based on seeded region growing, which is different from previous methods. At first, orthogonal least squares are explained in the “The orthogonal least square method” section. The “Seed-segment detection” section describes the process of seed-segment detection. The following subsections provide an effective solution to extracting complete line segments from seed-segments, including region growing, overlap region processing, and endpoint generation. The overall block diagram is shown in Figure 3

Overall block diagram.
The orthogonal least square method
The standard least square method for line fitting may yield unsatisfactory parameter estimation results, because it only minimizes the vertical distance of each point from the line. For this reason, the orthogonal linear fitting method, 36 which minimizes the perpendicular distance of each point from the line and is adopted in this article to obtain satisfactory line fitting results.
Let a line denoted by
Accordingly, the sum of squares of distances of a number of
with
Seed-segment detection
Every complete line segment is obtained from a seed-segment, which consists of a small amount of successive 2D laser points. In the whole process of line segment extraction, a precise method about seed-segment detection plays a significant role. Therefore, the detection of a seed-segment is very strict, which needs to satisfy some conditions.
At first, several successive laser points are used to fit a straight line by the means of orthogonal least squares, parameters (
(1)
(2)
where the predicted point
where the parameter

The predicted position of laser point (the blue solid line obtained by fitting six consecutive points; the red dashed line obtained by the bearing of the laser point).
The candidate that satisfies above requirements will be considered as a seed-segment, which is the beginning of the region growing process. The whole algorithm of seed-segment detection is shown as algorithm 1.

Seed-segment detection
In algorithm 1,
Region growing
As a typical image segmentation method, 31 region growing examines neighboring pixels of initial seed points and determines whether the pixel neighbors should be added to the region.
In this article, we apply the idea of region growing to line segmentation, and the main goal of laser line extraction is to partition 2D laser data into some line segments. The unique property of the laser points in the same line segment is the distance from themselves to the fitting straight line, which are all less than a given threshold.
The process of region growing will be excited when seed-segment detection is successful. When a laser point is added into the line segment, we will refit current line segment. Let Line(

Region growing
Overlap region processing
Some complete line segments are got from the 2D laser data after region growing, but two adjacent line segments may have an overlap region, as shown in Figure 5, which will have some negative influence on the description of environment structure.

Formation of an overlap region (collinear relationship).
Two overlap adjacent line segments have two spatial structure relationships: collinear (Figure 5) and non-collinear. For the former, we refit all laser points belonging to two adjacent line segments. In addition, the process of dealing with overlap region is to compare the distance from a laser pointer to a different line segments for the latter, this method is algorithm 3.

Overlap region processing
Endpoint generation
After the above steps, the line parameters (

Endpoint (red cross represents the endpoint).
Assume that the formulas of the straight line and its vertical line are as follows, except at least one of
where the point (
Experiment
Setup
In order to evaluate the performance of our proposed algorithm, some experiments are carried out. We selected two laser scan data sets taken from a hallway and a laboratory. As shown in Figure 7, the hallway only contains doors, walls, and some fire fighting equipments, which are suitable for line extraction, while there are some desks and chairs in the laboratory.

Environment (a) hallway; (b) laboratory.
The laser sensor in our experiments is UTM-30LX produced by HOKUYO. The main parameters of the laser sensor are detailed in Table 1. The proposed line segment extraction algorithm has been implemented on the mobile robot called Pioneer-3DX shown in Figure 8. The laser sensor is mounted on the mobile robot, and we obtained two data sets from the hallway and the laboratory through manual operating the mobile robot.
Specification parameters.

Experimental platform.
We will compare our algorithm (Currently, a video of experimental results is available at https://youtu.be/yNN9NRioOBc. The source code is available at https://github.com/ghm0819/laser-line-segment.) with the well-known
Parameter value.
Runtime
A complete comparison of computational time of our proposed algorithm and

Computational time of two algorithms.
As shown in Table 3 and Figure 9, our proposed algorithm is more stable and much faster than
Computational time (in milli second) using two algorithms.
Correctness
The meaning of correctness 15 is defined as follows:
where NumMatch is the number of matches, NumExtLine is the number of line segments extracted, TrueLines is the number of true line segments in the environment. An ideal line extraction algorithm should present a high TR and a low FR.
The evaluation of correctness relies on human participation by manually labeling how many true line segments in the current environment. We randomly selected 10 frames from two data sets, respectively and then recorded the results of line segment extraction, as shown in Table 4 and Figure 10 (wherein the green rectangles show the line segments that are not extracted successfully). It is shown that the proposed algorithm achieves better performance in terms of correctness.
Correctness.

Comparison of precision (completeness) of line segments. The white points represent the laser points, the red solid line segments represent the extracted line segments. Obviously, in the yellow circles,
Precision
Different from the criterion in the study by Nguyen et al., 15 precision is defined as the completeness of the line segment, especially around the endpoints (measuring whether all laser points belonging to the line segment are exacted) instead of quantitative description of line parameters. In the study by Nguyen et al., 15 the gap of line parameters between different algorithms is very small when the line segment is fully detected because all algorithms use total least squares to obtain line parameters. In fact, we are more concerned about the completeness of the extracted line segment.
According to this criterion of precision, comparative results of
Conclusion
This article has presented a novel algorithm of line segment extraction using 2D laser data based on seed-segment detection and region growing. The whole algorithm is composed of seed-segment detection, region growing, overlap region processing, and endpoint generation instead of recursion and breakpoint detectors. We use two data sets taken from a hallway and a laboratory for experimental evaluation, and it is shown that compared with the well-known
Future work will focus on using the extracted line segments to address the global localization and loop closure with 2D laser sensors.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by National Natural Science Foundation of China under grant nos. 61573195 and U1613210.
