Road network detection - 🔗 link
Get the road network Graph data from a screenshot of a map.
The Road network detection algorithm needs "clean" Maps Screenshots without landmarks, buildings, any labels or markers. You can use screenshots of google map from https://mapstyle.withgoogle.com/ with the following settings:
See example output in /z-output
.
$ python3 main.py <path-to-image>
# python3 main.py ./z-input/kirba.png # for example
Used python v3.10.6
# requirements.txt
cv-algorithms==1.0.4
networkx==3.0
numpy==1.21.5
opencv-python==4.7.0.68
You can see the Breadth First "Edge Detection" algorithm in action in a slideshow here
We have shown an usage of the obtained graph data in main.py. We are using the graph data to find the shortest path between two points on the map. Find the output image in /z-output/dijkstra.png
.