XAK: 519.173+004.942
MSC2010: 68-04 DOI: https://doi.org/10.37279/1729-3901-2020-19-2-7-18
BUILDING A TRANSPORT NETWORK MODEL USING SATELLITE IMAGES © M. G. Kozlova, M. S. Germanchuk
Taurida Academy by the V.I. Vernadsy Crimea Federal University Vernadsky Av., 4, Simferopol, 295007, Russia e-mail: [email protected]
Building a transport network model using satellite images.
Kozlova M. G., Germanchuk M. S.
Abstract.
A method of constructing a transport network using a satellite image and a set of paths as input data is considered. Software has been developed for building a transport network model based on the specified input data. Examples of the program's operation on various sections of transport networks are considered. The advantages and disadvantages of the developed method are described.
Keywords: transport network, image binarization, GPX-track.
Introduction
Following the evolution of geographic information systems, building models for street and road networks is presently in high demand. Street and road networks models allow to find the shortest routes between two waypoints (both in time and distance), to estimate traffic congestion for different street and road networks sections, traffic intensity and some other characteristics.
The goal of the present work is to apply existing methods of road network model construction for elaborating an algorithm of automatic construction of a multi-level road network model. The input data will be a high-resolution satellite image representing required street and road networks sections and a set of coordinates provided by Global Positioning System trackers belonging to the vehicles located within a certain street and road networks section.
The model is defined here as an undirected connected graph. Each vertex of the graph is described by a pair of geographical coordinates. The vertices (edges) of the graph may contain some additional information (e.g., the width of the road within the section, the number of lanes, the road surface condition, etc.). To build such a graph, a satellite color image of the street and road networks is reduced to a binary form. In the process of binarization, only the carriageway (topological object) is built, while such road elements
as sidewalks, curbs, fences, etc. (non-topological objects) are ignored. It is to note that the evolution of Global Positioning System technologies made it possible to build street and road networks models based on GPX-tracks. It is possible to build an averaged model representing a real street and road networks quite well based on a large enough number of geographic coordinate ordered sets. This method is implemented when simulating racing tracks in video games or when making a description of a road in a difficult-to-see area with large street and road networks sections hidden by other objects, such as rocks in a mountainous area, trees in a forest or tunnels/overpasses in a city.
Based on the given premises, the authors proposed an approach combining an image recognition method and a GPX path application method to construct SRN models. For the input data a binary image is used with the points corresponding to the SRN highlighted in black and a set of GPX-tracks intersecting the described area.
1. Survey of methods for street and road networks building
Following the development of techniques for obtaining accurate images and precise positioning of objects on the earth's surface, it became possible to recreate an accurate map of the earth's surface, which can nowadays be freely accessed using such service systems as Yandex: Maps and Google: Maps. Due to a large increase in number of vehicles, building correct models of street and road networks (SRN) has become quite an urgent task. These models can be used to help analyzing actual traffic conditions, predicting possible complications or advantages for specific types of SRN structural elements, as well as to help optimizing traffic itself.
Road model building based on satellite images is quite complicated because of various types of noise present in the image. This is primarily due to the fact that different road parts may be not visible, hidden in a tunnel, pass under an overpass, or have several levels. In [1], a specific method for image processing was proposed, which has many heuristic parameters to be configured in accordance with the terrain road characteristics which can be distinguished in satellite images.
In [2], the authors described a model of the SRN section in Naberezhnye Chelny. They set the following tasks to achieve: to assess the adopted planning decisions when constructing the SRN by its loading parameters, the speed of vehicles in the SRN, availability and number of traffic accidents; identify SRN sections and elements that require changes; calculate required carrying capacity for the SRN parts which already exist and are under construction. This work implemented a simulation model to define the SRN model characteristics.
In [3], the case of micro-modeling of SRN nodes was provided (micro-modeling means modeling SRN structural sections, such as road rings, intersections or straight road sections, separately from the entire SRN system), which allows to study and optimize specific road sections for getting them into the SRN system in an optimized form. On the example of an intersection of a three-lane road and a four-lane road, the author proved the importance and necessity for such an approach to the construction.
In [4], it is shown an example of constructing a SRN model for modeling emergency situations on a road section: accident, fog, fallen tree or road repairing work. The effects of various conditions on the SRN and traffic flow are analyzed.
In [5], the authors proposed a neural network approach to constructing a model for identifying roads in satellite images. The model is based on a multilayer perceptron, one of the most preferable architectures for artificial neural networks when applied to classification and prognostication problems. The RGB color model is used to find out whether pixels belong to a certain road or not.
In [6, 7], it is proposed an approach to constructing SRN models of vector maps based on a polygonal figure skeleton. This approach allows finding intersection patterns on a map, classifying intersections by configuration, providing SRNs in a form serving as a basis for simulations in traffic geographic information systems.
Of notice is that to date there can be distinguished three methods (and their combination) of constructing SRN models as applicable to the problems and studies proposed by the authors of the articles mentioned above. Those methods comprise: manual, based on using specialized software; construction based on object recognition in the image; construction based on generalization of a set of GPX tracks. A GPX file comprises a set of GPS data (key positions, paths, etc.) stored in an xml file. A GPX track will be called a GPX file that stores an ordered set of geographic coordinates corresponding to the path of a certain object on the earth surface.
It is important that due to the evolution of GPS technologies it became possible to construct SRN models based on GPX tracks. On the base of a great number of ordered sets of geographic coordinates, the algorithm builds an averaged model describing an actual SRN with good precision. This method is mostly used in modeling racing tracks in video games or when making a road description in a difficult-to-see area with large SRN sections being hidden by other objects, such as rocks in a mountainous area, trees in a forest or tunnels/overpasses in a city. However, building a relevant model in such a manner requires sufficient data encompassing all the variety of possible traffic trajectories for a corresponding SRN section. This means that a person with a receiver is to move in all possible directions within an SRN which is a highly time-consuming process. To
collect tracks, such companies as Google and Yandex use geolocation sensors installed into mobile phones and navigators. This allows to accumulate necessary amount of data which are far less accurate than in professional systems.
Let us consider a construction method which is a combination of methods based on road recognition in a satellite image and construction of a model by a set of tracks. This approach allows to verify and complement models based on image recognition while using a significantly smaller number of tracks.
2. Design of a system for building an SRN model
To build an SRN model, we designed an algorithm combining the methods based on image recognition and using GPX tracks. The input data is a binary image containing SRN associated waypoints highlighted in black and a set of GPX tracks belonging to a relevant territory. The stage of a traffic network image recognition consisted of preprocessing the input image and a procedure of its skeletonization.
To create a software application, we used Java programming language as its libraries are convenient for data visualization with an image processing system integrated into it. The JavaMonkeyEngine graphics engine was used for interactive visualization. The system input data is organized into a file with a .dat extension that has the following structure: test-bit.png //String with a relative address of a binary image file. 44.988401 34.079755 // Geographic coordinates corresponding to the image upper left pixel
90.0 // Azimuth corresponding to the image horizontal axis. 373 335 // Width and height of the image, in meters.
//There is 0 or more relative links for GPX tracks to the end of the file test-bit-track1.gpx test-bit-track2.gpx
Following the skeletonization of the binary image (based on the Zong-Sun algorithm [8]), a graph that corresponds to the SRN model is built. Its main idea can be represented in the following form: cl = 0 ct = 0
cycle i from 0 to ImageWidth — 1 cycle j from 0 to ImageWidth — 1 if point belongs to skeleton then
cl = 0 ct = 0
if point has coordinates (i — 1, j) £ V then add to E edge {(i,j), (i — 1,j)}
cl = ct = 1;
if point has coordinates (i,j — 1) £ V then add to E edge {(i, j), (i, j — 1)} ct = 1;
if point has coordinates (i,j + 1) £ V then add to E edge {(i,j), (i,j + 1)} cl = 1;
if ct = 0 point has coordinates (i — 1, j — 1) £ V then
add to E edge {(i, j), (i — 1, j — 1)} if cl = 0 point has coordinates (i — 1, j + 1) £ V then add to E edge {(i,j), (i — 1,j + 1)}
However, the resulting graph looks cumbersome. To optimize it, it is necessary to select all sequences of edges having the minimal deviations from the correlation line. Besides, it is necessary to combine such adjacent vertices that have more than two edges adjacent to each of them, with the vertices being at distances corresponding to the SRN width from each other. Hence, the following sequence is executed:
1) optimization of skeleton's edges;
2) primary optimization of connection points for segments;
3) secondary optimization of connection points for segments.
Determining a sequence of edges is done by sequentially supplementing the list with edges incident to the extreme edges of the sequence. Optimized edges are marked. It is not possible to optimize a sequence of edges if one of the interior points of the sequence has a degree greater than 2.
After optimizing the edges, the connection points for the edges are also optimized. This process is executed in two passes.
The algorithm for primary optimization of points connecting edges consists of the following steps:
1°. As far as there are unmarked vertices with degree 3, perform 2° — 6°.
2°. Select the next vertex.
3°. Identify a pair of edges BxCx, ByCy whose lines have an angle of 180 ± N degrees (N is predefined in advance).
4°. If there is no such pair of edges, then move the vertex to the center of the triangle formed by lines B1C1, B2C2, B3C3. Otherwise, optimize the vertex by placing it at the intersection of lines CxCy and AC2.
5°. Remove vertices B1, B2, B3 from the graph by connecting vertices C1, C2, C3 with vertex A.
6°. Mark the optimized vertex.
The algorithm for secondary optimization of points connecting edges consists of the following steps:
1°. As far as there are unmarked vertices with degree from 3 to 5, perform 2° — 7°.
2°. Select the next vertex.
3°. For the edges incident to a given vertex A, identify a pair of edges AB, AC so that they had an angle of 180 ± N degrees (N is predefined in advance).
4°. If there is no such pair of edges, then the vertex does not need optimization; mark it and go to 2°.
5°. If the degree of the vertex is 3, then optimize the vertex by placing it at the intersection point of lines BC h aD.
6°. If the degree of the vertex is 4, then place the vertex in the middle of segment FG, where point F is obtained by intersecting lines BC and AD, and point G is got by intersecting lines BC and AE.
7°. Mark the optimized vertex.
As a result, an optimized SRN graph will be obtained. The resulting graph is a single-level road network model. However, this model will be incorrect in the case of a multi-level SRN because the algorithm cannot recognize hidden sections of the road, and the resulting model will have gaps in it.
To extend the model to multi-level cases, the following algorithm is proposed:
1°. Delete all vertices that are less than at a certain threshold distance from the dead-end vertex (the distance is defined as the length of the path by the edges of the graph).
2°. In the resulting graph, connect each dead-end vertex with a weighted edge having 0 weight to the remaining dead-end vertices.
The resulting graph is a model for all possible cases of the SRN behavior in a given section. The edge weight represents the numerical value of "confidence" that the edge belongs to the correct model.
To confirm or to deny the presence of additional weighted edges in the correct graph model, the method of drawing GPX tracks on a model overflowed with edges was used. A GPX file is a set of GPS data (key positions, paths, etc.) stored in an xml file.
We call a GPX file a GPX track if it contains the path of an object on the earth's surface stored in the form of an ordered set of geographical coordinates. In our application, such a structure is implemented by using the class Track, which allows not only to store and use tracks
as ordered sets of coordinates, but also to convert them to graph structures or calculate image points corresponding to track points. The precision of converting waypoints into image point depends on the ratio of the image-covered surface area to the image resolution.
To implement geographic coordinates, we created GeoMath class that describes the following functions and procedures:
• conversion of geographic coordinates, recorded in different formats, from a string to a vector;
• conversion of geolocation vectors to a pair of geographic coordinates in text format;
• calculation of a distance between two geographical points;
• calculation of the azimuth for the start and end of movement from one point to another, and intermediate points for the shortest path between two points;
• calculation of the arrival point, when departing from a specified geographical point in a specified direction at a specified distance;
• detection of an intersection for two paths defined by two points or by a point, direction, and distance.
To calculate distance between two points on the earth surface, the following algorithms can be implemented [10, 11].
Fast algorithm:
given geographic coordinates pi and p2
df = p2.latitude — pl.latitude dl = p2.longitude — pl.longitude
a = sin(df/2)2 + cos(pl.latitude) • cos(p2.latitude) • sin(dl/2)2 c = 2 • atan2(sqrt(a), sqrt(l — a)) return EARTH_RAD_METERS • c
Slow but more accurate algorithm:
given geographic coordinates pi and p2
dl = p2.longitude — pl.longitude
c = acos(sin(p1.latitude) • sin(p2.latitude) + cos (pl.latitude) • cos(p2.latitude) • cos(dl)) return EARTH_RAD_METERS • c
In the software, we implemented the fast algorithm as its accuracy is sufficient for work based on the available resolution of satellite images, which can presently be downloaded from open sources.
To move between points, it is necessary to calculate the movement direction. Azimuth parameters (measured in degrees) are used to define direction. To calculate it when moving to a specified point on the surface, we used the following algorithm: given geographic coordinates pl and p2
dl = p2.longitude — pl.longitude y = sin(dl) • cos(p2.latitude)
x = cos(pl.latitude) • sin(p2.latitude) — sin(pl.latitude) • cos(p2.latitude) • cos(dl) return atan2(y,x), converted to a range from 0 to 360
To calculate azimuths for intermediate points, we designed the following algorithm: given geographic coordinates pl, p2 and f value in the range between [0,1], where 0 - movement starting point, a 1 - end point
angDist = distance between points pl and p2 divided by EARTH _RAD_METERS
a = (sin((1?f) • angDist))/(sin(angDist)) b = (sin(f • angDist)/(sin(angDist))
x = a • cos(pl.latitude) • cos (pl.longitude) + b • cos(p2.latitude) • cos(p2.longitude) y = a • cos(pl.latitude) • sin(pl.longitude) + b • cos(p2.latitude) • sin(p2.longitude) z = a • sin(pl.latitude) + b • sin(p2.latitude) latitude = atan2(z, sqrt(x2 + y2)) longitude = atan2(y,x)
conversion of latitude and longitude to values ranged between [0,360] return latitude, longitude
The algorithm returns the path's intermediate point between points pl, p2 and f value within a range of [0,1], where 0 is a departure point, and 1 is an arrival point. EARTH_RAD_METERS value specifies the earth's approximate radius. To correctly compare GPX track coordinates and map points, geographical coordinates corresponding to the image's upper left point and the azimuth for the image's horizontal axis are taken as initial data. This allows to interpolate points and assign geographical coordinates to each point in the image. GeoQuad class, representing a square plot of the earth's surface, is responsible for this.
a) b)
Fig. 1. a) model binary image representing two tracks; b) constructed SRN model placed upon a binary image
To give an example, let us consider an SRN model binary image (fig. 1 a)). It shows two tracks passing through each of the paths. It is assumed that the paths go at different levels. In this case, two tracks are enough to build a complete and correct SRN model.
In fig. 1 b), it is shown the result of implementing the program. Green lines indicate graph's edges, red dots are used to highlight vertices. It can be seen on the visualized model (fig. 2) that there is no vertex at the point of intersecting edges, as ribs belong to different levels. When additional information in the form of GPX tracks is absent, it is not possible to accurately determine the SRN configuration, as the road sections to the left and to the right might be the road's dead ends.
JMonkeyEngine 3.2-stable
END - toggle mouse; P - copy current coordinates; 1-0 - map modes;
044 59 12 N 034 04 55 E ^ ......4 0B1862)
Fig. 2. Visualization of a model fragment
For testing, we selected a few examples. One such example is the multi-level road junction in the city of Simferopol at the intersection of Kievskaya Street and the bypass road (fig. 3a)). This road junction seems appropriate for initial testing as it is mostly exposed for recognition.
Fig. 3. a) satellite image of the junction; b) binary image of the junction
The SRN fragments blocked or covered with shadows are marked as not belonging to the SRN. The skeleton for this SRN fragment is shown in fig. 4 a). Judging by the skeleton image, its
use will make the model incomplete. It can be easily noticed that only one GPX track is required to confirm the SRN configuration for this section (the track is shown in fig 4 b)).
Fig. 4. a) skeleton based on a binary image; b) SRN binary image with green color indicating path for GPX track
Fig. 5. Image of a model built upon the SRN binary image
To note the shortcomings of the proposed approach, the algorithm is prone to "misunderstand" road exits when analyzing more complex road junctions if they are located at places with a high degree of obstruction (Moscow, Saint Petersburg). However, after stripping unnecessary dead ends and increasing number of tracks, followed by stripping low weight edges, this problem can be effectively solved.
Conclusion
In this work, we propose a novel approach to constructing SRN models based on a combination of methods implementing road recognition in satellite images and road construction by GPX tracks. This approach to model building allows to compensate for errors in road recognition and requires the minimum number of tracks, in that reducing the time needed to construct them. The proposed algorithm is automatic and has complexity O(n3), which allows to minimize the need for human participation in model construction. The algorithm can be effectively implemented when modeling simple road junctions, bridges, overpasses, and any types of SRNs without multiple overlaps of closely located elements, yet it can fail when modeling road sections with a very large number of gaps. The work on updating relevant algorithms is underway to make it possible to split binary images into fragments to then model them independently.
Acknowledgment
The authors would like to thank Sergey Gulyaev.
References
1. PANKAJ, P. & GARD, R. (2014) Road detection from remote sensing images using impervious surface characteristics: Review and implication. The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences. Vol. 8. p. 955 959. DOI:10.5194/isprsarchives-XL-8-955-2014
2. GALIAKBAROV, R. N. & MOSOLOVA, T. G. & KHAERTDINOV, A. I. (2013) Modeling a section of the city's road network in order to optimize its parameters. SWORLD. 4. p. 40 46. (In Russian)
3. ROTAR, V. G. & STEKLENEV, N. A. (2015) Software micro simulation of nodes of the road network of the city. Eurasian Scientific AssociationD. 6. p. 64 67. (In Russian)
4. OSMUSHKIN, A. A. & BOGDANOVA, I. G. & SIDOROV, A. V. (2013) Modeling of emergency situations on the road network. Modern problems of science and education. 6. p. 382 385. (In Russian)
5. KAHRAMAN, I. & TURAN, M. & KARAS, I. (2015) Road Detection from Hight Satellite Images Using Neural Networks. International Journal of Modeling and Optimization. Vol. 8. No. 4. p. 304 307. DOI: 10.7763/IJMO.2015.V5.479
6. MEKHEDOV, I. S. & KOZLOV, A. V. (2009) Model of a road network based on a skeleton. Graphicon'2009. p. 356 359. (In Russian)
7. MEKHEDOV, I. S. (2010) Search for intersection templates on a vector map of the city's road network. Mathematical methods for pattern recognition. p. 414 417. (In Russian)
8. GUDKOV, V. YU. & KLYUEV, D. A. (2015) Skeleton of binary images and selection of special points for fingerprint recognition. Bulletin of the South Ural State University. Series Computer Technologies, Automatic Control, Radioelectronics. p. 11 17. (In Russian)
9. LISOVSKY, E. (2017) Artificial intelligence and neural networks in cartography-2: when "people's" maps are cooler than Google. URL: www.forbes.ru/tehnologii/351121-iskusstvennyy-intellekt-i-neyroseti-v-kartografii-2-kogda-narodnye-karty-kruche
10. Calculate distance, bearing and more between Latitude/Longitude points // Movable Type Scripts. URL: www.movable-type.co.uk/scripts/latlong.html
11. Vector-based geodesy // Movable Type Scripts. URL: www.movable-type.co.uk/scripts/latlong-vectors.html#intersection
12. GERMANCHUK, M. S. & KOZLOVA, M. G. (2019) Pseudo-Boolean optimization models and algorithms in routing problems. Modern problems of dynamic systems analysis. Theory and practice. Proceedings of the international open conference may 21-23, 2019, Voronezh. p. 109 112. (In Russian)