1 | initial version |
Hi, I would first use some kind of threshold on the image. So you have all ways white and all walls black.
Then I would create a Integer-array with the map of the Labyrinth.
Now you can easy use the algorythm first turn left, walk forward till there´s a Wall then turn right,walk forward till wall then turn right........ This will work for the most Labyrinths.
or
You search all impasse [if way = 0 and wall = 1 , all the fields that border on three ones] and fill them till the next crossing. That will give you all possible ways.[work´s everytime]
You can also use: Maze Algorythm from Gaston Tarry [work´s everytime]