{"id":2553,"date":"2010-04-30T11:17:38","date_gmt":"2010-04-30T11:17:38","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/04\/30\/solving-mazes-with-image-processing-algorithms\/"},"modified":"2010-04-30T11:17:38","modified_gmt":"2010-04-30T11:17:38","slug":"solving-mazes-with-image-processing-algorithms","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/04\/30\/solving-mazes-with-image-processing-algorithms\/","title":{"rendered":"Solving Mazes with Image Processing Algorithms"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911\">Brett<\/a>'s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/27175-maze-solution\">maze_solution<\/a>, by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/31862\">Image Analyst<\/a>.\r\n   <\/p>\r\n   <p>Last week, Loren <a href=\"https:\/\/blogs.mathworks.com\/loren\/2010\/04\/21\/a-mazing-way-to-learn-some-image-processing\/\">blogged<\/a> about Image Analyst's new File Exchange submission for solving mazes using image processing algorithms. So why am I following\r\n      suit by selecting it as a Pick of the Week? Several reasons. One, because I agree with Loren that \"the maze solver here uses\r\n      image processing concepts such as morphological operations...[in a] fun way...[that] reinforce[s] the application of these\r\n      image processing concepts.\" In other words, Image Analyst's approach was interesting and informational. I've been solving\r\n      the occasional maze since I was a child (a very long time ago), and I've been solving image processing problems for more than\r\n      15 years, but it never occurred to me to use morphological operators to find a solution. In retrospect, the approach makes\r\n      perfect sense: process the image, and use blob analysis to find connected components, and select the one that completes the\r\n      puzzle. Very clever!\r\n   <\/p>\r\n   <p>Second: because I wanted to tag the entry with a \"Pick of the Week\" emblem, for whatever that's worth. :)<\/p>\r\n   <p>And finally, because I recognize that not all readers of the Pick of the Week blog read <a href=\"https:\/\/blogs.mathworks.com\/loren\/\">\"Loren on the Art of MATLAB.\"<\/a> (But they should!)\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/maze.png\"> <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2553#respond\">Comments?<\/a><\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_e41f2c6abb824dc2bc358c25ea8d6dfb() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='e41f2c6abb824dc2bc358c25ea8d6dfb ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' e41f2c6abb824dc2bc358c25ea8d6dfb';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2010 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_e41f2c6abb824dc2bc358c25ea8d6dfb()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.10<br><\/p>\r\n<\/div>\r\n<!--\r\ne41f2c6abb824dc2bc358c25ea8d6dfb ##### SOURCE BEGIN #####\r\n%% Solving Mazes with Image Processing Algorithms\r\n%% \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911 Brett>'s Pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/27175-maze-solution maze_solution>, by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/31862 Image Analyst>.\r\n\r\n%%\r\n% Last week, Loren\r\n% <https:\/\/blogs.mathworks.com\/loren\/2010\/04\/21\/a-mazing-way-to-learn-some-image-processing\/ blogged> \r\n% about Image Analyst's new File Exchange\r\n% submission for solving mazes using image processing algorithms. So why am\r\n% I following suit by selecting it as a Pick of the Week? Several reasons. One,\r\n% because I agree with Loren that \"the maze solver here uses image\r\n% processing concepts such as morphological operations...[in a] fun\r\n% way...[that] reinforce[s] the application of these image processing\r\n% concepts.\" In other words, Image Analyst's approach was interesting and\r\n% informational. I've been solving the occasional maze since I was a child\r\n% (a very long time ago), and I've been solving image processing problems\r\n% for more than 15 years, but it never occurred to me to use morphological\r\n% operators to find a solution. In retrospect, the approach makes perfect\r\n% sense: process the image, and use blob analysis to find connected\r\n% components, and select the one that completes the puzzle. Very clever!\r\n\r\n%%\r\n% Second: because I wanted to tag the entry with a \"Pick of the Week\"\r\n% emblem, for whatever that's worth. :)\r\n\r\n%% \r\n% And finally, because I recognize that not all readers of the Pick of the\r\n% Week blog read <https:\/\/blogs.mathworks.com\/loren\/ \"Loren on the Art of MATLAB.\"> (But they should!)\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/maze.png>>\r\n% \r\n\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2553#respond Comments?>\r\n##### SOURCE END ##### e41f2c6abb824dc2bc358c25ea8d6dfb\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   Brett's Pick this week is maze_solution, by Image Analyst.\r\n   \r\n   Last week, Loren blogged about Image Analyst's new File Exchange submission for solving mazes using image processing... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/04\/30\/solving-mazes-with-image-processing-algorithms\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2553"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2553"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2553\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}