Maze generator and solver with python

Overview

Procedural-Maze-Generator-Algorithms

Check out my youtube channel : Auctux

Ressources

Requirements

PYGAME : pip install pygame

Commands Controls:

  • Esc to close the program
  • Enter to start to genrate the maze
  • H to show the heuristic cost value
  • S to show the path from the starting to the goal node
  • Space to switch between the color modes

files

  • run main.py for grid mazes
  • run polarMaze.py for polarGrid maze
  • run hexMaze.py for hexGrid maze
  • run imageMaze.py for maskGrid maze
  • run weightedMaze.py for weightedGrid maze

you can also braid your mazes when it done , by calling the function grid.Braid(). braiding a maze simply assures that the maze doens't have any deadends

colors modes

Mode 1 : Mode 2 :

other Maze Grid:

Polar Grid : HexGrid : maskGrid :

Show heuristic and path

  • heuristic :
  • showPath :

Bugs & Unsolved Issues

  • The code need a lot of refactoring
  • the visualization of the polar maze need a lot of improvement
  • the the imagemaze.py file need to be refactored for it to be able to work on every size of images , for now it's only working for images wich has the same size with the screen size
  • the recursive backtracker class need a little bit of cleaning
  • add Comments
  • implement the ui interface
  • the djikistra algorithm need to take the weights of cells in consideration for weightedGrid

mazes


initialize:
 binary_tree = BinaryTree(Grid(rows, cols, cell_size), "GREEN")
 wilson = Wilson(Grid(rows, cols, cell_size), "PURPLE_E")
 side_winder = SideWinder(Grid(rows, cols, cell_size), "BLUE")
 hunt_and_kill = HuntAndKill(Grid(rows, cols, cell_size), "RED")
 aldous_broder = AldousBroder(Grid(rows, cols, cell_size), "GREEN")
 recursive_backtracker = RecursiveBacktracker(Grid(rows, cols, cell_size), "BLUE")
 kruskal = Kruskals(Kruskals.State(Grid(rows, cols, cell_size)))
 simplePrims = SimplePrims(Grid(rows, cols, cell_size), "CYAN")
 prims = Prims(Grid(rows, cols, cell_size))
 growingTree = GrowingTree(Grid(rows, cols, cell_size), "GREEN")
 ellers = Ellers(Grid(rows, cols, cell_size), 0, "RED")
mainloop():
 wilson.Generate(screen, show_text, color_mode, show_path)
 binary_tree.Generate(screen, show_text, color_mode, show_path)
 kruskal.Generate(screen, show_text, color_mode, show_path)
 side_winder.Generate(screen, show_text, color_mode, show_path)
 hunt_and_kill.Generate(screen, show_text, color_mode, show_path)
 aldous_broder.Generate(screen, show_text, color_mode, show_path)
 recursive_backtracker.Generate(screen, show_text, color_mode, show_path)
 simplePrims.Generate(screen, show_text, color_mode, show_path)
 prims.Generate(screen, show_text, color_mode, show_path)
 growingTree.Generate(screen, show_text, color_mode, show_path)
 ellers.Generate(screen, show_text, color_mode, show_path)

  • Aldous Broder

  • Binary Tree

  • Eller's Algorithm

  • Growing Tree

  • Hunt And kill

  • Kruskal's algorithm

  • Prims Algorithm

  • Simplified Prims

  • Wilson algorithm

  • Sidewinder Algorithm

  • Recursive Backtracker

Enjoy ✌️

Owner
Joseph
Change the world, one line of code at a time ; )
Joseph
CellProfiler is a open-source application for biological image analysis

CellProfiler is a free open-source software designed to enable biologists without training in computer vision or programming to quantitatively measure phenotypes from thousands of images automaticall

CellProfiler 732 Dec 23, 2022
Responsive Doc. scanner using U^2-Net, Textcleaner and Tesseract

Responsive Doc. scanner using U^2-Net, Textcleaner and Tesseract Toolset U^2-Net is used for background removal Textcleaner is used for image cleaning

3 Jul 13, 2022
pulse2percept: A Python-based simulation framework for bionic vision

pulse2percept: A Python-based simulation framework for bionic vision Retinal degenerative diseases such as retinitis pigmentosa and macular degenerati

67 Dec 29, 2022
Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentation, CVPR 2020 (Oral)

SEAM The implementation of Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentaion. You can also download the repos

Hibercraft 459 Dec 26, 2022
Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Suryam Thapa 1 Jan 26, 2022
Distort a video using Seam Carving (video) and Vibrato effect (sound)

Distort videos Applies a Seam Carving algorithm (aka liquid rescale) on every frame of a video, and a vibrato effect on the audio to distort the video

AlexZeGamer 6 Dec 06, 2022
A webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV.

Qbr Qbr, pronounced as Cuber, is a webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV. 🌈 Accurate color detection 🔍 Accurate 3x3x

Kim 金可明 502 Dec 29, 2022
The open source extract transaction infomation by using OCR.

Transaction OCR Mã nguồn trích xuất thông tin transaction từ file scaned pdf, ở đây tôi lựa chọn tài liệu sao kê công khai của Thuy Tien. Mã nguồn có

Nguyen Xuan Hung 18 Jun 02, 2022
text detection mainly based on ctpn model in tensorflow, id card detect, connectionist text proposal network

text-detection-ctpn Scene text detection based on ctpn (connectionist text proposal network). It is implemented in tensorflow. The origin paper can be

Shaohui Ruan 3.3k Dec 30, 2022
OpenCVを用いたカメラキャリブレーションのサンプルです。2021/06/21時点でPython実装のある3種類(通常カメラ向け、魚眼レンズ向け(fisheyeモジュール)、全方位カメラ向け(omnidirモジュール))について用意しています。

OpenCV-CameraCalibration-Example FishEyeCameraCalibration.mp4 OpenCVを用いたカメラキャリブレーションのサンプルです 2021/06/21時点でPython実装のある以下3種類について用意しています。 通常カメラ向け 魚眼レンズ向け(

KazuhitoTakahashi 34 Nov 17, 2022
A little but useful tool to explore OCR data extracted with `pytesseract` and `opencv`

Screenshot OCR Tool Extracting data from screen time screenshots in iOS and Android. We are exploring 3 options: Simple OCR with no text position usin

Gabriele Marini 1 Dec 07, 2021
A novel region proposal network for more general object detection ( including scene text detection ).

DeRPN: Taking a further step toward more general object detection DeRPN is a novel region proposal network which concentrates on improving the adaptiv

Deep Learning and Vision Computing Lab, SCUT 151 Dec 12, 2022
list all open dataset about ocr.

ocr-open-dataset list all open dataset about ocr. printed dataset year Born-Digital Images (Web and Email) 2011-2015 COCO-Text 2017 Text Extraction fr

hongbomin 95 Nov 24, 2022
Official code for "Bridging Video-text Retrieval with Multiple Choice Questions", CVPR 2022 (Oral).

Bridging Video-text Retrieval with Multiple Choice Questions, CVPR 2022 (Oral) Paper | Project Page | Pre-trained Model | CLIP-Initialized Pre-trained

Applied Research Center (ARC), Tencent PCG 99 Jan 06, 2023
aardio的opencv库

opencv_aardio dll库下载地址:https://github.com/xuncv/opencv-plugin/releases import cv2 img = cv2.imread("./images/Lena.jpg",1) img = cv2.medianBlur(img,5)

71 Dec 31, 2022
Code for the "Sensing leg movement enhances wearable monitoring of energy expenditure" paper.

EnergyExpenditure Code for the "Sensing leg movement enhances wearable monitoring of energy expenditure" paper. Additional data for replicating this s

Patrick S 42 Oct 26, 2022
M-LSDを用いて四角形を検出し、射影変換を行うサンプルプログラム

M-LSD-warpPerspective-Example M-LSDを用いて四角形を検出し、射影変換を行うサンプルプログラムです。 Requirements OpenCV 3.4.2 or Later tensorflow 2.4.1 or Later Usage 実行方法は以下です。 pytho

KazuhitoTakahashi 9 Oct 14, 2022
Corner-based Region Proposal Network

Corner-based Region Proposal Network CRPN is a two-stage detection framework for multi-oriented scene text. It employs corners to estimate the possibl

xhzdeng 140 Nov 04, 2022
Scene text recognition

AttentionOCR for Arbitrary-Shaped Scene Text Recognition Introduction This is the ranked No.1 tensorflow based scene text spotting algorithm on ICDAR2

777 Jan 09, 2023
Face_mosaic - Mosaic blur processing is applied to multiple faces appearing in the video

動機 face_recognitionを使用して得られる顔座標は長方形であり、この座標をそのまま用いてぼかし処理を行った場合得られる画像は醜い。 それに対してモ

Yoshitsugu Kesamaru 6 Feb 03, 2022