Quantcast
Channel: Representing and solving a maze given an image - Stack Overflow
Browsing latest articles
Browse All 11 View Live

Image may be NSFW.
Clik here to view.

Answer by Brian D for Representing and solving a maze given an image

Here's a solution using R. ### download the image, read it into R, converting to something we can play with... library(jpeg) url <- "https://i.stack.imgur.com/TqKCM.jpg" download.file(url,...

View Article



Image may be NSFW.
Clik here to view.

Answer by stefano for Representing and solving a maze given an image

Here you go: maze-solver-python (GitHub) I had fun playing around with this and extended on Joseph Kern's answer. Not to detract from it; I just made some minor additions for anyone else who may be...

View Article

Image may be NSFW.
Clik here to view.

Answer by moooeeeep for Representing and solving a maze given an image

I tried myself implementing A-Star search for this problem. Followed closely the implementation by Joseph Kern for the framework and the algorithm pseudocode given here: def AStar(start, goal,...

View Article

Image may be NSFW.
Clik here to view.

Answer by Joseph Kern for Representing and solving a maze given an image

This solution is written in Python. Thanks Mikhail for the pointers on the image preparation. An animated Breadth-First Search: The Completed Maze: #!/usr/bin/env python import sys from Queue import...

View Article

Answer by lino for Representing and solving a maze given an image

Here are some ideas. (1. Image Processing:) 1.1 Load the image as RGB pixel map. In C# it is trivial using system.drawing.bitmap. In languages with no simple support for imaging, just convert the image...

View Article


Image may be NSFW.
Clik here to view.

Answer by Jim Gray for Representing and solving a maze given an image

Tree search is too much. The maze is inherently separable along the solution path(s). (Thanks to rainman002 from Reddit for pointing this out to me.) Because of this, you can quickly use connected...

View Article

Image may be NSFW.
Clik here to view.

Answer by kylefinn for Representing and solving a maze given an image

Uses a queue for a threshold continuous fill. Pushes the pixel left of the entrance onto the queue and then starts the loop. If a queued pixel is dark enough, it's colored light gray (above threshold),...

View Article

Image may be NSFW.
Clik here to view.

Answer by Mikhail for Representing and solving a maze given an image

Here is a solution. Convert image to grayscale (not yet binary), adjusting weights for the colors so that final grayscale image is approximately uniform. You can do it simply by controlling sliders in...

View Article


Answer by Thomas for Representing and solving a maze given an image

I'd go for the matrix-of-bools option. If you find that standard Python lists are too inefficient for this, you could use a numpy.bool array instead. Storage for a 1000x1000 pixel maze is then just 1...

View Article


Image may be NSFW.
Clik here to view.

Representing and solving a maze given an image

What is the best way to represent and solve a maze given an image? Given an JPEG image (as seen above), what's the best way to read it in, parse it into some data structure and solve the maze? My...

View Article

Answer by black_john for Representing and solving a maze given an image

the good solution would be that instead of finding the neighbors by pixel, it would be done by cell, because a corridor can have 15px so in the same corridor it can take actions like left or right,...

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images