maze

Representing and solving a maze given an image

半腔热情 提交于 2019-11-26 04:57:24
问题 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 first instinct is to read the image in pixel by pixel and store it in a list (array) of boolean values: True for a white pixel, and False for a non-white pixel (the colours can be discarded). The issue with this method, is that the image may not be \"pixel perfect\". By that I simply mean that if