arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana...

12
TGGLines: A Robust Topological Graph Guided Line Segment Detector for Low Quality Binary Images Ming Gong 1 , Liping Yang 2,3* , Catherine Potts 4 , Vijayan K. Asari 1 , Diane Oyen 2 , and Brendt Wohlberg 2 1 University of Dayton, Dayton, OH, USA 2 Los Alamos National Laboratory, Los Alamos, NM, USA 3 University of New Mexico, Albuquerque, NM, USA 4 Montana State University, Bozeman, MT, USA * Corresponding author: Liping Yang, [email protected] Abstract Line segment detection is an essential task in com- puter vision and image analysis, as it is the critical foundation for advanced tasks such as shape modeling and road lane line detection for autonomous driving. We present a robust topological graph guided approach for line segment detection in low quality binary images (hence, we call it TGGLines). Due to the graph-guided approach, TGGLines not only detects line segments, but also organizes the segments with a line segment connec- tivity graph, which means the topological relationships (e.g., intersection, an isolated line segment) of the de- tected line segments are captured and stored; whereas other line detectors only retain a collection of loose line segments. Our empirical results show that the TG- GLines detector visually and quantitatively outperforms state-of-the-art line segment detection methods. In ad- dition, our TGGLines approach has the following two competitive advantages: (1) our method only requires one parameter and it is adaptive, whereas almost all other line segment detection methods require multiple (non-adaptive) parameters, and (2) the line segments detected by TGGLines are organized by a line segment connectivity graph. 1. Introduction Line segment detection has been studied for decades in computer vision and plays a fundamental and im- portant role for advanced vision problems, such as in- door mapping [3], vanishing point estimation [15, 23], and road lane line detection for autonomous driving [5]. Many line segment detection methods are developed for natural images [4, 16, 22, 2, 7]. However, those methods do not work well for technical diagram images, such as patent images – see Figure 1 for an example. Clearly the line segment detection challenge remains in techni- cal images, especially in low quality images affected by the local zigzag “noise” introduced by the scanning pro- cess. We present a robust topological graph guided ap- proach for line segment detection in low quality binary (diagram) images. Specifically, our approach combines the power of topological graphs and skeletons to gen- erate a skeleton graph representation to tackle the line segment detection challenges. A skeleton is a central line (1 pixel wide) representation of an object present in an image obtained via thinning [13, 25]. The skele- ton emphasizes topological and geometrical properties of shapes [25]. In our approach, the skeleton serves as the essential bridge from pixel image representation to topological graph representation. We compare our TGGLines approach with four main- stream and state-of-the-art line segment detection meth- ods. The empirical results demonstrate that our TG- GLines approach visually and quantitatively outper- forms other methods. In addition, our method has two advantages. (1) While the parameters for most other methods are not adaptive, our method is robust as it only requires one parameter, and this parameter is adap- tive. (2) As TGGLines detects line segments it orga- 1 arXiv:2002.12428v1 [cs.CV] 27 Feb 2020

Transcript of arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana...

Page 1: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

TGGLines: A Robust Topological Graph GuidedLine Segment Detector for Low Quality Binary Images

Ming Gong1, Liping Yang2,3*, Catherine Potts4, Vijayan K. Asari1,Diane Oyen2, and Brendt Wohlberg2

1University of Dayton, Dayton, OH, USA2Los Alamos National Laboratory, Los Alamos, NM, USA

3University of New Mexico, Albuquerque, NM, USA4Montana State University, Bozeman, MT, USA

*Corresponding author: Liping Yang, [email protected]

Abstract

Line segment detection is an essential task in com-puter vision and image analysis, as it is the criticalfoundation for advanced tasks such as shape modelingand road lane line detection for autonomous driving.We present a robust topological graph guided approachfor line segment detection in low quality binary images(hence, we call it TGGLines). Due to the graph-guidedapproach, TGGLines not only detects line segments, butalso organizes the segments with a line segment connec-tivity graph, which means the topological relationships(e.g., intersection, an isolated line segment) of the de-tected line segments are captured and stored; whereasother line detectors only retain a collection of looseline segments. Our empirical results show that the TG-GLines detector visually and quantitatively outperformsstate-of-the-art line segment detection methods. In ad-dition, our TGGLines approach has the following twocompetitive advantages: (1) our method only requiresone parameter and it is adaptive, whereas almost allother line segment detection methods require multiple(non-adaptive) parameters, and (2) the line segmentsdetected by TGGLines are organized by a line segmentconnectivity graph.

1. IntroductionLine segment detection has been studied for decades

in computer vision and plays a fundamental and im-portant role for advanced vision problems, such as in-

door mapping [3], vanishing point estimation [15, 23],and road lane line detection for autonomous driving [5].Many line segment detection methods are developed fornatural images [4, 16, 22, 2, 7]. However, those methodsdo not work well for technical diagram images, such aspatent images – see Figure 1 for an example. Clearlythe line segment detection challenge remains in techni-cal images, especially in low quality images affected bythe local zigzag “noise” introduced by the scanning pro-cess.

We present a robust topological graph guided ap-proach for line segment detection in low quality binary(diagram) images. Specifically, our approach combinesthe power of topological graphs and skeletons to gen-erate a skeleton graph representation to tackle the linesegment detection challenges. A skeleton is a centralline (1 pixel wide) representation of an object presentin an image obtained via thinning [13, 25]. The skele-ton emphasizes topological and geometrical propertiesof shapes [25]. In our approach, the skeleton serves asthe essential bridge from pixel image representation totopological graph representation.

We compare our TGGLines approach with four main-stream and state-of-the-art line segment detection meth-ods. The empirical results demonstrate that our TG-GLines approach visually and quantitatively outper-forms other methods. In addition, our method has twoadvantages. (1) While the parameters for most othermethods are not adaptive, our method is robust as itonly requires one parameter, and this parameter is adap-tive. (2) As TGGLines detects line segments it orga-

1

arX

iv:2

002.

1242

8v1

[cs

.CV

] 2

7 Fe

b 20

20

Page 2: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

(a) Input diagram image (b) What humans see (c) What machines see

Figure 1. An example of how challenging it is for machines to see line segments present in diagram images (e.g.,patent images), especially those with low quality introduced by the scanning process. (a) Input image is a binarypixel-raster image. (b) Line segments (perceived) and annotated in green by humans. (c) Line segments machines seein the input image (using state-of-art line segment detection method linelet [7]).

nizes the segments into a topological graph. We callthis graph the line segment connectivity graph (LSCG);which stores the topological relations (e.g., turning andjunction) among detected line segments. The LSCGcan be used by advanced computer vision tasks, such asshape analysis and line segment-based image retrieval.

Line detection performance is often simply evaluatedby visualization, which is a non-quantitative evaluation.In this paper, we evaluate our results both qualitatively(Section 5.3) and quantitatively (Section 5.4). One of themost difficult problems for quantitative evaluation is an-notating line segments in an image accurately becausesometimes even humans will annotate lines differentlydue to the zigzag “noise” introduced by the scanningprocess (see the annotation examples provided in Figure5). Typically for a scientific diagram image, there canbe several hundreds of lines that must be annotated (seeimages #6 and #10 in Table 2 for examples). We providea simple interface for line segment annotation as well asa quantifiable metric for line detection performance asmeasured with respect to inherently inexact annotations.

Here, we provide a road map to the rest of the paper.Section 2 covers related work, including existing linesegment detection methods, and the topological-basedimage representations that our method is built on. Thecore of our paper is Section 3 focusing on our TGGLinesapproach and Section 4 focusing on algorithms. In Sec-tion 5, we present our experiments with qualitative andquantitative evaluations. The paper concludes in Sec-tion 6 with a mention of potential applications.

For readability, we provide a list of abbreviations inAppendix A.1. Background on graph theory and compu-tational geometry, is provided in Appendix A.2. These

appendices are provided in the supplementary materials.

2. Related work

Existing line segment detection methods are eitheredge-based or local gradient-based, whereas our TG-GLines method does not rely on edge detection or localgradients. Edge-based line detectors include the Houghtransform (HT) [4] which often uses the Canny edge de-tector [6] as pre-processing. The main drawback of HTis that it is computationally expensive and it only out-puts the parameters of a line equation, not the endpointsof line segments. The progressive probabilistic Houghtransform (PPHT) [16] is an optimization of the stan-dard HT; it does not take all the points into considera-tion, instead taking only a random subset of points andthat is sufficient for line detection. Also, PPHT is able todetect the two endpoints of each line, so it can be usedto detect line segments present in images.

Local gradient-based line detectors are successful onnatural images, but not diagrams (See Section 5.2). Theline segment detector (LSD) [22] is a local gradient-based method that has been tested on a wide set of natu-ral images. EDLines [2] speeds up LSD but according toour experiments and evaluation (Section 5.2), EDLines’performance is much worse than LSD on the diagramimage dataset. The linelet [7] method represents intrin-sic properties of line segments in images using an undi-rected graph which performs well on an urban scenedataset, but does not work well for diagrams. A re-cent review about line segment detection methods canbe found in [9, 19].

Our TGGLines method builds on topological-based

2

Page 3: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

methods. TGGLines uses the skeleton graph image rep-resentation proposed in [24]. The topological graph isgenerated automatically from an image skeleton, whichcan capture the topological and geometrical propertiesof shapes of objects present in an image [12]. We usethe well-known and robust Zhang-Suen thinning algo-rithm [27] to extract skeletons from images and sim-plify the geometries in the graph representation using theDouglas-Peucker algorithm [8] because of its simplicityand robustness. We have also tested the Visvalingam’s[21] on our dataset; however, it does not work as well asthe Douglas-Peucker algorithm.

3. TGGLines approachIn this section, we elaborate the proposed TGGLines

method, including image representation (Section 3.1),concepts (Section 3.2), and workflow illustrated usinga simple example (Section 3.3).

3.1. TGGLines image representation

The image representation used in our TGGLines isthe skeleton graph, which is a topological graph gener-ated from a image skeleton [24]. We use Zhang-Suenthinning algorithm [27] for image skeleton extraction,as it is well-known and robust.

See Figure 2 below for an illustration of the imagerepresentation we use in our TGGLines approach (thehandwritten digit image used here is taken from theMNIST dataset[14]). In the skeleton graph, each noderepresents a pixel in the image skeleton, and each edgeindicates that the two pixels it connects are neighbors.

3.2. TGGLines concepts

Skeleton graph: A skeleton graph is an embeddedgraph generated from an image skeleton, whereeach node represents a pixel in the image skeleton,and an edge betwee two pixel nodes indicate thetwo pixels are neighbors.

Path: Each path is an embedded graph that is a sub-graph of the skeleton graph, which consists ofnon-salient nodes segmented by salient nodes (e.g.,junction nodes and end nodes, defined in Section3.2.1) and edges connecting the nodes.

Line segment connectivity graph (LSCG): It is anembedded graph generated from the skeletongraph, where N is a set of nodes each represent-ing a path, and E is a set of edge representingsalient nodes (e.g., junction nodes or end nodes).each node will have an attribute that pointing to its

corresponding path it represents. LSCG is used toorganized segmented paths.

Simplified LSCG: It is the LSCG that the paths it or-ganize are simplified.

3.2.1 Node type in skeleton graph

There are three types of salient nodes in our TGGLines.We will use them to segment a skeleton graph to multiplepaths for simplification.

• End node: A (pixel) node that has only 1 neighbor.

• Junction node: A (pixel) node that has n neigh-bors where n > 2

• Turning node: A (pixel) node that has two neigh-bors.

3.3. TGGLines workflow

The TGGLines workflow is presented in Figure 7 be-low visually illustrated by a simple and straightforwardexample.

4. TGGLines algorithms

In this section, we provide the algorithms we devel-oped for the TGGLines introduced in Section 3 above.

The overview pseducode for the TGGLines algorithmis provided in Algorithm 1.

We first extract skeleton from an input diagram im-age. then a skeleton graph is generated from the skele-ton, after that, salient points (defined in Section 3.2.1)are detected by counting the incident edges for eachpixel node in the skeleton graph. Then the skeletongraph is segmented to multiple paths using the detectedsalient nodes; meanwhile a line segment connectedgraph is generated while segmenting skeleton graph topaths. Then we simplyfing paths oragzed in LSCG us-ing the Douglas-Peucker algorithm [8], detailed in Al-gorithm 2.

The LSCG for the illustrative example shown in theworkflow Figure 7 is given in Figure 4.

5. Experiments and evaluation

In this section, we provide details about dataset (Sec-tion 5.1), experiments and results (Section 5.2), qualita-tive (Section 5.3) and quantitative (Section 5.4) evalua-tion.

3

Page 4: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

(a) Input image (b) Image skeleton (c) Skeleton graph

Figure 2. An example of skeleton graph image representation . Figure 2 (a) shows the input image. Figure 2 (b)shows the image skeleton extracted from the input image. Figure 2 (c) provides the skeleton graph corresponding tothe skeleton present in (b).

Algorithm 1: TGGLines algorithmInput: A diagram image IOutput: An embedded graph Glsc = {N,E}

representing the simplified line segmentconnectivity graph from I // the nodes

of an embedded graph contain

coordinates, therefore the graph

can be drawn uniquely on a plane

1 S ← skeleton(I)2 Gs ← skeletonGraph(S)/* salient nodes detection for segmenting

line segments */

3 Ns ← salientNodes (Gs)// detecting salient nodes

4 P ← Paths(Gs,Ns)// segmenting paths

5 Glsc ← lineSegConnectvityGraph (Gs, Ns)6 Gslsc ← simplifyingLineSegConnectvityGraph

(Glsc)7 return Gslsc

5.1. Dataset

To evaluate TGGLines, and compare with state-of-the-art methods, we develop a simple interface to man-ually annotate 10 diagram images taken from the 2000Binary Patent Image Database developed by Multime-dia Knowledge and Social Media Analytics Labora-tory (MKLab) [1]. The database contains images frompatents maintained by the European Patent Office.

For readability, we take partial images from 10 se-

Algorithm 2: Simplifying paths organized byLSCG

Input: Segmented paths P organized by LSCGOutput: An updated LSCG pointing to simplified

paths S1 S ← null // Initialization

2 foreach path p ∈ P do3 N ← Node (p) // the nodes of p

4 n← num (N ) // the number of nodes

5 if n > 2 then/* cacluate adaptive Douglas-Peucker

parameter ε */

6 C ← convex hull (N )7 ε← area of C / perimeter of C8 Simplify path p using Douglas-Peucker

algorithm with parameter ε9 new path← simplified p

10 append new path to S

11 return S, and update LSCG

lected samples (cropped without changing the resolu-tion of the original images), the file size ranges from53 KB (212x171, #3 in Table 1) to 307 KB (524x566,#7 in Table 2). Our dataset is small yet representative.Samples are carefully selected from the 2000 patent im-ages, by considering this selection criteria: (1) differentcomplexity of line directions (e.g., vertical, horizontal,other arbitrary angles), (2) spacing between line seg-ments (roughly equal spacing, sparse, dense), (3) topo-logical relations (e.g., single line segment, intersection,

4

Page 5: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

(a) Input diagram image (b) Image skeleton extraction (c) Skeleton graph: a topological graphgenerated from skeleton [24]

(d) Skeleton graph (zoomed-in detail)

(e) Skeleton graph (zoomed-in detail)(f) Detecting salient nodes (zoom-in detail)

(g) Segmenting skeletongraph to paths and gener-ating LSCG (h) Simplifying paths organized by LSCG

(adaptive parameter)

(i) Detected line segments (organized byLSCG)

Figure 3. TGGLines workflow illustrated with a simple and straightforward example. Note that in (b) it is invertedfor image skeleton extraction. In (c), the red node indicates junction nodes and blue nodes indicate turning node(definition of salient point types can be found in Section 3.2.1). in (g) LSCG represents line segment connectivitygraph. Each node in LSCG represents a path, for example in (g) there are three different paths.

turning, circular). Figure 5 shows two annotated exam-ples. The images in the experiment, image #01 to #10,are the partial images taken from the following imagesfrom the patent image dataset [1]: 01779, 01126, 00501,00780, 00971, 00575, 00429, 01267, 00811, and 01140.

5.2. Experiments and results

We implement TGGLines in Python using OpenCV,Scikit-image [20], SymPy [17], and NetworkX [10].We compare TGGLines with state-of-the-art methods:PPHT [16], LSD [22], EDLines [2] and Linelet [7]. Re-sults can be found in the sets of figures organized in

5

Page 6: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

Figure 4. Line segment connectivity graph (LSCG) forthe example shown in the workflow Figure 7 above. eachlight blue node represents a path, if two paths are con-nected by a junction node or turning node, there is anedge between the nodes.

(a) (b)

Figure 5. Annotation examples: Line segments of (a)varying angles and spacing intervals; and (b) even inter-val. Examples have different resolution.

Tables 1 and 2. Parameter settings (Table 3) for eachmethod are provided in Appendix A.3, and the comput-ing environment details can be found in Appendix A.4.

5.3. Qualitative comparison

We qualitatively compare the line segment detectionmethods as presented in the results Tables 1 and 2.Clearly, PPHT detects many tiny line segments and dou-ble lines for each true line segment, as it is an edge-basedmethod. LSD and EDLines detect double lines for eachline segment in the ground truth; this is not surprising,as they are local gradient-based methods.

Visually, EDLines performs the worst for our experi-ment dataset, many line segments cannot be detected byEDLines (especially for image #3 and #6 in Table 1 and

2, respectively). LSD detect many tiny lines, similar toPPHT, especially in image #7 and #8 in Table 2.

The performance of Linelet is not consistent. Forsome images, double lines are detected for each linein the ground truth (see image #7 and #9 in Table 2),whereas for other images, single lines are detected (e.g.,image #6 and #8 in Table 2).

Among all methods, visually, our TGGLines per-forms the best. Another advantage of TGGLines is seenin Table 2 image #10 where multiple crossed lines forma circle intersection. As most methods detect lines basedon edge maps, the circles from the original images leavean open circle shape in the results. While TGGLinesavoids the open circle, and invariant to line width be-cause we detect the lines based on image skeletons.

5.4. Quantitative comparison

We quantitatively compare the line segments fromour TGGLines method and other four methods webenchmark against ground truth. Automatically quan-tifying the performance of detected line segment resultsis difficult, because the errors among the methods varyin nature. For example, some methods (like PPHT andLSD) detect most lines as double lines, but sometimesas single lines.

We use line detection accuracy as a simple evalua-tion metric, by manually counting the true positive linesegments detected to calculate the accuracy. True posi-tives are defined using the following criteria (examplesof criteria are visually illustrated in Appendix A.5): (1)for double line cases (e.g., PPHT, LSD), we count a linesegment as correct if (a) both line segments are correctlydetected compared with the corresponding line segmentin the ground truth, so we assign weight 0.5 for eachline segment; or (b) if more than half is detected for onesegment, we give it weight 0.5 * 0.5 = 0.25; (2) for sin-gle line cases (e.g., TGGLines), we count a line segmentas correct if (a) it is fully detected correctly, we assignweight 1; or (b) if more than half is correctly detected,we give weight 0.5; (3) if many tiny line segments aredetected for a line segment in the ground truth, we viewit incorrect, and assign it weight 0.

The accuracy calculation is based on the manuallyannotated line segments in ground truth. Specifically,accuracy = nc/nt, where nc is the number of correctlydetected line segments (true positive), and nt is the to-tal number of line segments in ground truth. For meth-ods that (e.g., LSD and EDLines) detect double lines foreach line in the ground truth, we only count it detectedcorrectly if it detect both line segments. The accuracyof the methods on line segment detection is provided in

6

Page 7: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

Table 1. Line segment detection results on images #01 — #05 of the dataset.

Img # Input images Ground truth PPHT LSD EDLines Linelet TGGLines

01

02

03

04

05

Figure 6. We can see that the accuracy results matchup with the visual comparison. EDLines performs theworst among the images in our dataset, and TGGLinesperforms the best, while Linelet is not consistent.

While manually counting line detection results, wenote that TGGLines is the only method that avoids de-tecting double lines, and it detects lines with the leastbreak points.

Figure 6. Line segment detection accuracy for differentmethods.

6. Conclusion

We have introduced a robust topological graphguided line segment detection method, TGGLines, forlow quality binary diagram images, using a skeletongraph image representation. Compared with state-of-the-art line segment detection methods (specifically,PPHT, LSD, EDLines, and Linelet), on diagram imagestaken from a patent image database; empirical resultsshow that our TGGLines approach outperforms othermethods, both visually and quantitatively.

Beyond the accuracy of TGGLines compared withother methods, TGGLines has two competitive advan-tages: (1) it is robust, as TGGLines only requires oneparameter and most importantly, this parameter is adap-tive; and (2) the line segments detected using TGGLinesare organized in a topological graph – we name it linesegment connectivity graph (LSCG). Thus the topologi-cal relations among the line segments are captured andstored while detecting line segments which can be usedfor further topological-based image analysis.

The effectiveness and robustness of our method, es-pecially the topological relations among detected linesegments, provide an important foundation for many ap-plications, such as text recognition in historical docu-ments and OCR-based applications, converting raster-ized line drawings to vectorized images, road lane linedetection for autonomous driving, as in real world roadscene images often contain similar zigzag “noise” as

7

Page 8: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

Table 2. Line segment detection results on images #06 — #10 of the dataset.

Img # Input images Ground truth PPHT LSD EDLines Linelet TGGLines

06

07

08

09

10

scanned document images have, because of scenariossuch as worn road markings, falling leaves and/or dirtover roads.

References[1] Multimedia knowledge and social media ana-

lytics laboratory (MKLab). 2000 binary patentimages database, 2010. Available online:https://mklab.iti.gr/results/patent-image-databases/(accessed on October 10, 2019). 4, 5

[2] Cuneyt Akinlar and Cihan Topal. EDLines: A real-timeline segment detector with a false detection control. Pat-tern Recognition Letters, 32(13):1633–1642, 2011. 1, 2,5

[3] Su-Yong An, Jeong-Gwan Kang, Lae-Kyoung Lee, andSe-Young Oh. Line segment-based indoor mapping withsalient line feature extraction. Advanced Robotics, 26(5-6):437–460, 2012. 1

[4] Dana H Ballard. Generalizing the hough transform todetect arbitrary shapes. Pattern Recognition, 13(2):111–122, 1981. 1, 2

[5] Michael Beyeler, Florian Mirus, and Alexander Verl.Vision-based robust road lane detection in urban en-vironments. In 2014 IEEE International Conferenceon Robotics and Automation (ICRA), pages 4920–4925.IEEE, 2014. 1

[6] John Canny. A computational approach to edge detec-tion. IEEE Transactions on Pattern Analysis and Ma-chine Intelligence, (6):679–698, 1986. 2

[7] Nam-Gyu Cho, Alan Yuille, and Seong-Whan Lee. Anovel linelet-based representation for line segment de-tection. IEEE Transactions on Pattern Analysis and Ma-chine Intelligence, 40(5):1195–1208, 2017. 1, 2, 5, A -2

[8] David H Douglas and Thomas K Peucker. Algorithms forthe reduction of the number of points required to repre-sent a digitized line or its caricature. Cartographica: theInternational Journal for Geographic Information andGeovisualization, 10(2):112–122, 1973. 3

[9] Rui FC Guerreiro and Pedro MQ Aguiar. Connectivity-enforcing hough transform for the robust extraction ofline segments. IEEE Transactions on Image Processing,21(12):4819–4829, 2012. 2

8

Page 9: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

[10] Aric A. Hagberg, Daniel A. Schult, and Pieter J. Swart.Exploring network structure, dynamics, and function us-ing NetworkX. In In Proceedings of the 7th Python inScience Conference (SciPy), pages 11–15, 2008. 5

[11] John Michael Harris, Jeffry L Hirst, and Michael J Moss-inghoff. Combinatorics and graph theory, volume 2.Springer, 2008. A - 1

[12] J Komala Lakshmi and M Punithavalli. A survey onskeletons in digital image processing. In InternationalConference on Digital Image Processing, pages 260–269. IEEE, 2009. 3

[13] Louisa Lam, Seong-Whan Lee, and Ching Y Suen.Thinning methodologies-a comprehensive survey. IEEETransactions on Pattern Analysis and Machine Intelli-gence, 14(9):869–885, 1992. 1

[14] Yann LeCun, Leon Bottou, Yoshua Bengio, PatrickHaffner, et al. Gradient-based learning applied todocument recognition. Proceedings of the IEEE,86(11):2278–2324, 1998. 3

[15] Jose Lezama, Rafael Grompone von Gioi, Gregory Ran-dall, and Jean-Michel Morel. Finding vanishing pointsvia point alignments in image primal and dual domains.In Proceedings of the IEEE Conference on Computer Vi-sion and Pattern Recognition, pages 509–515, 2014. 1

[16] Jiri Matas, Charles Galambos, and Josef Kittler. Ro-bust detection of lines using the progressive probabilistichough transform. Computer Vision and Image Under-standing, 78(1):119–137, 2000. 1, 2, 5

[17] Aaron Meurer, Christopher P. Smith, Mateusz Paprocki,Ondrej Certık, Sergey B Kirpichev, Matthew Rocklin,AMiT Kumar, Sergiu Ivanov, Jason K Moore, SartajSingh, et al. SymPy: symbolic computing in Python.PeerJ Computer Science, 3:e103, 2017. 5

[18] Mark Needham and Amy E Hodler. Graph Algo-rithms: Practical Examples in Apache Spark and Neo4j.O’Reilly Media, 2019. A - 1

[19] Payam S Rahmdel, Richard Comley, Daming Shi, andSiobhan McElduff. A review of hough transform andline segment detection approaches. In VISAPP (1), pages411–418, 2015. 2

[20] Stefan Van der Walt, Johannes L Schonberger, JuanNunez-Iglesias, Francois Boulogne, Joshua D Warner,Neil Yager, Emmanuelle Gouillart, and Tony Yu. Scikit-image: image processing in python. PeerJ, 2:e453, 2014.5

[21] Maheswari Visvalingam and James D Whyatt. Line gen-eralisation by repeated elimination of points. The Carto-graphic Journal, 30(1):46–51, 1993. 3

[22] Rafael Grompone Von Gioi, Jeremie Jakubowicz, Jean-Michel Morel, and Gregory Randall. LSD: A fast linesegment detector with a false detection control. IEEETransactions on Pattern Analysis and Machine Intelli-gence, 32(4):722–732, 2010. 1, 2, 5

[23] Yiliang Xu, Sangmin Oh, and Anthony Hoogs. A mini-mum error vanishing point detection approach for uncali-brated monocular images of man-made environments. In

Proceedings of the IEEE Conference on Computer Visionand Pattern Recognition, pages 1376–1383, 2013. 1

[24] Liping Yang, Diane Oyen, and Brendt Wohlberg. Im-age classification using topological features automati-cally extracted from graph representation of images. InProceedings of the 15th International Workshop on Min-ing and Learning with Graphs (MLG), 2019. 3, 5, A -1

[25] Liping Yang, Diane Oyen, and Brendt Wohlberg. Anovel algorithm for skeleton extraction from images us-ing topological graph analysis. In The IEEE Conferenceon Computer Vision and Pattern Recognition (CVPR)Workshops, June 2019. 1, A - 1

[26] Liping Yang and Michael Worboys. Generation of navi-gation graphs for indoor space. International Journal ofGeographical Information Science, 29(10):1737–1756,2015. A - 1

[27] TY Zhang and Ching Y Suen. A fast parallel algo-rithm for thinning digital patterns. Communications ofthe ACM, 27(3):236–239, 1984. 3

9

Page 10: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

A. AppendixA.1. Abbreviations

In this appendix, we provide the abbreviations (or-dered alphabetically) of terms we used in the paper.EDLines Edge drawing linesHT Hough transformLSCG Line segment connectivity graphLSD Line segment detectorOCR Optical character recognitionPPHT Progressive probabilistic hough transformTGGLines Topological graph guided lines

A.2. Definition of terms used

In this appendix, we provide the definitions to someconcepts (ordered alphabetically; referenced [25, 26, 24,11, 18]) in graph theory and computational geometry weused in our TGGLines.

Convex hullThe convex hull of a finite set of points S is theintersection of all half-spaces that contain S . Ahalf space in two dimensions is the set of pointson or to one side of a line. Computing the convexhull of S is one of the fundamental problems ofcomputational geometry.

Embedded graphAn embedded graph is a graph that each node has(planar) coordinates so the graph can be drawn ona plane uniquely without any edge intersection orcrossing.

GraphA graph consists of a collection of nodes (alsocalled vertices or points) and a collection of edgesthat connect the nodes.

SkeletonThe skeleton of a binary image is a central line ex-traction (1 pixel wide) of objects present in the im-age through thinning.

Skeleton graphThe skeleton graph Gs of a binary image B is anembedded graph generated from the skeleton S ofB, where each node in Gs represents a white (i.e.,non-zero) pixel in S and each edge e in Gs indi-cates the two pixels represented by the end nodesof e are neighbors.

PathIn graph theory, a path is a sequence of distinctive

nodes connected by edges. The length of a pathis the number of edges traversed. node v is reach-able from node u if there is a path from u to v. Agraph is connected, if there is a path between anytwo nodes.

A.3. Parameter settings and computational time

This appendix provides the parameter settings foreach method in Table 1 and 2.

Table 3 provides the parameters used for each methodwe compare. Computing environment for the experi-ments is provided in Appendix A.4 below.

A.4. Computing environment

In this appendix, we provide the computing environ-ment that we ran our experiments. We ran all the exper-iments on a Windows desktop machine (Windows 10)with Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (6cores and 12 logical processors; 32.0 GB RAM).

A.5. Visually illustrated criteria for quantitativeevaluation

In this appendix, we provide the criteria for judgingthe correctness of line segments (Table 4) along with avisual example showing the criteria applied to detectedline segments for each method that we compare duringour quantitative evaluation (Section 5.4).

Using the criteria provided in Table 4, we judge andcalculate how many lines are correctly detected againstthe ground truth. Then the accuracy is calculated. SeeFigure 7 for an example of the criteria used to judge thelines detected for each method and how the accuracy iscalculated for image #01 from Table 1.

A - 1

Page 11: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

Table 3. Parameter settings for different line segment detection methods in Table 1 and Table 2. For other parametersnot listed specifically here, default parameters provided in the tools are used.

Line segmentdetection methods Parameters Tools and methods used

PPHT threshold: 10; line length: 5; line gap: 3 probabilistic hough line function(Scikit-image)

LSD scale: 0.8; sigma scale: 0.6, quant:2.0, ang th: 22.5, density th: 0.7

createLineSegmentDetectorfunction (OpenCV)

EDLines

Internal parameters: {ratio: 50,angle turn: 67.5*np.pi/180, step: 3};Parameters for Edge Drawing: {ksize:3, sigma: 1, gradientThreshold: 25,anchorThreshold: 10, scanIntervals: 4 };Parameters for EDLine: {minLineLen:40, lineFitErrThreshold: 1.0}

EDLines Python implementation(Github code)

Lineletparam.thres angle diff: pi/8;param.thres log eps: 0.0;param.est aggregation: Kurtosis

Matlab code by the linelet authors[7]

TGGLinesTGGLines requires only one parameter,and it is adaptive (see line 7 in Algorithm2).

Implemented by the authors of thepaper

Table 4. Judging criteria for evaluation. GT refers to ground truth. The line segments in the example in Figure 7 arecolor-coded by weights as shown here. For double-line cases (see Figure 7 (c) for an example), we only count thesegment correct if both lines are correctly detected against the GT. Thus, our scoring process is as follows: each oneof the double lines, if they are correctly detected, the weight for each line is assigned 0.5 and thus the score for the“whole line” in GT is 0.5 * 2 = 1.0. Likewise, if only half of one line in a double line case is detected correctly, thescore is 0.5 * 0.5 = 0.25.

Criteria Weights (marked with color)Fully correct (same slope as GT) 1.0A long line in GT detected as multiple split lines in results with alltopological relationships well-preserved 1.0

Not fully correct but >= 50% is correct 0.5Different slope as GT but most of the line(s) are correct 0.5One line of a double line case is correct 0.5Multiple tiny line segments (including connected or not connected):shifted a little bit 0.5

Only half of one line of a double line case is correct 0.25One line of a double line case is correct, but shifted a little bitamong the multiple tiny line segments 0.25

Multiple tiny line segments (including connected or not connected):shifted a lot 0

A - 2

Page 12: arXiv:2002.12428v1 [cs.CV] 27 Feb 2020 · 3University of New Mexico, Albuquerque, NM, USA 4Montana State University, Bozeman, MT, USA *Corresponding author: Liping Yang, lipingyang@unm.edu

(a) Ground truth: # of lines = 25(b) PPHT: # of lines detected correctly = 27 * 0.5 + 23* 0.25 = 19.25. Accuracy = 19.25 / 25 * 100% = 77%

(c) LSD: # of lines detected correctly = 27 * 0.5 + 23 *0.25 = 19.25. Accuracy = 19.25 / 25 * 100% = 77%

(d) EDLines: # of lines detected correctly = 1 * 0.5 +16 * 0.25 = 4.5. Accuracy = 4.5 / 25 * 100% = 18%

(e) Linelet: # of lines detected correctly = 5 * 0.5 + 25* 0.25 = 8.75. Accuracy = 8.75 / 25 * 100% = 35% (f) TGGLines: # of lines detected correctly = 17 * 1 +

8 * 0.5 = 21. Accuracy = 21 / 25 * 100% = 84%

Figure 7. Judging criteria illustrated visually for the evaluation of different line segment detection methods for image#01 in Table 1.

A - 3