identifying curviness of overpass mountain roads from remote … · 2007-05-08 · curvy roads are...

67
Identifying Curviness of Overpass Mountain Roads from Remote Sensing Data Sahar Alian March, 2007

Upload: others

Post on 08-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Identifying Curviness of OverpassMountain Roads from Remote

Sensing Data

Sahar Alian

March, 2007

Page 2: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying
Page 3: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Identifying Curviness of Overpass MountainRoads from Remote Sensing Data

by

Sahar Alian

Thesis submitted to the International Institute for Geo-information Science andEarth Observation in partial fulfilment of the requirements for the degree ofMaster of Science in Geo-information Science and Earth Observation, Speciali-sation: Geoinformatics.

Thesis Assessment BoardThesis advisor ITC Dr. V.A. Tolpekin

Ms. Dr. Ir. W. BijkerW. H. Bakker, M.Sc.

Thesis advisor KNTU Dr. M.J. Valadan ZoejM. Mokhtarzade

Assessment Board chair Prof. Dr. A. Stein

Thesis examiners Dr. Ir. B.G.H. GorteDr. S. Mesgari

INTERNATIONAL INSTITUTE FOR GEO-INFORMATION SCIENCE AND EARTH OBSERVATION

ENSCHEDE, THE NETHERLANDS

K. N. TOOSI UNIVERSITY OF TECHNOLOGY

TEHRAN, IRAN

Page 4: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Disclaimer

This document describes work undertaken as part of a programme of study atthe International Institute for Geo-information Science and Earth Observation(ITC). All views and opinions expressed therein remain the sole responsibilityof the author, and do not necessarily represent those of the institute.

Page 5: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Abstract

Curvy roads are important subjects for many applications, because oftheir spatial geometry. Digital curve identification is easier from continu-ous objects than from discrete objects, such as roads extracted from remotesensing data. Use of high spatial resolution images can lead to an increasein the accuracy of the detection , and it also gives the possibility to detectcurvy segments from the road boundary. I determined the road as a curvein 2-D space, using road boundary detection for shape estimation. Alphashapes were used for boundary identification because of their flexibility toproduce different object boundaries. The obtained boundary is a polygonthat was used for identification of curvy road segments. Two simple ap-proaches were used for identifying curviness: Choosing a small window forretrieving information, one can either measure curviness parameters (sin-gle angle and deviation of a point from a straight line) in all the points inthe window (approach (I)) or measure just one value in the midpoint, be-tween the start, the middle and the end point of the window to decreasethe noise (approach (II)). Both methods use a fixed size of moving windowto decrease the noise, while in approach (I) accumulated angle was used foradditional noise reduction. Because of the use of alpha shapes, the methodis capable of identifying curves in data of different quality and spatial reso-lution, although a decrease in quality will lead to an increase in the radiusof alpha shape circles, and therefore a decrease in the chance of detectingsharp and narrow curvy segments. Because the method can use data ofdifferent quality, it can be used for different applications.

Keywordsroad detection, alpha shapes, curves, remote sensing

i

Page 6: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Abstract

ii

Page 7: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Contents

Abstract i

List of Figures v

Acknowledgements vii

1 Introduction 11.1 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3.1 Road Detection from Remote Sensing Images . . . . . . . 31.3.2 Shape estimation and analysis of digital curves . . . . . 31.3.3 Scope of work . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.4 Thesis organization . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Study area, data and software used 72.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Study area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4 Software used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Methodology 113.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Road detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.2.1 Subsetting . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2.2 Fuzzy c-means classification . . . . . . . . . . . . . . . . . 123.2.3 Binary image . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3 Object boundary detection . . . . . . . . . . . . . . . . . . . . . . 133.3.1 Alpha shapes . . . . . . . . . . . . . . . . . . . . . . . . . . 143.3.2 Alpha shapes for boundary identification . . . . . . . . . 143.3.3 Steps of using alpha shapes for road boundary identifica-

tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.4 Curve identification methods . . . . . . . . . . . . . . . . . . . . 16

3.4.1 Angle, a parameter for defining curvature . . . . . . . . . 163.4.2 Approach I: local curvature measurement in all the ver-

tices of a window . . . . . . . . . . . . . . . . . . . . . . . 17

iii

Page 8: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Contents

3.4.3 Approach II: Identifying local curviness in the midpoint ofa window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.4.4 Visualizing the results . . . . . . . . . . . . . . . . . . . . 193.4.5 Using curve identification methods for comparing road bound-

aries detected by different data qualities and different amountsof α . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.4.6 Method adapted in a diagram . . . . . . . . . . . . . . . . 20

4 Result and Discussion 214.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.2 Result of road detection . . . . . . . . . . . . . . . . . . . . . . . . 21

4.2.1 Subsetting . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.2.2 Fuzzy c-means classification method . . . . . . . . . . . . 214.2.3 Binary image . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.3 Alpha shape implementation and results . . . . . . . . . . . . . 234.4 Comparison of approach I and II for α-shape circles with r=2 . . 25

4.4.1 Effect of using approach II, on decreasing the noise . . . 274.5 Using different radiuses to detect boundary . . . . . . . . . . . 284.6 Experiment on binary image by Threshold=255 . . . . . . . . . . 31

4.6.1 Results of α-shapes . . . . . . . . . . . . . . . . . . . . . . 314.6.2 Results of curve identification methods . . . . . . . . . . 33

4.7 Effect of changing moving window size . . . . . . . . . . . . . . . 344.8 Effect of changing threshold . . . . . . . . . . . . . . . . . . . . . 354.9 Effect of using sign angle . . . . . . . . . . . . . . . . . . . . . . . 36

4.9.1 Using the same measurement parameter . . . . . . . . . 364.10 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5 Conclusions and recommendations 435.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435.2 Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Bibliography 45

A Alpha shape MATLAB code for object boundary identification 47

B Python code for finding high curvy pints based on angle 49

C Python code for finding high curvy points based on distance 53

iv

Page 9: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

List of Figures

2.1 Lavasan in shown in map of Iran . . . . . . . . . . . . . . . . . . 82.2 Multi Spectral IKONOS image from Lavasan in Iran . . . . . . 9

3.1 Example of the 2-D α-shape . . . . . . . . . . . . . . . . . . . . . 143.2 Methods used for curviness identification in the road . . . . . . 20

4.1 140× 290 subset of MS image . . . . . . . . . . . . . . . . . . . . 224.2 Road class, classified by fuzzy c-means . . . . . . . . . . . . . . . 224.3 cleaned grey scale image . . . . . . . . . . . . . . . . . . . . . . . 234.4 Different binary images . . . . . . . . . . . . . . . . . . . . . . . 244.5 different size α-circles . . . . . . . . . . . . . . . . . . . . . . . . 254.6 road detected by α-shapes . . . . . . . . . . . . . . . . . . . . . . 264.7 curviness change in road boundary . . . . . . . . . . . . . . . . . 274.8 visualizing curvy segments . . . . . . . . . . . . . . . . . . . . . . 284.9 Effect of segmentation on decreasing the noise . . . . . . . . . . 294.10 curviness identification on different α-boundarie . . . . . . . . . 304.11 visualizing curvy segments on different α-boundaries . . . . . . 314.12 α-circles around the data with low quality . . . . . . . . . . . . . 324.13 α-shapes result on low quality binary image . . . . . . . . . . . 334.14 curvature change on roads by different data qualities . . . . . . 354.15 curvy segments derived from different data qualities . . . . . . 364.16 changing moving window size . . . . . . . . . . . . . . . . . . . . 374.17 highest curvy segment of road . . . . . . . . . . . . . . . . . . . . 384.18 effect of measuring sign . . . . . . . . . . . . . . . . . . . . . . . 384.19 radius and curvature measurement . . . . . . . . . . . . . . . . . 39

v

Page 10: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

List of Figures

vi

Page 11: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Acknowledgements

Thanks GODThis thesis is the result of 2 years patient for starting the course, 6 months staying farfrom the family and new and sweet experience of finding new friends, get familiar withnew cultures and having the opportunity to learn more in new field of science.

I will be eternally grateful to Valentyn Tolpekin for his patient, useful guides and greatcomments. He thought me a lot. I don’t know how should I thank him.

I owe a lot to Wietske Bijker for her critical and informative comments specially inthe second period of the thesis.

My special thanks to Wim Bakker because of his technical support for learning Pythonand helping me in using new techniques in the second period of my thesis.

I have to thank Sander Oude Elberink for his useful guids for learning Matlab.

My sincere thanks to all ITC and KNTU staff specially Professor Stein and Mr. Hu-urneman chairman and program director of earth observation science department inITC and Dr. vosoughi head of JKIP programm in Iran for all he did for this program,my first and second supervisors in Iran Dr valadan Zoej and Mr. Mokhtarzade for theirsupport and preparing data for this research and they useful guides. I have to thankDr. sharifi in ITC and NCC managers in Iran for guiding me to find data. I want tothank all the KNTU lecturers for all I have learnt from them.

I am thankful to all my friends in JKIP program and all my fellows and GFM2 stu-dents specially adam for all they tought me.

I want to thank all the Iranians in Enschede for their kinds and supports.

My heartful gratitude goes two my dear parents and my lovely sisters for all theirmoral and financial supports and kinds. You did the best for me.

Last but not least: Hesam my dear and lovely husband without your love your pa-tient and your supports I wasn’t able to stay 6 months far from you and home. Thankyou for every thing. I love you.

vii

Page 12: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Acknowledgements

viii

Page 13: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 1

Introduction

1.1 Problem definition

Road infrastructure is a parameter that can describe factors causing differenteconomical and health problems. Curvy roads like overpass mountain roadslead to more financial problems than straight roads because of their spatialcharacteristics. For example, curves in roads are the places where more acci-dents may happen than in straight parts of roads. Also, curves in a road appearto be attractive for depositing house garbage. Except car accidents, curvy roadsare interesting and main parameter for road engineers because of their impor-tant rule on road design specially in mountainous areas. Moreover, identifyingcurvy parts and finding points with highest curvature in each curvy part canbe used for different applications such as putting traffic signs in risky parts ofroad and computing the time for traveling from one destination to the other onefor route planners. Finding the spatial characteristics of curvy roads and theirparameters may thus be useful for determining different events in mountainareas [28].

Iran has many mountainous areas and most of roads in these areas are curvy.Of particular interest are mountain overpass roads, i.e. those roads that beginin a valley, rise to the overpass between two mountain peaks, and then descendtowards another valley. Statistics shows that many accidents happen each dayin these areas so it makes it more interesting to work in this area.

The geometry of curves in roads, coastlines and rivers is similar. The similaritybetween the structures of these three different areas can help us to expand theresults and use it in future in different applications and also use the researchesthat have been done in mentioned areas before.

The main cause for curviness is the terrain structure, determined by the ge-ology and road development requirements. Curviness presents itself in variousshapes, different angles and diverse directions. Modern ways of geo-informationnow allow making a quantitative assessment of roads. Starting from road de-tection from high resolution images, we can identify curves in the detected roadfrom its parameters and detect high curvature points in roads.

1

Page 14: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

1.2. Objectives

One of the main issues in this research is working on discrete digital objects.Many studies focused on identifying curves from continuous objects, but identi-fying an object from raster images can cause various difficulties such as findingthe best place to fit object boundary in each pixel. Furthermore the result willdepend on image resolution. Road width in mountainous areas varies between9 and 11 meters so depending on the resolution of images the road width canbe covered by a different range of pixels. For example if we use multi spectralIKONOS images where each pixel covers 4 meter of the earth, the road widthwill be covered by 2 to 3 pixels. If we increase the spatial resolution, for ex-ample use Pan images with spatial resolution of 1 meter, then the amount ofdetail increase because the road width contains 9 to 11 pixels. The aim in thisresearch is using high resolution images to increase data quality and accuracy.

road curviness is essential for different applications. Civil engineers, routeplanners and road safety managers are some of the users that will benefit howthis research work.

1.2 Objectives

The main objective of this research is to identify curviness of curvy roads suchas over pass mountain roads from high resolution remote sensing images us-ing new geo-information methods. In order to achieve the objective differentresearch questions should be answered.

• How can we detect roads from a high resolution remote sensing image?

• How can we identify curves and their parameters from the extracted road?

• How can we define curviness in the detected road as a digital curve?

• Is curviness a uniform property of a road and how the spatial variabilityof curviness can influence the result?

• What is the effect of detected road quality on curviness identification?

1.3 Related work

Based on the objective there are two main steps in this research.

• Detect the road from a remote sensing image

• Identify curves in extracted road

2

Page 15: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 1. Introduction

1.3.1 Road Detection from Remote Sensing Images

Road detection is defined as the process of assigning a value to each pixel thatcan be used as a criterion to distinguish road and non road pixels [14].Mayerhas explained perfectly about road detection [12] It can be measured by usingpattern recognition techniques. The main pattern recognition methods can becategorized in six groups as following [22]:

• Migration mean clustering algorithms

• Fuzzy clustering

• Vacuum shell detection

• Statistical supervised methods of pattern recognition

• Artificial neural network

• Knowledge-based methods

Most of the pattern recognition algorithms have been used for road detection.Artificial neural network has been used for road detection from high resolutionimages in 2006 [14]. Fuzzy logic is another pattern recognition algorithm whichis used for road detection [13].

1.3.2 Shape estimation and analysis of digital curves

In literature there are four approaches for shape analysis of digital curves andeach approach, contains two main steps. Approach (1) is defined by the follow-ing items:

• find the boundary of a finite non connected point set in an arbitrary grid

• estimate the shape

This approach is used for object boundary detection by using a directed variantof α− shape calling α− graph which is a generalization of convex hull [23].

Approach (2) is the most common approach by the following steps:

• pixels in the image are identified as belonging to either the target objector the background

• pixels on the curve describing the digital object (either the boundary orthe centerline) are input to the shape estimation procedure

This approach usually is used for two dimensional curves. In order to identifycurves from this approach first the main parameters of each 2-D curve shouldbe identified. The main measures to consider a 2D-curve are arc length andcurvature (k). The arc length parameterizes the different places of a curve in awell defined way and the curvature is the inverse of the radius of an osculatingcircle (the circle closely touching the curve at the given point) [23]. Methodsbased on this approach in any discrete point of a curve use a limited windowof fixed size to compute curvature from a binary image. These methods arecategorized in three groups [23].

3

Page 16: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

1.3. Related work

• Methods based on orientation contain chain code, restamping and line fit

• Method based on path

• Method based on the osculating circle

This approach is used in literature for detecting regular object such as digitallines and digital circles by using hough transform [15, 9, 17]. In these methods,based on the equation of line or circles, all the lines or circles that fit each smallpart of the image will be saved in Hough space and from hough space the localmaxima which is the maximum number of lines and circles that passes throughthe image will be chosen as identified curve.

Approach (3) is used for shape estimation of 3-D curves as following:

• points close to the original curves are identified with subpixel accuracy

• the points thus found are input to the shape estimation procedure

As it’s described in [23] approach (3) method is a precise method but it is toocomplex in segmentation. In this approach because of measuring 3-D curvesapart from curvature and arc length another parameter which is torsion andmeasures how the curve locally deviates from being a planner curve should beidentified.

Approach (4) globally measures the curve parameters. Global methods suchas snakes and Fourier parameterize contours which are used for curvature es-timation in [26, 23] are based on parameterized boundary templates and yieldcurvature directly from the template parameters. These are applied to the grayvalue image data directly. The steps are as follow:

• fit parameterized boundary model using the grey valued image informa-tion

• calculate the shape from the parameters of the model

Trough the above approaches, approach (3) is used for curve estimation in 3-Dobjects and is complicated in segmentation. Approach (4) is a modeling issueand directly fits a model to grey scale image. Approach (2) is usually used forlocal curvature estimation from 2-D curves, and approach (1) is used for shapeestimation of scattered points in the boundary of the object.

1.3.3 Scope of work

As we discussed in subsection 1.3.2 there are different ways for shape estima-tion of digital curves in 2-D and 3-D space. we are going two identify curvinessin 2-D curves and the choice of 2-D from one image so we won’t use methodsrelated to 3-D curves. Further more we divide the work to two steps. Andwe use combination of approach (1) and (2) in shape estimation to identify 2-Dcurves. The whole method that we use has three main steps 1) detect the object

4

Page 17: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 1. Introduction

2) Identify the boundary and 3) find the curvy segments in the boundary. We de-termine the road as one curve and we chose the steps of methodology based onthis fact. In the first step of work we can detect road as a fuzzy or crisp object soit’s better to choose a method to give us possibility to for detecting object is bothsituations. In the second step we want to detect object boundary so it’s betterto choose a method that can show object boundary for different resolutions andobjects with different width and different geometrical shapes. In the third stepwe want to use local parameters to determine curvy turns of the mountainousroad.

1.4 Thesis organization

This thesis is organized in five chapters as follow:

• Chapter 1: Introduction: contains Problem definition, Research objective,Research questions, Related work, Thesis organization

• Chapter 2: Study area, Data and Software used: contains Introduction,Data, Study Area and Software used

• Chapter 3: Methodology: contains Introduction, Road detection (Subset-ting, Fuzzy c-means classification method and Binary image), Object bound-ary detection, Curve identification methods

• Chapter 4: Result and Discussion :contains Introduction, Result of roaddetection, Alpha shape implementation and result, Comparison of ap-proach (I) and (II) for α-shape circle with r=2, Using different radiusesto detect boundary, Experiment on binary image by treshold=255, Effectof changing moving window size, Effect of changing threshold, Effect ofusing sign angle, Discussion

• Chapter 5: Conclusion and Recommendation

5

Page 18: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

1.4. Thesis organization

6

Page 19: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 2

Study area, data and softwareused

2.1 Introduction

This chapter describes study area, material used in this research. Study areais a overpass mountain road in north part of tehran (Lavasan). Material usedcontains two parts (data and softwares). Data is a high spatial resolution re-mote sensing image. Based on different methods, in every step of the researchsome remote sensing and programming softwares are used.

2.2 Study area

We are interested in identifying curves in roads specially overpass mountainroads. ’In a range of hills, or especially of mountains, a pass is a lower pointthat allows easier access through a range. On the route through the range, itis locally the highest point on the route. Since many of the world’s mountainranges have always presented formidable barriers to travel, passes have beenimportant since before recorded history, and have played a key role in trade,war and migration. Topographically, a pass has the general form of a saddlebetween two mountains (the elevation as a function of two position coordinatesis mathematically a saddle point). Passes may be very short, consisting of steepslopes to the top of the pass, or valleys of many kilometers, whose highest pointis only identifiable by surveying’ [2].

Based on the definition of overpass mountain roads we have chosen our studyarea. The study area is a mountainous road which captains various curves withdifferent geometries. It is located on the north of Tehran in Iran. Because ofits geographic and geometric characteristics and also availability of the data,Tehran-Lavasan road is chosen for study area. Lavasan is at 25 kilometers ofnortheastern Tehran in Iran and is located on slopes of Alborz Mountain, at1600 m above the sea level. Northern part of Lavasan extends from Ahmad-abad, Shourkab, Jaeij, Galandouak, Nejarkala, and through Tappeh Sorkhehand wells of Ghaziabad, and ending in Bagh Darreh. Lavasan in the East

7

Page 20: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

2.3. Data

extends from Bagh Darreh, passes through east of Naroun, Sabou Kouchak,Sabou Bozorg, and ending in Lavarak. In the south extends from south of La-tian Dam and Lashgarak River to northern Ahmadabad lands. The Area calledLavasan is 13.7 square kilometers and its population according to last statisticsis 14594. Its maximum and minimum temperature is 33 centigrade above zeroand 17 centigrade below zero. Tehran-Lavasan road divides from Lashkarakhighway in Tehran and ends in Lavasan. Because of good weather every daymany people from Tehran travel to Lavasan which makes the road a crowdedmountain pass. The figure (2.2) shows the location of Lavasan in map of Iran.

Figure 2.1: Lavasan in shown in map of Iran (source:fallingrain.com)

2.3 Data

As it was mentioned in research objective the main objective of this research isidentifying curviness of overpass mountain roads from high resolution remotesensing images. Spatial resolution of the image is important for obtaining de-tailed information. We described in chapter (1) that a road width is usually9 − 11 pixels. If we use a Landsat TM image (spatial resolution=30m) a roadis located in a pixel and can cover 1

3 part of the pixel. Deriving curve parame-ters from low resolution images is more difficult than high resolution ones. Theimage which is used in this research is a small subset 1500 × 1600 pixel MultiSpectral (MS) IKONOS image. In this research both PAN and MS IKONOSimages from the study area was available. Obtaining information (road detec-tion) from Panchromatic images (spatialresolution = 1m) is more accurate thanMS images (spatialresolution = 4m) because they are more similar to the realshape of road on the earth. Because of more complexity we chose MS image.The image information is as follow:

• projection :UTM, zone 39N

• pixel size :4 meter

• Datum: WGS-84

In the image each pixel covers 4 m of the earth, so the road width is covered by2 to 3 pixels. The road contains more information than TM image and less in-formation than PAN image. The Multi Spectral (MS) IKONOS image is shown

8

Page 21: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 2. Study area, data and software used

in figure 2.2. Our study area (Tehran-Lavasan road) is located in top left cornerof the image.

Figure 2.2: Multi Spectral IKONOS image from Lavasan in Iran(source: NCC (National Carto-graphic Center of IRAN))

2.4 Software used

In this research three main softwares are used for the different steps of work.For the remote sensing section (road detection) ENVI and IDL are used [1].In methodology chapter, we have used MATLAB for boundary identification[16] and visualization and Python and Microsoft Office Excel are used for curveidentification in calculation and visualization [5].

9

Page 22: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

2.4. Software used

10

Page 23: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 3

Methodology

3.1 Introduction

This chapter describes methods used for curviness identification from a highresolution remote sensing image. Methodology consists of two steps: Road de-tection and curviness identification. The results of road detection is a binaryimage that represent road as a crisp object and we use it as an input for furtheranalysis. The detected road consists of boundary and interior. alpha shapesare used for object boundary detection. The extracted boundary is made of con-nected straight small segments. Two different methods are used for identifyingcurvy segments through the path. In both methods from the start point in bothsides of the road we choose a fixed size segment. In the first method we measuresum angle in the segment and shift the segment in all over the road. In the sec-ond method we choose the segment in the same size and measure the distancefrom the midpoint of the segment to the the straight line from the beginning tothe end of the segment and do the same for all the road.

3.2 Road detection

This section contains the process for answering the first question of my thesis.How can we detect roads from high resolution remote sensing images? Thissection contains three main steps. The first step is choosing a small subset ofimage. The second step is using a pattern recognition method (unsupervisedfuzzy c-means classification method) for detecting the road and the next step ismaking the classified image binary to prepare it for the next step in methodol-ogy which is identifying curves in the extracted road. This section has to mainrole in this research as following:

• It contains data processing for implementing main method

• It is separate process for road detection

11

Page 24: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

3.2. Road detection

3.2.1 Subsetting

Before starting the main processes for road detection, we use subsetting tomake further processes easier. The reason for subsetting is doing the possessesin the region that contains the road to decrease the size of the image. Our im-age files are huge files. Since we like normally working with a smaller area, wecrop the larger image so that we have a much smaller file to work. Data is a MShigh resolution image. The image size is 1500× 1600. We choose a small part ofthe image by using ROI (Region Of Interest) icon in ENVI software [1].

3.2.2 Fuzzy c-means classification

As was mentioned in related work section in chapter 1, pattern recognitionmethods can be used for road detection. Actually road detection means theprocess of assigning a value to each pixel that can be used as a criterion todistinguish road and non road pixels. Among the pattern recognition methodswe have chosen fuzzy c-means classification method. It is a robust clusteringalgorithm that provides the mean of overcoming the false clustering problems.This algorithm separates data clusters with fuzzy means and fuzzy boundaries.The result of classification will be stored in a (c × n) matrix called U, where cis the number of clusters and n is the number of pixels . Each entry of U isdefined by Uik . The algorithm is based on two equations 3.1 and 3.2. Uik willbe measured by the following equation.

Uik =1

c∑i=1

( |xk − vi||xk − vi|

)2/(m−1)for all k (3.1)

In equation 3.1, c is the number of clusters and in our method c = 4, m isthe exponent parameter which based on [22]the interval [1.5,2.5] gives a validclustering result and in our method m = 2 , X = x1, x2, x3, ..., xn is a finitesubset ofRd, the d dimensional real number vector space and V = (v1, v2, ..., vc)is the vector of cluster centers(the mean of clusters) that will be measured byequation 3.2.

vi =

∑k

(uik)m · xk∑k

(uik)mfor all i (3.2)

The fuzzy c-means algorithm first computes cluster mean vi, for all i, usingequation 3.2 and then updates matrix U using equation 3.1. The results will bestored in four bands and each pixel has a membership value between [0,1][22].We choose one of the bands for the next step.

3.2.3 Binary image

The result of fuzzy c-means classification is a grey scale image by membershipvalues between [0,1]. The aim is to convert the image to a crisp object (road)

12

Page 25: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 3. Methodology

in a way that all the pixels in the object just describe the road. In the classi-fied image there are many scattered objects and we remove them by cleaningthe image. After cleaning the result is a grey scale road and the background iscompletely black.

The intervals which are between [0,1] can be scaled between [0,255], this iswhat we have done for preparing data for thresholding. The result should bea binary image. Binary images are images that have been quantized to twovalues, usually denoted 0 and 1, but often with pixel values 0 and 255, repre-senting black and white. Binary images are typically obtained by thresholdinga grey level image. Pixels with a grey level above the threshold are set to 1(equivalently 255), whilst the rest are set to 0. This produces a white objecton a black background (or vice versa, depending on the relative grey values ofthe object and the background). Of course, the negative of a binary image isalso a binary image, simply one in which the pixel values have been reversed[11]. Thresholding is a difficult issue which can be done based on vertical andhorizontal profiles. We do thresholding for three different situations .

• Ifmembershipvalue > 180, thenRoad = 1

• Ifmembershipvalue > 210, thenRoad = 1

• Ifmembershipvalue = 255, thenRoad = 1

All these methods were used to detect the road from high resolution MultiSpectral image and the result which is a binary image will be used for imple-menting the main methods to identify curves. The main result that we use inthe research is the binary image for the threshold=180. The reason for choosingthis option is the amount of information stored in this result which is more thantwo other candidates. We use threshold=255 which is the worst situation anddata the lowest accuracy because some parts of road is covered with no pixel tocompare the results with threshold=180.

3.3 Object boundary detection

The result of road detection is a 2-D crisp object containing boundary and inte-rior. The second research question and main objective of this research is (Howcan we identify curve and their parameters from the extracted road?. If weimagine the detected road as a 2-D curve, the information through the road canbe retrieved by two methods. The centerline and object boundary both are use-ful for information extraction from the curve[23]. In this research we identifythe curviness from the object boundary [18]. For identifying object informationwe use discrete geometry (study of geometrical objects and parameters that arediscrete). We first define discrete objects boundary and then identify local pa-rameters [11].

13

Page 26: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

3.3. Object boundary detection

3.3.1 Alpha shapes

The α-shapes of a finite point set is a polytope (the generalization to any di-mension of polygon in two dimensions, polyhedron in three dimensions, andpolychoron in four dimensions) that is uniquely determined by the set of pointsand a real number α [6]. α is equal to inverse of the radius of the circle en-closing each two points in the point set boundary. The α-shape is defined as adefinition and computation of the shape of finite point set in three dimensionalEuclidean space. α-shape can be seen as a generalizations of the convex hullof the point set. Let S be a finite point set of points in Rd (where d is the di-mension) and α a real number with 0 ≤ α ≤ ∞. The α-shape of S is a polytopewhich is neither necessarily convex nor connected. For α = 0, the α-shape isidentified to the convex hull of S. As α decrease, the α-shape shrinks by gradu-ally developing cavities. These cavities may join to form tunnels or even holesmay appear [7, 10]. In a simple explanation Fischer describes α-shapes as fol-lows: ”one can think of a α-shape as a huge amount of ice-cream making up thespace Rd and containing the points S as hard chocolate pieces. Using one of thissphere-formed ice-cream points we carve out all parts of the ice-cream blockwe can reach without bumping into chocolate pieces. Thereby even carving outpoints in the inside(parts not easily reachable by simply moving the spoon fromthe outside. We will end-up with a (not necessarily convex) object bounded byarcs and points. If we now straighten all round faces to triangles and line seg-ments, we have an intuitive description of what is called the α-shape of S” [10].The example of α-shapes in 2-D is shown in 3.1. In 3.1 parameter α determinesthe radius of the circle connecting two outer points [10].

Figure 3.1: Example of the 2-D α-shape (source: CGAL.org)

3.3.2 Alpha shapes for boundary identification

We are interested in road boundary determining. The boundary of an arbitraryfinite point set in R2 can be a directed graph containing vertices which are iden-tified as boundary elements. The obtained contour defines the local definition

14

Page 27: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 3. Methodology

of the form of S (finite point set), and permits deviation of contour parameterssuch as length, orientation and local curvature [25]. In literature directed graphis derived from vertices and edges of the convex hull is one of the main methodsfor defining boundary [19]. Convex hull as a method for boundary identificationhas some limitations as follows [25]:

• Convex hull is only to extract convex parts, so essential shape informationon concave parts is lost

• As convex hull is always consists of one closed face , it is unsuited fordescription of a set of finite point clusters

• The convex hull is unable to describe the boundary of the point set fordifferent scales

In α-shapes the parameter α is used as a parameter of scale. In the otherhand it is possible to define object boundary in different scales by decreasingor increasing α. In literature the minimum α is introduced as the half of thesmallest distance between two elements in S. Increasing α will introduce bidirectional edges in to the alpha graph. in α = 0 we reach the convex hull ofthe point set and if we increase the α the area of interior is reduced [23]. The α-shape because of all its advantages comparing convex hulls are used for objectboundary identification.

3.3.3 Steps of using alpha shapes for road boundary identifica-tion

We have used a MATLAB code for implementing α-shapes [21]. Detected roadwhich is a binary image is the input of the code. Based on the definition of α-shapes which is described in previous sections 3.3.1 and 3.3.2, the α-shape is ascale dependent definition for boundary identification. The scale is a factor ofparameter α that in our method we have used the radius (r=1/α) of the circlesthat connect each two points in the boundary together as a parameter of scale.We implemented the code for positive (r) and we started from r = 2. Actually thechoice of 2 as the beginning number is because the minimum distance betweentwo neighbor points in horizontal and vertical situations is 1 which means invertical and horizontal cases even r = 1 can be used but the problem occurs indiagonal positions that the distance is multiplied by

√2. In diagonal situations

the first suitable radius for drawing circles is r = 2 which is the first radius forfitting α− shapes to the boundary of digital binary image. Except r = 2 we havedone the experience for different times by changing the radius. The experiencehas been practiced for 2 ≤ r ≤ 10. Some of the result are mentioned in the nextchapter for comparison. Radius 2, 4, 10 are shown as an example. The sameexperience can be done for other binary images with different thresholds and toprove the idea we have done it for treshold=255 and we discuses more in resultchapters by showing the results. The α-shape code is shown in Appendix A.

15

Page 28: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

3.4. Curve identification methods

3.4 Curve identification methods

The object boundary extracted from applying α-shapes on the binary imagecontains edges and vertices. All the information related to curves and curvinesswhich are our main interest in this research is stored in all small lines whichtogether make a polyline. The whole road boundary is a polygon and we have toidentify curviness paraments from a derived polygon [3] In literature curvatureand arc length are two main factors for identifying curviness in 2-D space [23].What we are going two define as curve parameters are two simple approaches.In our approaches for each three points pn−i, pn, andpn+i in the path where nis the mid point, the angle between these three points in pn or the distancefrom pn to the line passes through pn−i and pn+i are two simple parameters foridentifying curvature. More over the polygon as a result of using 2-D alphashapes contains many lines that are connected with vertices the next questionthat come in mind is that shall we measure curviness in all vertices or not? Thisquestion is a main reason for choosing two different approaches for identifyingcurvy segments. In Both approaches we use the same window size that containsa set of points but in one of the approaches we use all the points for curvatureestimation and for the other approach we only use the beginning the mid andthe last point in the set.

3.4.1 Angle, a parameter for defining curvature

In literature curvature of a parametric curve c(t) = (x(t), y(t)) is defined by thefollowing equation:

k(t) =x(t) · y(t)− x(t) · y(t)

(x(t)2 + y(t)2)3/2(3.3)

It is clear in equation 3.3 that estimating the curvature involves the derivativesof x(t) and y(t) , which is problem in the case of computational shape analysiswhere the contour is represented in discrete form. One of the approaches whichis used for curvature measurement is based on the angles between vectors de-fined in terms of the discrete contour elements. Let c(n) = (x(n), y(n)) be adiscrete curve. The following vectors can be defined:

vi(n) = (x(n)− x(n− i), y(n)− y(n− i)) (3.4)

wi(n) = (x(n)− x(n + i), y(n)− y(n + i)) (3.5)

These vectors are defined between c(n) (the defined point) and the i-th neigh-bors of c(n) to the left and right. A digital model of high curvature points pro-posed in [20]is as follow:

ri(n) =vi(n) · wi(n)

‖vi(n)‖‖wi(n)‖(3.6)

In equation 3.6 ri(n) is the cosine of the angle between the vectors vi(n) andwi(n) and can be used as a measure capable of locating high curvature points[4].

16

Page 29: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 3. Methodology

In discrete space, curvature commonly refers to changes of the direction withinthe discrete object under study. Where we have a set of points P = {pi}i=0,..,n

that define a digital curve, the k-order curvature of P at point pi, ρk(pi) =1 − | cos θk

i | where θki = angle(pi−k, pi, pi+k) that is made between the continu-

ous segments [pi−k, pi] and [pi, pi+k] and k is a member of {i, ..., n − 1}. Thisdefinition can be used for measuring order curvature. As the order k increases,The curvature trends to show the global behavior of the digital arc [11]. It ismentioned in [4] that the angle based digital curvature is discussed by [Beusand Tiu, 1987; Freeman and Davis, 1977; Liu and Srinath, 1990; Rosenfeld andWeszka, 1975].

All we discussed above show that angle is a main parameter for defining cur-vature in both continuous and discrete curves. Sign angle is able to representeither a curve is convex or concave. These reasons encouraged us to use anglefor identifying curviness.

3.4.2 Approach I: local curvature measurement in all the ver-tices of a window

The polygon that represent road boundary is consists of two polylines, one as aleft side and the other one as a right side of road. We determine each polyline asa curve. We use local parameters in vertices to identify curvy segments in eachpolyline. One of the ways is to measure curve parameters in all vertices. Wecan measure sign angle as for identifying curviness in each vertex. Because thesign shows the direction change we can determine either each curvy segmentin road is convex or concave. If we measure all the sign angles and show theresults in the graph, the result will be very noisy. Working in discrete objectslead to many direction changes in the polyline so the graphs look noisy. Fordecreasing the noise we use can measure accumulated angle. We can dividethis approach to three steps.

• measuring the angle(θi) between each three points or each to lines fromthe start point to the end point of road in both boundaries(sides)

• finding the sign angle for all the measured angles

• use moving window to see the change of accumulated angle through thepath

In the first step we have to measure angle between each three points. LetS = ak, ak+1, ak+2, ..., ak+n be the number of points in each side of the road.For each three points (ak, ak+1, ak+2) where point ak = (xak

, yak) is the first,

point ak+1 = (xak+1, yak+1

) the second and point ak+2 = (xak+2, yak+2

) the lastone. We measure the angle between these three point by equation the followingequation: [8]

θi = arccoslakak+2

− lakak+1− lak+1ak+2

2√

lakak+1·√

lak+1ak+2

(3.7)

17

Page 30: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

3.4. Curve identification methods

In equation 3.7, lakak+1, lak+1ak+2

and lakak+2are the length between each two

points that can be easily measured as follows:

lakak+1= (xak+1

− xak)2 + (yak+1

− yak)2 (3.8)

lak+1ak+2= (xak+2

− xak+1)2 + (yak+2

− yak+1)2 (3.9)

lakak+2= (xak+2

− xak)2 + (yak+2

− yak)2 (3.10)

We shift one point to forward and repeat the procedure to measure measureθ between points(ak+1, ak+2, ak+3). We use the explained method and measureall the angles on both sides of the road boundary. In the next step we have todefine the sign of the angles. Measuring sign of the angles give the opportunityto see the direction change of the curvy segments in road without sign we cannot measure negative and positive separately so all the angles will be positive.Some angles because of the direction change are in the right side of the bound-ary and some in the left side. We are interested in positive values for anglesinside (interior) angles and negative values for exterior angles. For each threepoints (ak, ak+1, ak+2) the sign is measure by following equation: minus is forcomputing the interior angles positive and the exterior ones negative.

sign(akak+1ak+2) = −sign((xak+1−xak

)∗(yak−yak+2

)−(xak−xak+2

)∗(yak+1−yak

))(3.11)

In equation 3.11 minus sign is introduced for computing the interior angles pos-itive and the exterior ones negative. We show the sign angle in the graph. The xaxis represents number of points or cumulative distance from the start point ofroad. The cumulative distance is captured by applying equation ?? for the firstsegment and increasing distance by moving forward. If we show all the anglesin the graph, because of the huge number of points the graph looks very noisy.The idea of moving window that can be used in fixed size or different sizes isused to make the graph smother [24]. The window size is an odd number andthe number of angles from the mid point of window in both left and right sideof the window is equal. We add all the signed angles in the window and repre-sent the result (accumulated angle) in the midpoint. Then we shift one point tothe next point and so on. A Python code is used for implementing all the stepsmentioned above. In the code for changing the size of moving window parame-ter DELTA is used. DELTA is the number of points from the midpoint in thewindow to the start point or end point of the window. The code is representedin appendix B.

Based on the definition of discrete curvature in [11] can measure sign anglein a set of point just for the mid point of the set. In the fixed window size pa-rameter DELTA is the number of points before and after the mid point. We usethe definition to measure sign angle in each segment.

3.4.3 Approach II: Identifying local curviness in the midpointof a window

In addition to approach I, we use another method for defining curvy segmentsof road. In approach I, in each window containing n points we measured n − 2

18

Page 31: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 3. Methodology

signed angles and for decreasing the noise we used accumulated distance todecrease the noise. In the same size window instead of measuring curvinessin all the vertices we can only determine one value. In approach II, for a win-dow that contains odd number of points and points (ak−i, ak, ak+i) are in orderthe start, the middle and the end point of the window, we can only measurecurvature in the middle point. This approach is based on the distance from amid point ak to the straight line that connects the points ak−i and ak+i. Thisapproach is based on simple curvature definition that curvature is the amountby which a geometric object deviates from being straight line [24]. The devia-tion of the point ak from the straight line leads to increasing the distance andcurvature. Instead of measuring distance as a parameter that determines cur-vature we can use equation 3.7 in subsection 3.4.2 and measure signed anglebetween points (ak−i, ak, ak+i). We have done it as an experience but the mainresults are compared based on the different between point ak and the straightline passes through ak−i and ak+i. Although comparing methods are difficultbecause we are using two different parameters for defining curvature and theyare not comparable numerically but we can compare them by visual interpre-tation of graphs. We measure the distance from point ak to line ak−iak+i byfollowing equation:

d =(yak−i

− yak+i)xak

+ (xak+i− xak−i

)yak+ (xak−i

yak+i− xak+i

yak−i)√

(xak+i− xak

)2 + (yak+i− yak−i)2

(3.12)

The same as approach I, we shift one point forward and repeat the procedure.We do all the computations by a Python code. Parameter i in equation 3.12 inour program is equal to DELTA. We can change DELTA in the program. Theresults are shown in the graph in two ways. cumulative distance and numberof point are two ways for showing the results in the graph.

3.4.4 Visualizing the results

We show the results obtained in 3.4.2 and 3.4.3 in the graphs. In order to pro-duce a user- friendly result and represent the results for visual interpretation,the results are shown as tick marks in the road. In this method the road is visu-alized by using (x, y) coordinates and cumulative distance or number of pointsdivide the road into equal sections. We use a parameter (DANGER) in the codefor tresholding the results in the graph. If we use higher curvature as a valuefor tresholding, the number of points that are ticked in the road and representDANGER are less. By using this method we can change the value of threshold.

3.4.5 Using curve identification methods for comparing roadboundaries detected by different data qualities and dif-ferent amounts of α

We use the curve identification method for detecting curvy segments in differentα-shape boundaries(polygons detected as road boundary by different r=1/α) andfor different qualities of binary image to evaluate the effect of previous steps

19

Page 32: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

3.4. Curve identification methods

on identifying curvy segments and investigate either the method can work indifferent situations or not?

3.4.6 Method adapted in a diagram

In this part a flow chart briefly shows method used for curve identification frombinary image. As we discussed in previous sections the main methods are di-vided to three steps.

• Identifying boundary from the binary images using α-shapes

• Identifying curviness from the boundary using approach I and approachII

• Visualizing the results

These three main steps are shown in figure 3.2.

Figure 3.2: Methods used for curviness identification in the road

20

Page 33: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4

Result and Discussion

4.1 Introduction

Based on the methods discussed is chapter 4, we use α-shapes for detectingroad boundary. The result is captured for positive α values. We use two differ-ent approaches to identify curviness from α-boundary in road. We first discussabout the boundary results. We choose the optimum boundary and in the nextstep we implement two approaches on the boundary and compare the resultsin the graphs and by visual interpretation. The methods give the possibility tocompare the results of two approaches for different α-boundaries. In the nextstep we compare the result of different data by different qualities. At the endwe show the flexibility of method for changing moving window size and thresh-old in graphs to reach different results based on user requires.

4.2 Result of road detection

4.2.1 Subsetting

We choose a small subset in the top left part of the image which is 140 × 290pixels. Figure 4.1 shows the chosen subset. An over-pass mountain road isthe main object inside the subset. The road is composed of various curves withdifferent shapes. This variability helps to answer one of the research questionsthat asks Is curviness a uniform property of the road or not?

4.2.2 Fuzzy c-means classification method

We used fuzzy c-means and classified the subset to four clusters. We save theclusters separately in four bands. Each band shows one cluster. Between theresults we choose the band that road class in inside it for the next step. Thechosen band is shown in figure 4.2.

21

Page 34: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.2. Result of road detection

Figure 4.1: 140× 290 subset of MS image

Figure 4.2: Road class, classified by fuzzy c-means

22

Page 35: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

4.2.3 Binary image

In the result of fuzzy c-means classification the membership value vary between0 and 1. We change it to a grey scale image with pixel values between 0 and 255.In the classified image there are many scattered objects and we remove themby cleaning the image. After cleaning the result is a grey scale road and thebackground is completely black. Figure 4.3 is the cleaned image. Thresholding

Figure 4.3: cleaned grey scale image

is the process we used for making the image. Three thresholds that we use areshown in figure 4.4. The idea for choosing different thresholds is used for com-paring data quality indifferent binary images.

The result of all the thresholds is shown in figure 4.4. In the figure from leftimage to right image data quality is decreased.

4.3 Alpha shape implementation and results

As we explained in last chapter, we use α-shape to detect boundary of road frombinary image. In this section the binary image which is obtained by T=180 andhas the best quality compared to other thresholds is used. The positive valuesof α are used for boundary identification. Parameter r is a radius of the circlesin the boundary that defines α. A part of the road covered by α-shape circlesfor r=2, r=4 and r=10 is shown in figure 4.5. In the figure the left image showsr=2 and the circles completely cover the curvy part of road. The curve in theimage has the highest curvature in the road that we will discuss more in nextsections. So, in r=2 the road boundary is detected entirely. The middle image

23

Page 36: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.3. Alpha shape implementation and results

the radius of the circles around the road is 4 (r=4) . In this image the interiorpart of the boundary (The area that contain all concave points) has increasedit means that it contains the r=2 but we can not detect all the object edges. Inr=10 the size of the circles and the interior part of the boundary increase, butthe accuracy for boundary detection is less than for the two other radiuses (r=2and r=4).

Between mentioned radiuses r=2 is the nearest result to the r=0 that shows theconvex hull of the point set. Further more as we discussed in previous chaptersr=1 is not used because the circle can’t connect the points where the pixels arelocated diagonally. The result of implementing α-shapes on the boundary is apolygon which consists of vertices that is shown in figure 4.6.

In figure 4.6, the picture illustrates the entire boundary of the road and allthe curvy segments are not captured by the boundary. In r=4 some of the infor-mation in curves is missed and in r=10 many curvy segments are not capturedand are not obvious in the boundary.

The interesting part of the α-shape boundaries that can help to detect curvi-ness and curve parameters are vertices. Each vertex represents an angle andthis angle is one of the parameters that we use to retrieve information.

Figure 4.4: Different binary images: from left to right:treshold=180, treshold=210, treshold=255

24

Page 37: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

4.4 Comparison of approach I and II for α-shape cir-cles with r=2

We use the α boundary (the road boundary that is detected using α shapes) con-sisting of vertices to identify curves and the points with high curvature in bothsides of the road. The points in both lines of the road are input for two differ-ent approaches. As we discussed in chapter 4, we use two approaches to detectcurvy segments of road. The results in this section contain both approaches forr=2. Both methods use moving windows with the same size that is defined byparameter DELTA is the Python code. In this section DELTA=7 that meansnumber of points in window is 15. So Point 1 is the first point, point 8 the mid-point and point 15 the last point in the window. The results are shown in figure4.7.

In figure 4.7 we see four graphs. In the two top graphs, the y-axis representscurvature as measured by approach II, the x axis in the left graph shows cumu-lative distance from the start point of the road and in the right graph, it showsthe point number. The number of points in each line of the road (left-right) is440 points. In the lower graphs the y axis shows the accumulated angle on eachside of the road as measured by approach II and the x axis is the same as top

Figure 4.5: Different zoom level images show α-circles by different radiuses around the road.from left to right: r=2, r=4 , r=10

25

Page 38: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.4. Comparison of approach I and II for α-shape circles with r=2

graphs.

In all the graphs two lines are drawn. The blue line shows curvature changein the left side from bottom left to top left part of the image and the green linerepresents curvature alteration in the right side of the road from bottom rightto top right of the image . Because we use two different methods for identifyingcurves in road the range of curvature change in the graphs related to approachI is different from the graphs of approach II.

In all the graphs we see 11 peaks (high values for accumulated angle or dis-tance from straight line) in the both sides of the road, that shows we shouldhave 11 curvy segments in the road. The highest peak is located around point250. The curvature change in the blue and green line (in two sides of the road)is not the same. Although the amount of curvature in approach I and II is notthe same but the graph changes and the results in both methods show the num-ber of main curves in both side of the road is equal.

In order to see the results in road, we visualize them by choosing a thresh-old in the graphs. In this section for approach I, the threshold that in Pythoncode is danger=1 and in approach II, danger=3. Danger shows the parts of road

Figure 4.6: α-shapes result on binary image. from left to right: r=2, r=4, r=10

26

Page 39: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

with high curvature value. The reason for choosing 1 and 3 is that we use twodifferent parameters to identify curviness. Figure 4.8 shows road curves visual-ization result of both methods based on point number and cumulative distance.In all the figures we see 11 curvy turns. The high curvature points are visual-ized by red points.

4.4.1 Effect of using approach II, on decreasing the noise

In all the graphs related to approach I, presented in subsection 4.4we can iden-tify curvy segments of road but because we measured all the angles in one win-dow, the graphs look noisy. In order to decrease the noise of approach I, we useapproach II, and the same as deviation method in each window we just measureone angle. The graphs in figure 4.9 proves the idea that measuring one valuein the mid point of the window decrease the noise in result. Both graphs onthe top line of figure 4.9 that are angle based show all curvy segments of roadbut the noise in the right graph is less. The right top graph is comparable withthe result of deviation method in the second line of figure 4.9. The signed angleand distance from the straight line are two different methods for identifyingcurviness but because we are measuring curvature between the same pointsthe results looks similar.

Figure 4.7: graphs show curviness change in road boundary. Top left: (approach II) throughroad points, top right: (approach II) based on distance , down left: (approach I) throughroad points, down right: (approach I) on distance

27

Page 40: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.5. Using different radiuses to detect boundary

4.5 Using different radiuses to detect boundary

In section 4.3 we obtained different boundaries by using different radiuses fromα-shapes. In this section we discuss the results of implementing approach I andII on different α-boundaries. We identify curves applying approach I and II onthe boundaries detected by r=2, r=4 and r=10. The results are illustrated infigure 4.10.

The graphs on the top row represent the results of approach I and II on theboundary with r=2. We discussed about the results in section 4.4. The secondline shows the graph for the r=4 in the boundary. The left graph is drawn based

Figure 4.8: figures shows curvy segments identified in road by different methods. Line a:approach I-points, approach I-distance, line b approach II-point and approach II-distance

28

Page 41: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

on approach II and the right graph is prepared using approach I. The x axisshows the number of points that are less than the number of points in graphsrelated to r=2. Because where r=4 the distance between each two points thatα-circles connect together increases, so in the whole boundary compared withr=2 we have less points. In both methods the blue line (left side of road) shows9 peaks and green line shows 11 peaks. It shows 2 curvy segments in the leftline of the road are not detected. In figure 4.19 in the middle image the circlesshow the parts that we have narrow curves and the curvy segments can not berepresented completely. In the left boundary the main peaks that we miss arelocated in the third circle in figure 4.19 where we have the highest curvinessarea. In graph because we miss two curves in the area between point 150 topoint 200 in the left boundary the number of points in the left and right lineare not the same so the length of blue graph is less than green graph and thegraphs especially after point 200 are not parallel. The peaks in point=100 in leftline and point=125 and point=175 in right boundary in figure 4.19 are the curvysegments where we miss information. This missed information is an importantresult that proves these parts have sharp curves. Both graphs compare withgraphs related to r=2 are smoother. This smoothness is because of increasingdistance between points in r=4 in the α-boundary.

. Down : curvature change (approach II)

Figure 4.9: Effect of segmentation on decreasing the noise. Top From left to right(approachI): sum Sign angle, sign angle

29

Page 42: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.5. Using different radiuses to detect boundary

In the third line of figure 4.19 the graphs show the results of r=10 in the α-boundary of road.

Figure 4.10: graphs show curviness change by different methods for different r in T=180. Topleft: approach II and r=2 , top right: approach I and r=2, mid left: approach II and r=4, midright: approach I and r=4, down left: approach II r=10, down right: approach and r=10

In these graphs compared with r=4 we have less points in the boundary. Aswe discussed for r=4, in r=10 the parameter α decreases so the the number ofpoints in the boundary that are detected by the circles with r=10 will decrease.The x axis show the number of points that are around 200. In y axis, because themeasurement is related to distance and the distance between points increase,we see higher values compared with r=2 and r=4. In both graphs the blue line(left side of the road) represents 7 peaks and the green line (right side of theroad) shows 11 peaks. It shows that the in the left side of the road 4 curvysegments are not detected but in the right boundary all the curvy segmentsare identified.In figure 4.19 the third image from the left shows the identifiedcurves in the road boundary. In the figure we obviously recognize 4 curves inthe left boundary are missed. In the parts that the curves are not identified, wesee a straight line in the left side of the road. These cures are the most sharpestcurves in the road.

In both methods the blue and green line are not parallel, which shows fromthe first curve in one of the sides of the road the curve is not detected entirelyor some parts of it are missed. Figure 4.19 proves the idea because in the right

30

Page 43: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

line some parts of the first curvy segment are not detected. These results showthat curve parameters on both sides of the road is not equal.

4.6 Experiment on binary image by Threshold=255

In all previous sections (4.4 and 4.5the binary image that we used for boundarydetection was the best result between the roads detected as binary images inchapter 3. The threshold that we used for making the image binary with thehighest quality was T=180 and the lowest quality was T=255. As we discussedin chapter 3, the fuzzy c-means classification method is used to give the oppor-tunity of having different results with different qualities. In this section wediscuss about the results obtained from implementing all the methods on onedata set with different qualities. We compare the best situation (T=180) withthe worst situation (T=255).

4.6.1 Results of α-shapes

The binary image that is produced using T=255 is the lowest quality resultbecause only the pixels that have grey value of 255 are detected as road aredetected as road and are the input for the α-shape algorithm. We do the exper-

Figure 4.11: figures shows high curvy segments identified in road by in differen alpha bound-aries. From left to right: r=2, r=4, r=10

31

Page 44: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.6. Experiment on binary image by Threshold=255

iment for r=2 and r=4. Figure 4.12 shows α circles in convex part of the roadand figure 4.13 represents the polygonal shape of the boundary. In figure 4.13the left image is the result of using r=2 for the circles of α-shape and the rightone shows the result of using r=4 for boundary detection.

Figure 4.12: α-circles around the data with low quality. where the circles can’t connect thepoints the color change

As we see in the figure 4.12 and figure 4.13 in the result of r=2 some partsof the road are missed or are not detected correctly. The road boundary can’tpresent the road shape entirely. In the right figure, r=4 is used for identifyingroad boundary. Although the figure shows that in one part of the road, the curveis located in the interior of α-boundary but the road shape is detected betterthan r=2. The main difference between the results of implementing α-shapeon binary images by T=180 and T=255 is data quality. In T=255 the qualityis lower because they are less pixels that are member of road pixels and havemembership value=255. Where the number of pixels decreases, the distancebetween the pixels increases and even in some parts we may have no pixel inthe boundary. So r=2 can’t connect the point where the distance is high and inthe result boundary we miss some parts. What we discussed above is the mainreason for choosing r=4 as the road boundary for identifying curves in T=255.

32

Page 45: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

4.6.2 Results of curve identification methods

We use r=4 as the result of road boundary detection from α-shape and imple-ment approach I and II to identify the curves in the road. In figure 4.14 thegraphs on the third row show the results of implementing approach I and II onthe road boundary using circles with r=4 where threshold is 255. The graphs onthe first and second row represent the outcome of r=2 and r=4 for T=180 witchwe discussed in 4.5 and we use them for comparing their results with graphsin the third row of figure 4.5 . In the third row the x axis shows number ofpoints in the boundary that compared with the graphs in row one and row twoare decreased. The reason of the decreasing points is decreasing data qualityand missing some pixels in binary image that influence the result of α-circlesfor detecting the boundary. The y axis in the left image is measured based onapproach I (angle) and in the right graph it is determined by approach II (dis-tance).

In figure 4.14 the values of curvature in y axis speciality in approach II thatis based on distance measurement compare with the graphs in row 1 and 2 isincreased. In fact the y axis in row 2 shows higher values than y axis in row1 which is because of increasing the radius of the α-circles. In the third linegraphs in addition to increasing the radius of α-circles, the low quality of thecircles is another factor that increases the values. In the third row graphs the

Figure 4.13: α-shapes result on binary image T=255. from left to right: r=2, r=4

33

Page 46: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.7. Effect of changing moving window size

same as second row, blue line in the graph (left side of road) shows 9 peaksand green line (right side of road) shows 11 peaks. Because of the same reasonthat we mentioned in 4.5, two curves are not shown in the graph. The blue andgreen line are not parallel because the peaks that are not detected in the leftside influence the graph.

Figure 4.15 shows the results. The number of red points that present highcurvature points of road in the road from left to right in the figure increases.The reason is that the amount of values that represent high risk parts of roadbecause of increasing the distance between points has risen but the thresholdthat we have used for curve identification (danger) in all the figures is equal.(danger=3).

In visual interpolation we recognize that the number of points on the left sideof road is less than on the right side.

Although the number of the curves detected in α-boundary by the circles withr=4, in two different data qualities with T=180 and T=255 is equal but theshape of the curves where the quality is higher (T=180) is more realistic.

In all the experiments we detect the road boundary as one polygon thatcovers the whole road. We can do all the experiments even for r=2 and T=255 ifwe imagine the road as separated segments and implement all the method forcurve identification in each separated segment.

4.7 Effect of changing moving window size

In all the previous chapters for both approaches we used a fixed window sizethat is 15. The window size is the function of parameter DELTA (number ofpoints from the start point in the segment to the mid point) and is obtained by2 · DELTA + 1 . The window size is changeable. In literature the window sizeis introduced as an important factor in segmentation. It seems that the win-dow size may be a function of surface characteristics and spatial resolution [27].

In this section we discuss the results obtained from using different windowsizes. In figure 4.16 the graphs show the result of curvature change in roadfor different values of data. In the figure for the first line graphs parameterDELTA=5, in the second line DELTA=11 and in the last line DELTA=23. Inboth methods there is direct link between increasing DELTA and rising smooth-ness in the graphs. This smoothness is the result of decreasing the noise inthe results. Although decreasing the noise in the graphs makes the resultsmore clear, this should not lead to loss of information. In figure 4.16 whereDELTA=11 we can detect all the curves clearly from the graph but by increas-ing DELTA to 23 the graph, especially between points 250 to 300 change. Themethod based on the number of points, user requirement and the shape of theobject is flexible for changing window size. There is a limitation in increasingthe size of moving window. Because the first value that we measure is located

34

Page 47: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

in the mid point of the first segment (window), and the points between the startpoint of the segment and the midpoint don’t have any value, if we increase thesize of window we loose the information in this area.

4.8 Effect of changing threshold

By implementing approach I and II we identified the curves of road. Thresholdvalue (danger) in all the previous sections was fixed. Changing the thresholdvalue provide the possibility of retrieving different information in the road. In-creasing the threshold is a direct way for finding the highest curvature point ofroad and determining the sharpest curve in the road. In figure 4.17 the resultsof implementing danger=3.9 for approach I and danger=11.55 for approach IIare compared. Both results show the same area as the sharpest curvy part ofroad. In order to choose threshold values in the graph we determine the highestcurvature values and choose them as threshold.

Figure 4.14: graphs show curvature change by different methods for different data qualities.Top left: curvature change (approach I) r=2-t=180, top right: curvature change (approachII) r=2-t=180, mid left: curvature change (approach I) r=4-t=180, mid right: curvature change(approach II) r=4-t=180, down left: curvature change (approach I) r=4-t=255, down right:curvature change (approach II) r=4-t=255

35

Page 48: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.9. Effect of using sign angle

4.9 Effect of using sign angle

Sign angle is a factor that help us to identify the real shape of the road on theground because we can identify the direction change of curvy segments. Theresults in figure 4.18 show the curvature and angle change in road based onsegmentation. In Both graphs the x axis show the cumulative distance basedon cm. The y axis in the left graph shows curvature change in road path. Thecurvature is measured based on curvature definition in chapter 3, section 3.4.1in the fixed window size (DELTA=7). In the right figure the y axis shows the an-gle measured in segments based on equation 3.7 in subsection 3.4.2 of chapter3. Both graphs show 11 curvy segments of road.

4.9.1 Using the same measurement parameter

We use two different aspects to measure curvy segments, so the results arenot numerically comparable. We can measure the radius and curvature of thecircle that passes through each three points to compare the results. Becausefrom each three point for both method only one circle passes and because ofthe geometrical relation between two methods (where angle is near to zero thedistance is near to maximum), the results are similar. In figure 4.19 the leftfigure in y axis shows the radius of all the local circles between each 15 points

Figure 4.15: figures shows high curves identified in road in different data qualities. From left toright: r=2-t=180, r=4-t=180, r=4-t=255

36

Page 49: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

of road that is shifted to all the road. The right figure shows k=1/r in all 15points.

4.10 Discussion

The method consists of two main steps: road detection and curviness identi-fication. For road detection the fuzzy c-means classification method althoughit is a simple classification method, gives the opportunity to have results withrelatively different data qualities. We use binary image for representing a dis-crete object, but one of the advantages of fuzzy c-means classification is that wecan have the output in both fuzzy and crisp situations because it defines mem-bership value for the pixels in the object. The results obtained show that theroad is detected, but increasing the threshold value for producing binary im-age has a direct relation with decreasing data quality. Because we used fuzzyc-means and we have used grey values for classification result, if we choosetreshold=255 it means we only choose the pure pixel as road so may loose theparts of road that are located in neighbor pixels and we call them mixed pixels.So maybe a pixel is even 90 percent is covered by road but we omit it. Roaddetection result is an input for shape identification. We are interested in iden-tifying curvy segments of road. We determine road as a curve in 2-D space. In

Figure 4.16: figures shows high curves identified by different size of moving window. Fist line:DELTA=5, second line: DELTA=11, third line: DELTA=23

37

Page 50: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.10. Discussion

chapter 1 section 1.3 one of the approaches for shape estimation is finding theboundary of discrete object and estimating shape of the retrieved boundary asa digital curve to reach to the shape of road in the earth . α-shape, because ofits ability to detect boundary for different scales is used in this research. Thepositive values of radius is used for alpha circles. This is one of the limitations

Figure 4.17: Highest curvature part of the road. From left to right: approach I and dan-ger=3.9, approach II and danger=11.55

Figure 4.18: angle and curvature change without measuring sign. From left to right: curva-ture between [0:1], angle without sign

38

Page 51: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

of the method because in the code that I used for implementing α-shapes, wewas only able to apply positive values of 1/α. The code is very fast for comput-ing α-circles. By increasing the radius (r = 1/α) the shape of boundary willbe near to the convex hull of the point set and the curvy parts of road can’tbe identified in the boundary. Because of the geometry of the curvy roads, cir-cles by small radius (r=2) can represent a boundary that include all the roadboundary edges. By increasing scale (increasing r or equivalently, decreasingα) the amount of noise in digital object boundary decreases because the dis-tance between the points connected by α-shape circles increases. Based on ourresults that even by increasing α circles to 10 the straight and low curvatureparts of road are detected and for the parts that curvature is high only r=2 canbe used it can be a good idea to use combination of two different radiuses. Onecan use big radius for the straight parts and big radius for high curvy segments.

The result of object convex boundary detection is a polygon that we divide intotwo polylines in two sides of the road. The angles between edges and the devia-tion of a point from a the straight line are two parameters that we have used formeasuring curvature in two approaches. If we use a fixed window size for re-trieving information order two identify curvy segments of road in approach I, wemeasure accumulated angle and in approach II, we measure measure angle anddeviation from straight line just in the midpoint of window. Result of approachI, although we have measured accumulated angle looks noisy. In approach II,the results of measuring curvature by angle and derivative are similar. wherethe angle between three points is small, the deviation of the midpoint from thestraight line in the window is maximum. The relation between to graphs isbecause angle and deviation in a fixed window size are related. The graphsare parallel although the amount of noise in approach I, that we measure an-gle in all the vertices in the window is more. We measured the angle betweenthe start the mid and the end point of the window to see wether the amount ofnoise is related to the different between methods that we used for identifyingcurvy segments or not? The results show that in both methods that we used

Figure 4.19: radius and curvature measurement. From left to right: radius of derived circles,1/radius

39

Page 52: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.10. Discussion

for curve identification in approach II the graphs look the same. The amount ofnoise is acceptable but they are different with the results of accumulated anglein approach I, which is because of the number of points that we have used forretrieving information. So first measure the angle of two segments then accu-mulated angle in a fixed window size and at the end moving window for filteringand reducing the noise. The graphs for different alpha boundaries proves thefact that parts that are sharp curves can’t be detected by high values of radiusof α-circles. Curvature and rate of curvature change are two important para-meters for road safety. We used angle and deviation of a point from straight linefor defining curvature. One can easily measure first derivatives of the graphsto see how fast curvature is changing because the most dangerous parts of roadare curvy segments that curvature changes very fast through the curve.

For measuring accumulated angle we first measure signed angle. We give pos-itive values to internal angles of the polygon and negative values to exteriorangles of the polygon because the polygon is a concave polygon(a polygon withone or more interior angle greater than 180 o).

Both approaches can detect curves in a road but the amount of noise in angle-based method is more eventhogh we have measured accumulated angle to de-crease the noise. As we explained, this is because of the geometry of discreteobjects. If we measure the curviness parameters in all vertices in the boundary,it’s not easy to compare the results with the real shape of road on the earth, butmeasuring one value for the set of points in a segment can decrease the noiseand help to estimate the real shape of object in the earth that is the main goalof detecting objects and their parameters from an image.

The methods used in this research are able to detect curves from data sets withdifferent qualities. This is what we discussed by using two binary images withdifferent qualities. Decreasing data quality is a factor that has an influence onobject boundary detection. As the results show where we decrease data quality(binary image) the radius of the α-circles that can detect the whole boundary ofroad increase so we can not detect some curvy segments of road.

We use high resolution image to increase the accuracy. Road width (objectwidth) is an important factor for shape estimation. Where the resolution ishigher we can detect the whole boundary and interior of the road with moreaccuracy. We expect that if the spatial resolution of the data that we are us-ing increases, for example panchromatic images, the accuracy of estimation in-creases. Curve identification from the object boundary is more accurate wherethe data resolution increases because we have more points in the boundary andthe shape look likes the real shape of the object on earth. The method is able todetect curves from object boundary of images.

Changing moving window size and the value of threshold increase the possi-bility of using this method for different objects by different length and differentcurviness moreover the method is very fast in computation and we use two

40

Page 53: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 4. Result and Discussion

different values (cumulative distance and point number) to show high curvysegments of road. The way of visual representation that we used is one of theother advantages of the method because it is a user friendly method and userscan visually see the results.

Based on all we discussed above two main parameters are important for thismethod : spatial resolution of the image and the shape of the digital object.Changing the resolution and the shape of object lead two changing the parame-ters used in the method.

Some important observations are as follow:

1. For the same area if we increase the spatial resolution the number ofpoints on the boundary increase and the distance between them decrease,so alpha circles by smaller radius (measured in meters) can detect theboundary of a road as a polygon. By decreasing the resolution the distancebetween the points on the boundary and the number of points decrease sowe have to use alpha circles by bigger radius to detect the shape of theroad in its boundary.

2. Increasing the resolution until reasonable limit value for example 1 mmeans we have more points in the boundary so the road shape is moresimilar to the real shape of the road on the earth so the accuracy of esti-mation increase.

41

Page 54: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

4.10. Discussion

42

Page 55: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Chapter 5

Conclusions andrecommendations

5.1 Conclusion

The objective of this research was identifying curviness of overpass mountainroads from high resolution remote sensing images. In order to reach the re-search objective, first we used fuzzy c-means classification method and thresh-olding to detect road from a high resolution image in 2D space. The resultis a binary image that represents road as a discrete object. In order to capturecurves and their parameter we identify object boundary using α-shapes that areable to define object boundary in different scales. Between convex boundariesof road the smallest radius of α-circles is entirely able to identify road boundaryeven in curvy segments with small length. In order to define curviness throughroad boundary we use two approaches :

1. In a fixed window that contains a set of connected lines, we measure angleas a parameter for defining curvature in all the vertices and for decreasingthe noise we measure accumulated angle.

2. In the the same size window as a segment the parameter that define curvi-ness (angle or deviation of the mid point from the straight line) is onlymeasured in the mid point of window.

Both approaches can identify curvy segments of road. In approach I (measuringaccumulated angle) the amount of noise is more than approach II (measuringone value in a segment). The results in graphs show that curviness is not a uni-form property of the road even in one curvy segment the amount of curviness isnot constant.

In order to identify the role of data quality in results, we did the experimentfor the binary image derived from different thresholding values. The resultsshow that by decreasing data quality α-circles with small radius r=2 don’t iden-tify the complete boundary (lines in two sides) of the road. By increasing theradius we can detect the whole boundary as a connected shape (polygon) but byincreasing the radius of the circles (r=4), we can not detect all curvy segments

43

Page 56: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

5.2. Recommendation

of the road.

We reached research objective by doing three steps as follows :

• Using simple classification method (fuzzy c-means) and binarization forroad detection

• Applying one of the geometrical algorithms (α-shapes) for detecting theboundary of road

• Use two different but simple approaches (accumulated angle of all the ver-tices in one window and deviation of the mid point of window) to identifycurvy segments in road

5.2 Recommendation

As a next step, the following related works can be done:

• Doing the same experiment for concave part of road boundary (negativevalues of α) to search if we can reach better results in concave parts espe-cially in high curvy segments .

• Because of the same geometry between roads and rivers examine eithermethod work for different curves, coast lines and rivers to expand theapplication of the method.

• Use different data sets with different spatial resolutions and compare theresults with obtained results because the method gives the opportunity tochange the size of α circles and moving window.

44

Page 57: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Bibliography

[1] ENVI 4.1 : What’s new in ENVI 4.1 : accurate, easy to use image software.Research Systems Inc (RSI), Boulder, 2004.

[2] Mountain Pass. www.wikipedia.org/ 16 Feb 2007, 2007.

[3] A. R. Asim and A. Masood. Piecewise polygonal approximation of digitalcurves. In IEEE computer society, editor, Internatinal conferance on infor-mation visualization, pages 991–996, 2006.

[4] L. da F. Costa and R. M. Cesar Jr. Shape Analysis and Classification. CRCPress, 2001.

[5] A. Downy, J. Elkner, and C. Mayars. How to Think Like a Computer Scien-tist: Learning with Python. http://www.thinkpython.com, 2002.

[6] H. Edelsbrunner. Weighted alpha shapes. Technical report, Champaign,IL, USA, 1992.

[7] H. Edelsbrunner and E. P. Mucke. Three-dimensional alpha shapes. ACMTransactions on Graphics, 13(1):43–72, 1994.

[8] C. H. Edwards and D. E. Penney. Calculus and Analytic Geometry.Prentice-Hall, 1982.

[9] J. H. Horng. An adaptive smoothing approach for fitting digital planarcurves with line segments and circular arcs. Pattern Recognition Letters,24:565–577, 2003.

[10] A. Lucieer. Uncertainties in Segmentation and their Visualization. PhDthesis, International Institute of Geo-Information Science and Earth Ob-servation, 2004.

[11] S. Marchand-Maillet and Y. M. Sharaiha. Binary Digital Image Processing(A Discrete Approach). Academic Press, 2000.

[12] H. Mayer. Road extraction from aerial imagery. CV online Compendium ofcomputer vision, 2000.

[13] A. Mohamadzadeh, A. Tavakoli, and M. J. Valadan Zoej. Road extractionbased on fuzzy logic and mathematical morphology from pan sharpenedikonos images. photogrametric record, 21(113):44–60, 2006.

45

Page 58: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Bibliography

[14] M. Mokhtarzade and M. J. Valadan Zoej. Road detection from high-resolution satellite images using artificial neural networks. InternationalJournal of Applied Earth Observation and Geoinformation, In Press, Cor-rected Proof, 2006.

[15] M. Nixon and A. Aguado. Feature Extraction and Image Processing.Newnes, 2002.

[16] S.R. Otto and J. P. Denier. An Introduction to Programming and NumericalMethods in MATLAB. Springer, 2005.

[17] T. D. Pham and H. Yan. An effective algorithm for the segmentation ofdigital plane curves-the isoparametric formulation. Pattern RecognitionLetters, 19:171–176, 1998.

[18] A. Pikaz and I. Dinstein. Using simple decomposition for smoothing andfeature point detection of noisy digital curves. IEEE Transportation onPattern Analysis ans Machine Intelligence, 16(8):808–813, 1994.

[19] C. Ronse. A bibliography on digital and computational convexity. Trans-actions on Pattern Analysis and Machine Intelligence, 11(2), 1989.

[20] A. Rosenfeld and J. S. Weszka. An improved method of angle detection ondigital curves. IEEE Transportation on computers, 24(9):940–941, 1975.

[21] U. Schwarz. Ashape: a Pedestrian Alpha Shape Extractor.http://www.mathworks.com/matlabcentral, 2006.

[22] B. Tso and P. M. Mather. Classification methods for remotely sensed data.Taylor and Francis, London etc., 2001.

[23] M. Worring. Shape Analysis of Digital Curves. University of Amsterdam,1993.

[24] M. Worring and A. Smeulders. Digital curvature estimation. CVGIP: Im-age Understanding archive, 58(3):366 – 382, 1993.

[25] M. Worring and A. W. M. Smeulders. Shape of an arbitrary finite point setin R2. Journal Journal of Mathematical Imaging and Vision, 4(2), 1994.

[26] J. Youn and J. Bethal. Adaptive snakes for urban road extraction. Geo-Imagery Bridging Continents, ISPRS Congress, July 2004.

[27] Y. J. Zhang. Advances in Image and Video Segmentation. 2006.

[28] Y. Zheng. Road traffic accident information system. Technical report, Uni-versity of Glasgow, 2004.

46

Page 59: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Appendix A

Alpha shape MATLAB code forobject boundary identification

% ASHAPE a pedestrian ALPHA SHAPE extractor

%fill a square with random data and put some holes into it

filename=’binary image name’;fid = fopen(filename, ’rt’);

[ID, x, y, z] = textread(filename, ’%d %d %d %d’);

fclose(fid);

for i=1:length(z)if z(i,1)==1

xx(i)=x(i,1);yy(i)=290-y(i,1);

endend

n=400;rand(’state’,10);x=rand(n,1);y=rand(n,1);cp=[

.25 .25 .1

.75 .25 .2

.25 .75 .1

.75 .75 .4

.5 .5 .1];a=pi/180*[0:360];

for j=1:size(cp,1)z=cp(j,1)+1i*cp(j,2)+cp(j,3)*exp(1i*a);z=inpolygon(x,y,real(z),imag(z));

47

Page 60: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

x=x(˜z);y=y(˜z);

endset(0,’defaultfigurepaperorientation’,’portrait’);set(0,’defaultfigurecolor’,[1 1 1]);

create ALPHA SHAPES using circles with radius rshow all valid ALPHA CIRCLES using option <-bc>note ALPHA LINE ALPHA CIRCLES are darkerfor available options see: ALSIB -o

%This is the place that we change the radius(r) to seedifferent results.

r=2;disp(’alpha shaping in progress...’);p=ashape(xx,yy,r,’-bc’);disp(’alpha shaping done’);disp(sprintf(’runtime%10.3fs’,p.runtime));

pause;

48

Page 61: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Appendix B

Python code for finding highcurvy pints based on angle

from math import *from pylab import *def sign_angle(p1,p2,p3):

""" calsulate angle for each three points from the start point"""x1, y1 = p1x2, y2 = p2x3, y3 = p3l12=(x2-x1)**2+(y2-y1)**2l23=(x3-x2)**2+(y3-y2)**2l13=(x3-x1)**2+(y3-y1)**2angle=acos((l13-l12-l23)/(2.0*sqrt(l12)*sqrt(l23)))sig=-sign((x2-x1)*(y1-y3)-(x1-x3)*(y2-y1))sig_ang=angle*sigreturn sig_ang

def sum_angle(xy):start= 1end=len(xy)-1sum_ang=0while start<end:

p1=xy[start-1]p2=xy[start]p3=xy[start+1]sum_ang+=sign_angle(p1,p2,p3)start+=1

return sum_ang

def curvature(xy, DELTA):xy=array(xy)

49

Page 62: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

""" Calculates curvature of a linefrom angle in a segment

"""sum_angles = DELTA * [0.0] #fill with zeroesfor i in range(DELTA, len(xy)-DELTA):

points=xy[i-DELTA:i+DELTA]points=[points[0]-1]+pointssum_ang = sum_angle(points)sum_angles.append(sum_ang)

sum_angles += DELTA * [0.0] #fill with zeroesreturn array(sum_angles)

def plot_ticks(xy, cumdist, tick=50):""" Plot tick marks along a line xy"""for i in range(0, len(xy), tick):

x, y = xy[i]plot([x], [y], ’x’)text(x, y, str(int(cumdist[i])))

def plot_curve(xy, sum_angles, cumdist):""" Plot line xy in window 1 and its curvature ds in window 2"""#figure(num=1, figsize=(4,8.6)) # figure sides equalsubplot(211)xs, ys=transpose(xy)plot(xs, ys)plot_ticks(xy, cumdist)#xlabel(’x’)#ylabel(’y’)

subplot(212)plot(cumdist, sum_angles)xlabel(’cumulative distance’)ylabel(’curvature’)

def plot_danger(xy, sum_angles, threshold):""" Plot dangerous curves on road xy"""subplot(211)t = greater(abs(sum_angles), threshold)for i in range(len(xy)):

if t[i]:x, y = xy[i]plot([x], [y], ’r.’)

50

Page 63: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Appendix B. Python code for finding high curvy pints based on angle

def cummulative_distance(xy):cd = 0.0cds = [0.0]for i in range(len(xy)-1):

x1, y1 = xy[i]x2, y2 = xy[i+1]cd += hypot(x1-x2, y1-y2)cds.append(cd)

return cds

## Start of main program if __name__ == ’__main__’:ion()

DELTA = 11DANGER = 1xy = load(r’road1.txt’)[::-1] # load backwards!cumdist = cummulative_distance(xy)sum_angles = curvature(xy, DELTA)

plot_curve(xy, sum_angles, cumdist)plot_danger(xy, sum_angles, DANGER)

xy = load(r’road2.txt’)cumdist = cummulative_distance(xy)sum_angles = curvature(xy, DELTA)

plot_curve(xy, sum_angles, cumdist)plot_danger(xy, sum_angles, DANGER)

51

Page 64: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

52

Page 65: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Appendix C

Python code for finding highcurvy points based on distance

from pylab import *

def curve_distance(p1, p, p2):""" Calculates distance between point p and line segment p1-p2"""x, y = px1, y1 = p1x2, y2 = p2

if x1 == x2 and y1 == y2: # p1 == p2return hypot(x - x1, y - y1)

return (x * (y2-y1) + y * (x1-x2) + y1 * x2 - x1 * y2) / hypot((x1-x2),(y1-y2))

def curvature(xy, DELTA):""" Calculates curvature of a line

ds has same length as xy"""ds = DELTA * [0.0] #fill with zeroesfor i in range(DELTA, len(xy)-DELTA):

d = curve_distance(xy[i-DELTA], xy[i], xy[i+DELTA])ds.append(d)

ds += DELTA * [0.0] #fill with zeroesreturn array(ds)

def plot_ticks(xy, cumdist, tick=50):""" Plot tick marks along a line xy"""for i in range(0, len(xy), tick):

x, y = xy[i]

53

Page 66: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

plot([x], [y], ’x’)text(x, y, str(int(cumdist[i])))

def plot_curve(xy, ds, cumdist):""" Plot line xy in window 1 and its curvature ds in window 2"""

#figure(num=1, figsize=(4,8.6)) # figure sides equalsubplot(211)xs, ys=transpose(xy)plot(xs, ys)plot_ticks(xy, cumdist)

#xlabel(’x’)#ylabel(’y’)

subplot(212)plot(cumdist, ds)#xlabel(’cumulative distance’)#ylabel(’curvature’)

def plot_danger(xy, ds, threshold):""" Plot dangerous curves on road xy"""subplot(211)t = greater(abs(ds), threshold)for i in range(len(xy)):

if t[i]:x, y = xy[i]plot([x], [y], ’r.’)

def cummulative_distance(xy):cd = 0.0cds = [0.0]for i in range(len(xy)-1):

x1, y1 = xy[i]x2, y2 = xy[i+1]cd += hypot(x1-x2, y1-y2)cds.append(cd)

return cds

## Start of main program if __name__ == ’__main__’:ion()

DELTA = 7DANGER = 9xy = load(r’road1.txt’)[::-1] # load backwards!

54

Page 67: Identifying Curviness of Overpass Mountain Roads from Remote … · 2007-05-08 · Curvy roads are important subjects for many applications, because of ... is capable of identifying

Appendix C. Python code for finding high curvy points based on distance

cumdist = cummulative_distance(xy)ds = curvature(xy, DELTA)

plot_curve(xy, ds, cumdist)plot_danger(xy, ds, DANGER)

xy = load(r’road2.txt’)cumdist = cummulative_distance(xy)ds = curvature(xy, DELTA)

plot_curve(xy, ds, cumdist)plot_danger(xy, ds, DANGER)

55