A "simple" OpenCV maze solver
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Antonio De Lucreziis 326b6907df updated readme 1 year ago
debug-steps added thumbnails 2 years ago
images added a better image 2 years ago
.gitignore initial commit 2 years ago
ALGORITHM.md updated algorithm file 2 years ago
README.md updated readme 1 year ago
cv_maze.py some tweaks and algorithm breakdown 2 years ago
main.py added debug image steps for explainer (to be written) 2 years ago
main_camera.py initial commit 2 years ago
main_camera_test.py some tweaks and algorithm breakdown 2 years ago
poetry.lock initial commit 2 years ago
pyproject.toml initial commit 2 years ago
utils.py some tweaks and algorithm breakdown 2 years ago

README.md

OpenCV Maze Solver

This is a simple maze solver using OpenCV and Python. The maze is solved using the A* algorithm from the NetworkX library. I tested this on my old laptop using it's built-in webcam and it run mostly in realtime.

Markers This project uses apriltag markers (from the family tag25h9) to detect the start and end points of the maze. Here is the meaning of each tag:

  • tag25_09_00001, tag25_09_00002: are used to detect boundaries of the maze.

  • tag25_09_00003 tells the start point of the maze.

  • tag25_09_00004 tells the end point of the maze.

An in-depth explaination of the algorithm with pictures of the various steps of the pipeline can be found in the ALGORITHM.md file.

Installation

This project uses Poetry for dependency management. To install the dependencies, run the following command:

poetry install

Usage

Image

To run the maze solver, use the following command:

poetry run python main.py --image <image_path>

Replace <image_path> with the path to the maze image you want to solve like images/IMG_0867.jpg.

Camera

To run the maze solver using the camera, use the following command:

poetry run python main_camera.py