You are on page 1of 18

The Photogrammetric Record 35(169): 40–57 (March 2020)

DOI: 10.1111/phor.12296

AN IMPROVED RANSAC ALGORITHM FOR


EXTRACTING ROOF PLANES FROM AIRBORNE LIDAR
DATA
Sibel CANAZ SEVGEN* (ssevgen@ankara.edu.tr)
Ankara University, Ankara, Turkey

Fevzi KARSLI (fkarsli@ktu.edu.tr)


Karadeniz Technical University, Trabzon, Turkey
*Corresponding author

Abstract
The extraction of building roof planes from lidar data has become a popular
research topic with random sample consensus (RANSAC) being one of the most
commonly adopted algorithms. RANSAC extracts full planes, which is problematic
when there are other points outside the plane boundary but within the plane
space. This study proposes an improved RANSAC (I-RANSAC) algorithm by
removing points that do not belong to the roof plane. I-RANSAC selects a random
point from the extracted roof plane and then searches for its neighbours within a
given threshold to identify and remove outliers. The new algorithm was tested with
14 buildings from two datasets, where quality control measures showed significant
improvement over standard RANSAC.

Keywords: building roof plane detection, lidar, planar feature extraction, point
cloud, RANSAC, region growing

Introduction
MAN-MADE STRUCTURES are generally in the form of geometric features. For instance, building
roofs can commonly be represented by planar geometry. By defining locations and
boundaries of roofs, a building map of an interested area can be created so that this map
can be used for urban planning. Determination of the location and condition of buildings
can be performed with less labour using photogrammetric and remote sensing techniques. As
well as a building’s roof planes, its facßades generally also consist of planar elements. To
reconstruct buildings as a whole from remotely sensed data, buildings’ roofs and facßades
need to be extracted. The focus of this study is restricted to extracting building roofs, which
possess a planar geometry, to define the presence of buildings and their location.
One of the most popular data sources in photogrammetry and remote sensing is light
detection and ranging (lidar), which forms point cloud data. Lidar technology collects dense

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

and accurate 3D point data (Flood, 2001; Lefsky et al., 2002) by calculating a laser beam’s
travel time. Using lidar data, features of interest can be extracted from the whole dataset.
Building roof plane extraction has been studied in various research studies over the
past decade (Satari et al., 2012; Awrangjeb and Fraser, 2014; Pot uckova and Hofman, 2016;
Tomljenovic et al., 2016; Cao et al., 2017; Wang et al., 2018; Zhang et al., 2018). Different
algorithms are presented to extract planar features. In building roof plane extraction, features
of each point are defined and computed in a neighbourhood; a clustering technique is then
applied to those features to extract planar building roofs. The more precise the feature
computation, the greater the number of planar roofs that are extracted from the dataset. In
addition, neighbourhood definition has an impact on the results. Lari and Habib (2014)
defined the local attributes of each point in the dataset using a cylindrical neighbourhood,
applying an octree space-partitioning method to extract building roofs in the point cloud
data. Sampath and Shan (2010) used Voronoi-based neighbourhood definition for attribute
computation and a fuzzy c-means clustering performed on the normal axis of the points.
Filin and Pfeifer (2006) developed a slope-based neighbourhood and deployed feature
clustering with multiple attributes. Xu et al. (2012) segmented airborne lidar data into three
main entities using a rule-based classification. The main disadvantage of these methods is
that they require prior knowledge of the number of clusters in the dataset, which is a key
question in this kind of research.
The two most popular algorithms for feature extraction are the random sample
consensus (RANSAC) (Fischler and Bolles, 1981) and the Hough transform (Hough, 1962).
The RANSAC algorithm gives a result that is more successful and in a shorter time
compared with the Hough transform technique (Tarsha-Kurdi et al., 2007). Moreover, the
RANSAC algorithm is a robust parameter estimation method that was designed to work
with noisy datasets (Gallo et al., 2011). Therefore, the RANSAC algorithm was chosen for
roof plane extraction in this study to evaluate and improve its results. The RANSAC
algorithm iteratively estimates model parameters and seeks the best model in the data with
respect to predefined hypothesises. Since it first appeared in the computer vision
community, many improvements have been added to the algorithm for computer vision
problems. The most noteworthy effort has been performed by Torr and Zisserman (2000)
who added maximum likelihood estimation to the hypothesis generation (MLESAC) and
M-estimator sample consensus (MSAC) cost functions to enhance the quality of the result
instead of using a number of inliers. Nurunnabi et al. (2014) developed two algorithms
called diagnostic principal components analysis (PCA) (DetRD-PCA) and robust PCA
(DetRPCA) to fit a plane in point cloud data. The authors also compared their proposed
algorithm results with the well-known planar feature detection algorithms RANSAC, PCA
and modified sequential covering algorithm (MSCA). To test their algorithms, they used
terrestrial simulated data with outliers. They observed that their algorithms are robust to
outliers, compared with the other three algorithms, for extracting planar surfaces. A general
overview and comparison, in terms of robustness, accuracy and computational speed of
RANSAC-based methods in computer vision, is given in Choi et al. (2009).
While RANSAC initially appeared and has been enhanced for problems in computer
vision, it has been used and improved for lidar point cloud data in the geomatics literature.
Tarsha-Kurdi et al. (2007) improved its quality by adding standard deviation and a minimum
number of points to the cost function. Awwad et al. (2010) modified RANSAC by adding
normal vector comparison to increase the quality of the results. Chen et al. (2012) added
more control features to RANSAC for scoring point-to-plane contributions, normal vector
consistency, standard deviation check and localised sampling. Schnabel et al. (2007)
improved its efficiency in terms of performance and speed. Xu et al. (2016) defined a new

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 41
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

weighted function for scoring point-to-plane costs similar to the efforts of MLESAC and
MSAC but in the context of airborne lidar data. Kang et al. (2014) improved the RANSAC
algorithm by a conditional sampling method to choose initial datasets instead of random
sampling. They used a Bayesian sample consensus (BaySAC) algorithm for primitive
extraction, their improvements being the choice of initial data with the highest inlier
probability. The authors tested their approach with plane, torus and curved surface data,
finding that their approach is more efficient than the RANSAC algorithm for fitting
primitives.
In this study, a RANSAC enhancement for planar feature extraction is proposed.
RANSAC has the disadvantage of extracting planar features in continuous planimetric
space. In other words, RANSAC defines planar features with its feature model by the
equation of the plane; any points that are in the same planimetric space as the roof plane
are extracted as plane points. For instance, points on trees, antennas and cars might be
included as part of a roof while extracting roof planes with RANSAC; these points then
cause a problem in successful roof plane extraction (Carrilho and Galo, 2018; Dal Poz and
Yano, 2018). In this study, the authors contributed to the literature by removing outliers that
do not belong to the building roof plane extracted by the RANSAC algorithm from lidar
data. A novel algorithm is proposed (improved RANSAC, called I-RANSAC) to remove
outliers by clustering the extracted planar feature points by a region-growing method. The
I-RANSAC algorithm is an automatic method, and uses a threshold to check the distance of
planar points, in both the planimetric and vertical directions, to remove non-neighbouring
points successfully. I-RANSAC is a form of region-growing algorithm, and in the literature
some other region-growing algorithms have been adopted. For instance, Rabbani et al.
(2006) proposed a method for segmenting geometric primitives from point clouds. Their
algorithm is based on two parameters: the angle between a current seed point and the points
added to the region; and a threshold for residual values. These parameters are used in k-
nearest-neighbour and fixed-distance-neighbour variations. Their region-growing algorithm
starts from a seed point to segment features using the thresholds. In contrast, the proposed
I-RANSAC algorithm in this paper aims to eliminate non-planar points of the extracted
RANSAC plane, which are mathematically correct but spatially incorrect points belonging
to the planar feature. Although the I-RANSAC process is a region-growing method similar
to Rabbani et al. (2006), it uses one threshold which consists of only the distance and angle
between two points to fulfil its aim.

Methodology
The first part of I-RANSAC is the classification of the raw lidar data into ground and
non-ground points. Ground points are generally part of a planar feature (such as a road).
Therefore, removal of ground points from the raw data is crucial so that such points will not
be extracted as a planar feature in the second part of the methodology using the RANSAC
algorithm.
Ground and non-ground classification is simply carried out using the height information
of the lidar data points. Each point of the data was compared with (randomly selected) 10%
of the total points in advance. The signed distances in Z (height) are calculated from the
randomly selected points to the data point under investigation. If the number of negative
distance is greater than the number of positive distance then the point is labelled as a
ground point; otherwise it is a non-ground point. It should be noted that in this research the
area covered by the lidar data is not very large (62 m 9 56 m). Nevertheless, if the size of
the study area was much larger, then the area would be divided into windows to prevent

© 2019 The Authors


42 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

misclassification by the proposed classification algorithm. Otherwise, the proposed ground/


non-ground classification algorithm will not work, since randomly selected points are
compared with all other points in the area, and these points need to be in an area of a
similar type (such as land with a similar slope).
The second part of the methodology is the extraction of planar features using the
RANSAC algorithm run on the non-ground points classified in the previous step. RANSAC
uses the equation of a plane as a feature model and requires the following parameters to
extract planar features (Tarsha-Kurdi et al., 2007):

(1) A geometric model is needed to predict parameters, such as a plane or a sphere.


(2) The minimum number of points n required to define the model.
(3) The maximum number of iterations k.
(4) The threshold value t that a point has to comply with to fit the model.
(5) The minimum consensus threshold d.
In the RANSAC algorithm, first a minimum number of random points are selected to
define the geometric model of interest (a plane in this case). Parameters of the model
equation are calculated using the randomly selected points. Model parameters are applied to
all points, whether they fit the model or not. If the appropriate number of points is found
for the model to be defined, the parameters of the model and the error rate are calculated to
check whether the established model is the best one. The algorithm runs iteratively until the
best model is reached. In this study the feature model of interest is a plane, which can be
defined using at least three points by equation (1):

ax þ by þ cz þ d ¼ 0 ð1Þ

where a, b, c, d are the parameters of the plane and x, y, z denote the 3D coordinates of any
point.
In the final and most significant part of the methodology for this study, an algorithm was
proposed (I-RANSAC) to remove outliers from the features of the extracted roof plane by the
RANSAC algorithm. I-RANSAC starts with selecting a random point from the extracted roof
plane. Secondly, neighbouring points of the randomly selected point are searched and the
planimetric and height distances between the two are calculated. If the calculated distances
are less than the given threshold (equation (2)), then the neighbouring points are added as
cluster points to the randomly selected point (Fig. 1). If the distance between a neighbouring
point and the selected point is greater than the given threshold, then the neighbouring point is
assigned as a new cluster; that point also searches its neighbours. This process is a region-
growing algorithm since it starts with a single point and the clusters grow consecutively. The
I-RANSAC algorithm continues until no points are left in the extracted planar feature.
In the I-RANSAC algorithm, the important part is to define the thresholds for
segmenting points of the extracted planes. The two points (P1 and P2) are neighbours if the
planimetric and vertical distances between P1 and P2 are less than the defined threshold:
     
P1 P2 planimetric  ð1 þ vd Þd and P1 P2 vertical  ð1 þ vd Þ dtan / : ð2Þ

In Fig. 2 where P1 and P2 are neighbours, the vertical distance is the point’s height
differences, while planimetric distance is the Euclidean distance in the XY coordinate system
of the points.

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 43
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

FIG. 1. Flowchart of the I-RANSAC algorithm.

FIG. 2. Vertical and planimetric distances and their slope of two neighbouring points.

In the threshold equation (equation (2)), d and vd need to be given by the user
according to the nature of the dataset: d is the average planimetric distance between points
defined from flight planning (such as d = 50 cm); vd is the vertical distance between
neighbouring points; and a is the slope angle of the two points. The slope of the line
connecting the two points is calculated as:

dist:vertical
tan /¼ ¼ slope: ð3Þ
dist:plane

The I-RANSAC algorithm is illustrated using a sample extracted planar feature that
includes outliers to explain the algorithm visually and in more detail. Fig. 3 is an example

© 2019 The Authors


44 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

of a roof plane extracted by the RANSAC algorithm where outliers of the extracted plane
can be clearly seen.
Since the RANSAC algorithm extracts points using the equation of a plane, all points
with a distance less than a defined perpendicular point-to-plane threshold are extracted as
planar feature points. It can be seen that plane points have outliers and if the boundary of
this plane is drawn to include these outliers, it will not be correct. Therefore, these outliers
need to be removed to derive real plane boundaries. The I-RANSAC algorithm is capable of
overcoming such a problem. Fig. 4 shows the cluster of the extracted planar feature using
the I-RANSAC algorithm where different clusters are plotted in different colours. As
illustrated in Figs. 4(a) and (b), the roof plane is the segment with the most points. All the
other segments with a small number of points are drawn in red to highlight outlier points
(Fig. 4(c)).
Fig. 5(a) shows extracted roof plane results using the RANSAC algorithm. It can be
seen that there are outliers far removed from the main roof. Therefore, the plotted vertexes
of the plane are not correct as they encompass the outliers. After the I-RANSAC algorithm
was performed on the planes extracted by the RANSAC algorithm, the roof plane is now
more meaningful in shape as can be seen in Fig. 5(b) where it can be readily observed that
outliers were successfully removed using I-RANSAC.
The proposed methodology was first tested with four roofs, which have between one
and four distinct roof planes. Then, two more datasets were analysed, which included, rather
than single buildings, at least four buildings and five roof planes. To evaluate the results,
qualitative quality control was performed by visual inspection of the results. Quantitative
quality assessment was conducted by calculating the precision, recall and F-score (F-
measure) (equations (4) to (6)) using the ortho-images from Google. Firstly, building roof
boundaries were manually digitised using the free and open-source desktop geographic
information system QGIS. The roof plane points from both RANSAC and I-RANSAC were
compared with the reference QGIS boundaries. The extracted plane points are counted as
either inside or outside the QGIS boundary and from the results the precision P, recall R
and F-score were calculated as follows:

TP
P ¼ Precision ¼ ð4Þ
TP þ FP

FIG. 3. An example of a building's extracted roof plane with its outliers from lidar data using the RANSAC
algorithm. Left: isometric view. Right: view with depth (Y) greatly foreshortened.

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 45
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

FIG. 4. Segmentation of the extracted building's roof planar feature by the I-RANSAC algorithm. (a) Isometric
view. (b) View with depth (Y) greatly foreshortened. (c) Roof in blue and outliers in red.

FIG. 5. (a) The RANSAC boundary defined by the roof plane with outliers by the convex hull. (b) The
I-RANSAC boundary of the roof plane after removing outliers.

TP
R ¼ Recall ¼ ð5Þ
TP þ FN
PR
F–score = 2 ð6Þ
PþR

where TP (true positives) is the number of points common to the manually extracted
building boundary and either RANSAC or I-RANSAC; FN (false negatives) is the number
of points that should be inside the roof plane boundary but are not extracted by either
RANSAC or I-RANSAC (as appropriate); and FP (false positives) is the number of points
that were extracted by either RANSAC or I-RANSAC but they are not located inside the
roof plane boundary.

Results and Discussion


It has already been noted that the proposed I-RANSAC algorithm for removing outliers
from planar features extracted using the RANSAC algorithm was first tested with four

© 2019 The Authors


46 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

individual buildings (termed Building 1 to Building 4) and then using two areas in the USA
and Germany with multiple buildings.

Testing with Four Individual Buildings


The first building (Building 1) has four distinct planar features forming its roof; the
second building (Building 2) has two roof plane surfaces; the third building (Building 3)
has a single separate roof plane forming its roof; and the last building (Building 4) has a
roof consisting of two planar surfaces. The detailed information for the lidar data is given in
Table I. Before extracting the planar features, the raw data is classified as either ground or
non-ground points by simply using the height information of the points. Roof plane
extraction was employed by only using the non-ground points. The planar features of the
buildings’ roofs were extracted using RANSAC. Since the RANSAC algorithm extracts
planar features in infinite planimetric space, the planes have outlier points from different
objects such as trees, bushes and electricity cables. The outliers of the extracted planar
features of the buildings were removed using the I-RANSAC algorithm. The results are
represented in detail in Figs. 6–9.

Building 1: Hip Roof (Four Planes). Fig. 6 represents the Building 1 lidar dataset.
Fig. 6(a) shows the raw data before any processing. Fig. 6(b) shows the classified ground
and non-ground points of the data. Fig. 6(c) depicts the RANSAC plane extraction results of
the building roof from the non-ground data. Different planes of the roof are plotted in
distinct colours. As can be seen in Fig. 6(c), the purple and red planar features have some
outliers at a different level. After the I-RANSAC algorithm was performed for these roof
planes, these outliers were removed (Fig. 6(d)). Figs. 6(e) and (f) show the results of the
RANSAC and I-RANSAC algorithms superimposed on the ortho-images from Google; it is
clearly seen that the I-RANSAC algorithm has removed the outliers that mainly result from
trees on the opposite side of the street that exist on the extension of the roof planes with the
RANSAC algorithm.

Building 2: Gable Roof (Two Planes). The analysis of Buildings 2 to 4 follows a


similar format as Building 1. The raw data of the Building 2 lidar points are given in
Fig. 7(a) while ground and non-ground separation are illustrated in Fig. 7(b). Using only the
non-ground points, the building’s roof planar features were extracted (Fig. 7(c)) and the
outliers resulting from other objects not belonging to the roof plane were removed using the
I-RANSAC algorithm: Fig. 7(d) clearly shows that the I-RANSAC algorithm is able to clear
the outliers from RANSAC’s extended planar space. The extracted planar features are
overlaid on an ortho-image shown in Figs. 7(e) and (f) where again the I-RANSAC
algorithm was able to clean outliers remaining from the RANSAC algorithm. After the
I-RANSAC algorithm was performed, there is a gap between the two faces of the building
roof. This occurred because there is a line of metallic tiles above much of the roof ridge,

Table I. Details of the four lidar datasets for Buildings 1 to 4.


Name Building 1 Building 2 Building 3 Building 4
Number of points 6458 18 843 22 380 16 230
Number of roof planes 4 2 1 2
Point density (points/m2) 481 543 740 557
Approx. roof size 28 m 9 48 m 62 m 9 56 m 48 m 9 63 m 41 m 9 71 m

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 47
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

FIG. 6. Building 1. (a) Raw data. (b) Ground point and non-ground point classified data. (c) Planar features
extracted by the RANSAC algorithm. (d) Planar features extracted by the I-RANSAC algorithm. (e) RANSAC
planar features superimposed on Google ortho-image. (f) I-RANSAC planar features superimposed on Google
ortho-image.

which are higher than the roof plane; lidar points from this feature do not belong to either
of the two pitched roof planes.

Building 3: Flat Roof (Single Plane). Building 3 has a single planar feature forming
its roof. The raw data has ground and non-ground points (trees, buildings) (Fig. 8(a)). Non-
ground points were classified and used for planar feature extraction (Fig. 8(b)). Using only
non-ground points, the planar feature was extracted by the RANSAC algorithm (Fig. 8(c))
and the outliers present were removed by I-RANSAC (Fig. 8(d)) to define the roof plane
accurately. By superimposing the RANSAC result on the Google ortho-image (Fig. 8(e)), it

© 2019 The Authors


48 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

FIG. 7. Building 2. (a) Raw data. (b) Ground point and non-ground point classified data. (c) Planar features
extracted by the RANSAC algorithm. (d) Planar features extracted by the I-RANSAC algorithm. (e) RANSAC
planar features superimposed on Google ortho-image. (f) I-RANSAC planar features superimposed on Google
ortho-image.

can be easily seen that even the noisy points far away from the roof plane are classified as
points belonging to the plane since these points fit the plane equation and its parameters,
having a smaller perpendicular distance to the plane than the given threshold. Such points
are eliminated in Fig. 8(f).

Building 4: Gable Roof (Two Planes). Like Building 2, the final single building of
this study has two different planar features forming its roof. The raw data in Fig. 9(a) is

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 49
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

FIG. 8. Building 3. (a) Raw data. (b) Ground point and non-ground point classified data. (c) Planar features
extracted by the RANSAC algorithm. (d) Planar features extracted by the I-RANSAC algorithm. (e) RANSAC
planar features superimposed on Google ortho-image. (f) I-RANSAC planar features superimposed on Google
ortho-image.

classified into ground and non-ground points (Fig. 9(b)) but it can be seen that trees and
bushes form a significant part of the non-ground data. The two planar features were
extracted by RANSAC (Fig. 9(c)) but were abundant in outliers; these were removed using
the I-RANSAC algorithm (Fig. 9(d)). Two extracted planar features of Building 4 are
represented in Figs. 9(e) and (f) on the ortho-image from Google. When the planar features

© 2019 The Authors


50 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

FIG. 9. Building 4. (a) Raw data. (b) Ground point and non-ground point classified data. (c) Planar features
extracted by the RANSAC algorithm. (d) Planar features extracted by the I-RANSAC algorithm. (e) RANSAC
planar features superimposed on Google ortho-image. (f) I-RANSAC planar features superimposed on Google
ortho-image.

are inspected closely, the outliers are seen as red points that are on trees but the I-RANSAC
algorithm accurately detects these outliers.
Building roof plane boundaries were manually digitised using QGIS Desktop (version
2.18.18); using the extracted boundaries, the results of both the RANSAC and I-RANSAC
algorithms were evaluated by calculating the precision, recall and F-score (Table II).
According to the quality control results, it can be stated that the I-RANSAC algorithm
produces a more reliable result than RANSAC alone for extracting building roof planes

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 51
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

Table II. Quantitative quality control results and total number of outliers for the roof planes of Buildings 1 to 4.
Dataset Plane No. of outliers I-RANSAC RANSAC

Precision Recall F-meas. Precision Recall F-meas.


Building 1 Plane 1 92 0971 0991 0981 0741 0885 0846
Plane 2 22 0963 0987 0975 0934 0990 0961
Plane 3 17 0990 0992 0996 0928 0982 0954
Plane 4 49 0991 0982 0986 0772 0988 0866
Summary 180 0979 0988 0984 0844 0961 0907
Building 2 Plane 1 234 0990 0994 0995 0904 0951 0947
Plane 2 140 0990 1000 0999 0940 0984 0961
Summary 374 0990 0997 0997 0922 0967 0954
Building 3 Plane 1 192 0973 0999 0986 0937 0989 0963
Summary 192 0973 0999 0986 0937 0989 0963
Building 4 Plane 1 334 0920 0990 0958 0811 0997 0894
Plane 2 330 0990 0990 0994 0791 0998 0883
Summary 664 0955 0990 0976 0801 0990 0888
“Summary” shows either the total number of outliers or the precision, recall and F-score averages (in bold).

from lidar data. It should be noted that if the outlier points, which are not within the plane
boundary but satisfy the same planimetric equation as the roof plane, are too numerous then
the accuracy of the RANSAC algorithm will be worse.

Testing on Two Datasets with Multiple Buildings


After analysing the result of the I-RANSAC algorithm with single buildings, two larger
areas with a higher number of buildings and their roof planes were studied. The first
dataset, termed Area 1, was selected from the Indiana, USA lidar dataset, which was
obtained from the OpenTopography Facility with support from the National Science
Foundation (OpenTopography, 2018). The second dataset, termed Area 2, is from
Vaihingen, Germany; it was downloaded from the ISPRS (2018) test project on urban
classification and 3D building reconstruction. The same steps as with Buildings 1 to 4 were
performed.
Area 1: Indiana, USA. The first dataset, Indiana, has five building roof planes. The
classification of ground and non-ground points of the Indiana lidar data area is shown in
Fig. 10(a) and using only non-ground points, the planar features were extracted by the
RANSAC algorithm: Fig. 10(b) is a 3D view of the RANSAC result where it can be seen
that the RANSAC algorithm extracts planar features with many outliers. Fig. 10(c)
superimposes the results on a Google ortho-image where the outliers of the roof planes are
highlighted with red ellipses. After applying the I-RANSAC algorithm, the outliers were
removed from the roof planes and reliable results were acquired (Fig. 10(d)).
Area 2: Vaihingen, Germany. Another study area was chosen from the Vaihingen
dataset of ISPRS (2018), which has been used in many photogrammetric building studies
(for example, Wang et al., 2018). In the selected study area, there are six large building roof
planes. One of the most important parameters for the RANSAC algorithm is the minimum
number of plane points required to extract planes. In this study, this parameter was chosen
as 100. Therefore, some of the small planes were not extracted by the RANSAC algorithm
since their total number of points was less than this threshold. However, larger-sized roof
planes were extracted by RANSAC. Following the usual procedure in this study, the data
were firstly classified into ground and non-ground classes (Fig. 11(a)) and then, using

© 2019 The Authors


52 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

FIG. 10. Area 1 (Indiana, USA) dataset using five building roof planes. (a) Ground and non-ground
classification result. (b) The RANSAC algorithm results. (c) RANSAC results overlaid on ortho-image with
outliers highlighted with red ellipses. (d) I-RANSAC algorithm result on ortho-image.

non-ground points, the RANSAC algorithm was performed to extract the planes of the
building roofs (Fig. 11(b)). With the RANSAC results, these roof planes have outliers
produced from trees and other object points that are in the continuous extended space of the
roof planes (Fig. 11(c)). It can also be noticed that some of the building roof planes were
not extracted by the RANSAC algorithm by looking at the overlay of the extraction results
on Google imagery (Fig. 11(c)). The reason behind the missing roof planes might be that
there are new buildings that were built after the lidar data was gathered. To perform
qualitative quality control, the results overlaid onto the Google maps imagery (Figs. 11(c)
and (d)) clearly show that the results of the I-RANSAC algorithm are reliable and do not
contain any outliers. Another issue is that the RANSAC algorithm extracted the two roofs
adjacent to, and either side of, the red building’s roof (the two purple planes near the red
building plane in Fig. 11(c)) as part of the same roof. With I-RANSCAC, points on the
smaller of the two purple roofs are recognised as outliers of the bigger purple roof plane
and, therefore, the smaller roof is missing in Fig. 11(d).
For the Indiana and Vaihingen datasets, quality control results were estimated and
given in Table III for both the RANSAC and I-RANSAC algorithms. The precision,
recall and F-score estimates for I-RANSAC were greater than 093, 081 and 088,
respectively, which indicates the robustness of the I-RANSAC algorithm results.
However, the RANSAC algorithm produces lower quality results concerning the reliable
extraction of roof planes.

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 53
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

FIG. 11. Area 2 (Vaihingen, Germany) dataset with multiple building roof planes. (a) Ground and non-ground
classification result. (b) and (c) The RANSAC algorithm results. (d) The I-RANSAC algorithm result.

Table III. Quantitative quality control results for the Area 1 (Indiana) and Area 2 (Vaihingen) data.
Data Building Plane No. of outliers I-RANSAC RANSAC

Precision Recall F-score Precision Recall F-score


Area 1 Building 1 Plane 1 63 0999 0998 0999 0968 0994 0981
Building 2 Plane 2 347 0941 0996 0967 0640 0966 0770
Building 3 Plane 3 12 0996 0992 0994 0983 0983 0983
Building 4 Plane 4 64 0972 0811 0885 0813 0761 0837
Building 5 Plane 5 19 0998 0965 0981 0965 0958 0962
Summary 505 0981 0952 0965 0874 0932 0907
Area 2 Building 1 Plane 1 243 0934 0994 0963 0824 0799 0960
Building 2 Plane 2 358 0932 0992 0961 0818 0974 0889
Plane 3 580 0959 0990 0977 0381 0802 0517
Building 3 Plane 4 360 0990 0990 0990 0448 0789 0571
Building 4 Plane 5 39 0988 0995 0991 0941 0990 0965
Building 5 Plane 6 80 0990 0990 0990 0857 0976 0913
Summary 1660 0969 0992 0981 0711 0888 0802
“Summary” shows either the total number of outliers or the averages of the precision, recall and F-score (in bold).

Conclusions
Building roof plane extraction with an acceptable accuracy level is crucial to define
building locations. One of the most popular planar feature extraction algorithms is RANSAC.

© 2019 The Authors


54 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

Even though the RANSAC algorithm is good at extracting planar features from 3D point
data, it usually extracts planes with outliers if the data is noisy and there are object points
that conform with the roof plane’s equation. Therefore, a novel algorithm called the
I-RANSAC algorithm is proposed in this paper to remove outlier points from the extracted
planar features of the RANSAC algorithm. The I-RANSAC enhancement algorithm was
tested with six different datasets. With the RANSAC algorithm’s results, there were outlier
points for all the tested data samples, varying between 12 and 580 points that did not belong
to the roof planes. It should be noted that the number of outliers can be fewer or greater
according to the point density of the lidar data and the abundancy of object points that
conform with the same equation as a roof plane. The I-RANSAC algorithm was evaluated by
calculating the precision, recall and F-score values. The mean of these accuracy values for all
the tested roof planes were, respectively, 097, 098 and 097 for I-RANSAC and 082, 093
and 088 for RANSAC. According to these quality control results, it can be stated that the
I-RANSAC algorithm provides a more reliable result for the extraction of building roof
planes from lidar data. A limitation of the I-RANSAC algorithm is that the algorithm is not
fully automatic since its two parameters (d, which is the average distance between the lidar
points, as defined from the flight planning; and vd, which is the vertical distance between
neighbouring points) should be assigned to the program by the user. Current and future
research will focus on making the algorithm fully automatic and testing the I-RANSAC
algorithm over larger areas with a more complex urban environment and denser data.

Acknowledgements
This study was part of the author Sibel Canaz Sevgen’s Ph.D. dissertation at Karadeniz
Technical University.

REFERENCES

Awrangjeb, M. and Fraser, C. S., 2014. Automatic segmentation of raw LIDAR data for extraction of
building roofs. Remote Sensing, 6(5): 3716–3751.
Awwad, T. M., Zhu, Q., Du, Z. and Zhang, Y., 2010. An improved segmentation approach for planar
surfaces from unstructured 3D point clouds. Photogrammetric Record, 25(129): 5–23.
Cao, R., Zhang, Y., Liu, X. and Zhao, Z., 2017. Roof plane extraction from airborne LiDAR point clouds.
International Journal of Remote Sensing, 38(12): 3684–3703.
Carrilho, A. C. and Galo, M., 2018. Extraction of building roof planes with stratified random sample
consensus. Photogrammetric Record, 33(163): 363–380.
Chen, D., Zhang, L., Li, J. and Liu, R., 2012. Urban building roof segmentation from airborne LiDAR point
clouds. International Journal of Remote Sensing, 33(20): 6497–6515. https://doi.org/10.1080/01431161.
2012.690083
Choi, S., Kim, T. and Yu, W., 2009. Performance evaluation of RANSAC family. British Machine Vision
Conference, London, UK. Pages 355–361.
Dal Poz, A. P. and Yano, M. S., 2018. RANSAC-based segmentation for building roof face detection in lidar
point cloud. IEEE International Geoscience and Remote Sensing Symposium, Valencia, Spain. Pages 1276–
1279.
Filin, S. and Pfeifer, N., 2006. Segmentation of airborne laser scanning data using a slope adaptive
neighborhood. ISPRS Journal of Photogrammetry and Remote Sensing, 60(2): 71–80.
Fischler, M. A. and Bolles, R., 1981. Random sample consensus: a paradigm for model fitting with
applications to image analysis and automated cartography. Communications of the ACM, 24(6): 381–395.
Flood, M., 2001. Laser altimetry: from science to commercial LIDAR mapping. Photogrammetric Engineering
& Remote Sensing, 67(11): 1209–1217.
Gallo, O., Manduchi, R. and Rafii, A., 2011. CC-RANSAC: fitting planes in the presence of multiple
surfaces in range data. Pattern Recognition Letters, 32(3): 403–410.
Hough, P. V. C., 1962. Method and means for recognizing complex patterns. U.S. Patent 3 069 654.

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 55
CANAZ SEVGEN and KARSLI. An improved RANSAC algorithm for extracting roof planes from airborne lidar data

ISPRS, 2018. ISPRS Test Project on Urban Classification and 3D Building Reconstruction. http://www2.isprs.
org/commissions/comm3/wg4/detection-and-reconstruction.html [Accessed: 1st November 2018].
Kang, Z., Zhang, L., Wang, B., Li, Z. and Jia, F., 2014. An optimized baySAC algorithm for efficient
fitting of primitives in point clouds. IEEE Geoscience & Remote Sensing Letters, 11(6): 1096–1100.
Lari, Z. and Habib, A., 2014. An adaptive approach for the segmentation and extraction of planar and
linear/cylindrical features from laser scanning data. ISPRS Journal of Photogrammetry and Remote Sensing,
93: 192–212.
Lefsky, M. A., Cohen, W. B., Parker, G. G. and Harding, D. J., 2002. Lidar remote sensing for
ecosystem studies. BioScience, 52(1): 19–30.
Nurunnabi, A., Belton, D. and West, G., 2014. Robust statistical approaches for local planar surface fitting
in 3D laser scanning data. ISPRS Journal of Photogrammetry and Remote Sensing, 96: 106–122.
OpenTopography, 2018. 2011–2013 Indiana Statewide Lidar. http://opentopo.sdsc.edu/lidarDataset?
opentopoID=OTLAS.062012.4326.1 [Accessed: 1st November 2018].
Pot
uckova  , M. and Hofman, P., 2016. Comparison of quality measures for building outline extraction.
Photogrammetric Record, 31(154): 193–209.
Rabbani, T., van den Heuvel, F. A. and Vosselman, G., 2006. Segmentation of point clouds using
smoothness constraint. International Archives of Photogrammetry, Remote Sensing and Spatial Information
Sciences, 36(5): 248–253.
Sampath, A. and Shan, J., 2010. Segmentation and reconstruction of polyhedral building roofs from aerial
lidar point clouds. IEEE Transactions on Geoscience and Remote Sensing, 48(3): 1554–1567.
Satari, M., Samadzadegan, F., Azizi, A. and Maas, H.-G., 2012. A multi-resolution hybrid approach for
building model reconstruction from lidar data. Photogrammetric Record, 27(139): 330–359.
Schnabel, R., Wahl, R. and Klein, R., 2007. Efficient RANSAC for point-cloud shape detection. Computer
Graphics Forum, 26(2): 214–226.
Tarsha-Kurdi, F., Landes, T. and Grussenmeyer, P., 2007. Hough-transform and extended RANSAC
algorithms for automatic detection of 3D building roof planes from lidar data. International Archives of
Photogrammetry, Remote Sensing and Spatial Information Sciences, 36(3/W52): 407–412.
Tomljenovic, I., Tiede, D. and Blaschke, T., 2016. A building extraction approach for airborne laser
scanner data utilizing the object based image analysis paradigm. International Journal of Applied Earth
Observation and Geoinformation, 52: 137–148.
Torr, P. H. S. and Zisserman, A., 2000. MLESAC: a new robust estimator with application to estimating
image geometry. Computer Vision and Image Understanding, 78(1): 138–156.
Wang, L., Zhao, Y. and Li, Y., 2018. A greyscale voxel model for airborne lidar data applied to building
detection. Photogrammetric Record, 33(164): 470–490.
Xu, S., Oude Elberink, S. and Vosselman, G., 2012. Entities and features for classification of airborne laser
scanning data in urban area. International Annals of Photogrammetry, Remote Sensing and Spatial
Information Sciences, 1(4): 257–262.
Xu, B., Jiang, W., Shan, J., Zhang, J. and Li, L., 2016. Investigation on the weighted RANSAC approaches
for building roof plane segmentation from LiDAR point clouds. Remote Sensing, 8(1): article 5. 23 pages.
Zhang, C., He, Y. and Fraser, C. S., 2018. Spectral clustering of straight-line segments for roof plane
extraction from airborne LiDAR point clouds. IEEE Geoscience and Remote Sensing Letters, 15(2): 267–
271.

Resume
L’extraction de toits plans de b^atiments est devenue un sujet de recherche repandu, l’algorithme RANSAC
(random sample consensus) etant l’un des plus communement adoptes. RANSAC extrait des plans entiers, ce
qui pose probleme lorsque d’autres points sont presents a l’exterieur des limites du plan tout en faisant partie
de l’espace du plan. Cette etude propose un algorithme RANSAC ameliore (I-RANSAC) qui consiste a eliminer
les points n’appartenant pas au plan du toit. I-RANSAC selectionne aleatoirement un point du toit plan extrait,
puis cherche ses voisins dans une limite predefinie pour identifier et eliminer les points aberrants. Ce nouvel
algorithme a ete teste sur quatorze b^atiments dans deux jeux de donnees et les mesures effectuees por le
ole de qualite ont montre une amelioration significative par rapport a l’algorithme RANSAC standard.
contr^

© 2019 The Authors


56 The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd
The Photogrammetric Record

Zusammenfassung
Die Extraktion von Dachfl€achen aus Lidardaten ist ein popul€ares Forschungsthema, wobei dem RANSAC
Methode eine zentrale Bedeutung zukommt. Mit RANSAC lassen sich ganze Ebenen extrahieren, was
problematisch ist, wenn Punkte außerhalb der Begrenzungslinie der Dachebene, aber in der Ebene selbst
liegen. Diese Studie schl€agt einen verbesserten RANSAC Algorithmus (I-RANSAC) vor, der Punkte entfernt, die
nicht zur Dachebene geh€oren. Mit I-RANSAC wird zuf€allig ein Punkt der extrahierten Dachebene ausgew€ahlt
und nach seinen Nachbarn in einem vorgegebenen Umfeld gesucht, um Ausreißer zu identifizieren und zu
eliminieren. Der neue Algorithmus wurde an 14 Geb€auden aus zwei Datens€atzen getestet, wobei die
verwendeten Qualit€ atskontrollen eine signifikante Verbesserung gegen€uber dem Standard RANSAC Ansatz
zeigen.

Resumen
La extracci
on de planos de tejado de edificios a partir de datos LIDAR se ha convertido en un tema de
investigacion popular, siendo el consenso por muestreo aleatorio (RANSAC) uno de los algoritmos adoptados
con m as frecuencia. RANSAC extrae planos completos, lo cual es problematico cuando hay puntos fuera del
lımite del tejado pero dentro del plano. Este estudio propone un algoritmo RANSAC mejorado (I-RANSAC),
eliminando puntos que no pertenecen al plano del tejado. I-RANSAC selecciona aleatoriamente un punto del
plano del tejado extraıdo y luego busca entre sus vecinos dentro de un umbral determinado para identificar y
eliminar los valores atıpicos. El nuevo algoritmo se probo con catorce edificios de dos conjuntos de datos,
donde las medidas de control de calidad mostraron una mejora significativa con respecto al RANSAC estandar.

摘要
由激光点云数据中提取建筑物屋顶平面是一个常见的研究课题, 而随机抽样一致性算法(RANSAC)是
最常采用的算法之一。RANSAC提取整个平面, 而当平面边界之外的其他点也在平面空间内时, 则会产生问
题。本研究提出一种改进的RANSAC(I–RANSAC)算法, 在过程中移除不属于屋顶平面的点。I–RANSAC由所
提取的屋顶平面中选择一个随机点, 然后在给定范围内搜索其领域, 以找出并移除异常值。aa新算法使用
两个数据集中的十四栋建筑物进行测试, 由质量评估控制指标显示本文所提出的算法较标准RANSAC有显
著改进。

© 2019 The Authors


The Photogrammetric Record © 2019 The Remote Sensing and Photogrammetry Society and John Wiley & Sons Ltd 57

You might also like