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: Segmentation Path 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 Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Troy Sornson Super Cool Maze Solving Project Path Finding Simple, Straight Forward Not very interesting Troy Sornson Super Cool Maze Solving Project Segmentation Much more interesting Kind of tricky Troy Sornson Super Cool Maze Solving Project Segmentation First Approach Convert image to grayscale Use a thresholding algorithm I hear OTSU is pretty good... Troy Sornson Super Cool Maze Solving Project OTSU Troy Sornson Super Cool Maze Solving Project OTSU Troy Sornson Super Cool Maze Solving Project OTSU Troy Sornson Super Cool Maze Solving Project OTSU Naive OTSU not so good... Problem: Pixels that were not part of the maze were skewing histogram Troy Sornson Super Cool Maze Solving Project Histogram 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 OTSU Troy Sornson Super Cool Maze Solving Project OTSU (Gaussian Histogram) Troy Sornson Super Cool Maze Solving Project OTSU (Original Histogram) Troy Sornson Super Cool Maze Solving Project OTSU (with Gaussian) Troy Sornson Super Cool Maze Solving Project Solved! Troy Sornson Super Cool Maze Solving Project Can we do better? 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 values Color has 2563 possible pixel values Lots 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 , ...ck 1 Go through every point, assign to closest cluster in {c1 , c2 , ...ck } 2 Based on cluster points, recalculate c1 , c2 , ..., ck 3 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 K-Means Troy Sornson Super Cool Maze Solving Project OTSU (with Gaussian) Troy Sornson Super Cool Maze Solving Project Other Mazes Troy Sornson Super Cool Maze Solving Project Other Mazes Troy Sornson Super Cool Maze Solving Project Other Mazes Troy Sornson Super Cool Maze Solving Project Other Mazes Troy Sornson Super Cool Maze Solving Project Other Mazes Troy Sornson Super Cool Maze Solving Project Other Mazes (failures) Troy Sornson Super Cool Maze Solving Project Other Mazes (failures) Troy Sornson Super Cool Maze Solving Project Other Mazes (failures) Troy Sornson Super Cool Maze Solving Project Other Mazes (failures) 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 Other Mazes (failures) Troy Sornson Super Cool Maze Solving Project Other Mazes (failures) 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 Questions Questions? Troy Sornson Super Cool Maze Solving Project