super cool maze solving project - inside...
Post on 27-May-2018
220 Views
Preview:
TRANSCRIPT
Super Cool Maze Solving Project
Troy Sornson
December 3, 2014
Troy Sornson Super Cool Maze Solving Project
What is a Maze?
A network of paths designed as a puzzle to be traversed
Troy Sornson Super Cool Maze Solving Project
How to solve a Maze
Two parts to this project:
SegmentationPath finding
Path finding is actually really easy
Segmentation is more... interesting...
Troy Sornson Super Cool Maze Solving Project
Path Finding
Happens after segmentation
Perform a floodfill of the path (breadth first search)
When end is found, draw solution on decreasing values
Troy Sornson Super Cool Maze Solving Project
Path Finding
Simple, Straight Forward
Not very interesting
Troy Sornson Super Cool Maze Solving Project
Segmentation
First Approach
Convert image to grayscaleUse a thresholding algorithmI hear OTSU is pretty good...
Troy Sornson Super Cool Maze Solving Project
OTSU
Naive OTSU not so good...
Problem: Pixels that were not part of the maze were skewinghistogram
Troy Sornson Super Cool Maze Solving Project
OTSU
New assumption: Assume maze is near center of image
Reward pixels closer to the center
Penalize pixels by the edges
Sounds like a Gaussian to me!
Troy Sornson Super Cool Maze Solving Project
Can we do better?
Converting a color image to grayscale might have problems
Grayscale has 256 possible pixel valuesColor has 2563 possible pixel valuesLots of collisions!
Could have a color image that looks good
Converting to grayscale results in a uniform gray
This all means segmentation in color should be examined
Troy Sornson Super Cool Maze Solving Project
Segmentation in Color
Solution: Clustering
K-Means is a good clustering algorithm
Troy Sornson Super Cool Maze Solving Project
K-Means
Pick random cluster centers, c1, c2, ...ck1 Go through every point, assign to closest cluster in
{c1, c2, ...ck}2 Based on cluster points, recalculate c1, c2, ..., ck3 Keep doing this until all c1, c2, ..., ck stop moving
Troy Sornson Super Cool Maze Solving Project
K-Means
Pick K = 2
Keep using the Gaussian to weigh points
Troy Sornson Super Cool Maze Solving Project
Other Mazes (failures)
Failures happen when lower angle on maze
walls blend together, less path to segment
More failures when lighting conditions causes shadows
Troy Sornson Super Cool Maze Solving Project
Future Work
Use local probability
Use local segmentation
Possibly handle mazes with bridges
Interpolate hidden paths
Troy Sornson Super Cool Maze Solving Project
top related