Skip to content

Pixela Maze : Python script that finds the shortest path through a maze.

License

Notifications You must be signed in to change notification settings

luc1d-ed/Pixela-Maze

Repository files navigation

Pixel Maze

A Python program that visualizes the process of solving a maze by skeletonizing an image and finding the optimal path between two points.

Installation

  1. Clone the Repository:
git clone https://github.com/luc1d-ed/Pixela-Maze.git
cd Pixela-Maze

Alternatively, download the ZIP file and extract it.

  1. Install Dependencies: Ensure you have Python installed, then install the required packages using:
pip install -r requirements.txt

Setup

It's recommended to use Jupyter Notebook, especially for marking the start and end points.

  1. Choose Your Maze:

    Obtain a maze image you want to solve (e.g., from Maze Toys)

  2. Place the Image in the Appropriate Directory:

Pixela-Maze/
├── Mazes/
│   ├── Maze.toys/
│   │   └── {image_file}
│   ├── Examples/
├── Breadth-first.ipynb
├── Breadth-first.py
├── Depth-first.ipynb
├── Depth-first.py
├── requirements.txt

Or change the directory in the notebook.

  1. Update the Image Path:

    In the Jupyter Notebook, update the filename in the second code block (or on line 11): Image File Name

  2. Set Start and End Points:

    Start End Points

  3. Run the Notebook:

    Execute the cells one by one to solve your maze.

Credit

Channel: Odlogo

YouTube: How to Solve a Maze - Live Coding - Python - Image Analysis

GitHub: How to solve a maze

This repository is basically a copy of the above mentioned video. I plan to add a GUI for making this easier to use.

Contributing

Feel free to open issues or submit pull requests for any improvements.