[PYTHON] PGM that automatically creates a walking route

PGM

that automatically creates a walking route

I made a PGM that automatically creates a walking route with python. As a procedure for deciding a walk, create an image file in which images of roads and intersections are written on a map in advance. Prepare and randomly select a route from the initial intersection position and exceed the specified distance It works to finish the route creation when becomes.


PGM file

githubURL:https://github.com/NanjoMiyako/AutoWalkingRoot

Sample operation image Runtime processing example ![screenshot1.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/412430/7ebe5e55-b806-02cf-f284-54395248d94a.jpeg)

Road and intersection pre-written base map image example base4.jpg

Output file image example resul2.jpg


How to use Follow the steps below to create a walking route 1. Prepare the base map image file (created with Google Map screenshot etc.) 2. From the top of the base map image file, prepare a file in which the roads of the walk candidates are written in black (RGB: 0,0,0) and the intersections between the roads are written in red (RGB: 255,0,0). Make sure that the roads that are in contact with the road do not overlap. 3. Execute the main1 () method in AutoWalkingRoot.py from the file created in 2. Create an image file that extracts only roads and intersections 4. Execute the main2 () method in AutoWalkingRoot.py to get the X and Y coordinates of the initial position of the walk from the displayed image. 5. Execute the main3 () method in AutoWalkingRoot.py and create a walk route with the following command line arguments Command line argument 1: Base map image path (with extension) Command line argument 2: Road and intersection image path (with extension) Command line argument 3: Initial X position Command line argument 4: Initial Y position Command line argument 5: Minimum walk distance Command line argument 6: Save walk route image file name (with extension)

Referenced site Remove list (array) elements in Python clear, pop, remove, del | note.nkmk.me Repeating with while statements | Getting Started with Python An active engineer explains how to calculate the root (square root) in Python [for beginners] | TechAcademy Magazine

Recommended Posts

PGM that automatically creates a walking route
[Python] A program that creates stairs with #
A system that automatically attends university zoom classes
[Python / Tkinter] A class that creates a scrollable Frame
Nogizaka46 A program that automatically saves blog images
A Vim plugin that automatically formats Python styles
A class that creates DB creation-data insertion with SQLite3 quickly
A tool that automatically turns the gacha of a social game
[Python] A program that creates a two-dimensional array by combining integers