Code covered by the BSD License  

Highlights from
maze_solution

4.5

4.5 | 4 ratings Rate this file 35 Downloads (last 30 days) File Size: 184.58 KB File ID: #27175
image thumbnail

maze_solution

by Image Analyst

 

06 Apr 2010

Solves mazes using mathematical morphology - find the route through the maze.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

This demo works for "perfect mazes." A perfect maze is defined as a maze which has one and only one path from any point in the maze to any other point. This means that the maze has no inaccessible sections, no circular paths, and no open areas. A perfect maze should have only 2 walls (I believe). No searching or optimization methods (such as A* or dynamic programming) are used - only morphology and standard image processing methods. Only tested for 8 bit integer color and monochrome images.

Demo mazes are included, but you can specify your own maze image. Maze images should have dark walls on a light background. Maze may be surrounded by white, or go right out to the edge of the image and have the outer wall be the outer boundary of the image. The maze image should not include text or pictures, like arrows, animals, etc. -- it should include the maze walls only.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
08 Apr 2010 Loren Shure

Reading the code is a fun way to learn some image processing! The only thing I didn't care for was the super-huge figures that were nearly full-screen and therefore hard to resize and move out of the way. The solution is so fast that seeing the 3 figures in order really adds insight.

--Loren

17 Apr 2010 Cris Luengo

Nice!
I've got some alternative solutions: http://www.cb.uu.se/~cris/blog/index.php/archives/277

27 Apr 2010 Matt Fetterman

Brilliant !!!

10 May 2010 Abdul Basit

Excellent idea of using image processing for the solution.

10 May 2010 Image Analyst

Cris: You've obviously taken it a step further with some nice improvements to make it more robust and handle additional types of complicated mazes. Nice work!

28 May 2010 Benjamin

Love it.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
game Image Analyst 06 Apr 2010 09:54:38
demo Image Analyst 06 Apr 2010 09:54:38
maze Image Analyst 06 Apr 2010 09:54:38
potw Shari Freedman 07 Apr 2010 11:00:02
image processing Loren Shure 08 Apr 2010 08:08:12
fun Image Analyst 16 Sep 2010 10:35:55
image processing Waka Keki 16 Nov 2010 12:10:11
pick of the week Jiro Doke 11 Feb 2011 20:07:21
maze hithesh aum 28 Oct 2011 01:06:04
demo AKAKOM Sagita 07 Mar 2012 22:44:27

Contact us at files@mathworks.com