{"id":370,"date":"2011-04-29T07:00:20","date_gmt":"2011-04-29T07:00:20","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/2011\/04\/29\/video-sudoku-solver\/"},"modified":"2013-07-31T13:03:57","modified_gmt":"2013-07-31T18:03:57","slug":"video-sudoku-solver","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2011\/04\/29\/video-sudoku-solver\/","title":{"rendered":"Video Sudoku Solver"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p>I just saw a very cool demo that I thought you might like. Teja Muppirala, an application engineer in our Japan office, created\r\n      a tool that uses MATLAB, Image Processing Toolbox, Image Acquisition Toolbox, and a webcam to solve printed Sudoku puzzles.\r\n      Here you can see Teja holding up an issue of MATLAB News and Notes in front of his webcam:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2011\/sudoku-36s.jpg\"> <\/p>\r\n   <p>And here you can see a MATLAB figure showing that the puzzle has been read and solved:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2011\/sudoku-40s.jpg\"> <\/p>\r\n   <p>Teja makes nice use of Image Processing Toolbox functions for block processing, binary morphology, region measurement, and\r\n      geometric transforms. And he's got the whole thing working for streaming input, not just for a static image capture.\r\n   <\/p>\r\n   <p>Take a look at the <a href=\"https:\/\/www.mathworks.com\/videos\/solving-a-sudoku-puzzle-using-a-webcam-68773.html\">video Teja made<\/a>. You can find all the code for the demo on the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30088-video-sudoku-solver\">MATLAB Central File Exchange<\/a>.\r\n   <\/p>\r\n   <p>Nice work, Teja!<\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_f004c684661b48b6a8fbdf117a34d8c2() {\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='f004c684661b48b6a8fbdf117a34d8c2 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' f004c684661b48b6a8fbdf117a34d8c2';\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 = '';\r\n        copyright = 'Copyright 2011 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_f004c684661b48b6a8fbdf117a34d8c2()\"><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.12<br><\/p>\r\n<\/div>\r\n<!--\r\nf004c684661b48b6a8fbdf117a34d8c2 ##### SOURCE BEGIN #####\r\n%%\r\n% I just saw a very cool demo that I thought you might like. Teja\r\n% Muppirala, an application engineer in our Japan office, created a tool\r\n% that uses MATLAB, Image Processing Toolbox, Image Acquisition Toolbox,\r\n% and a webcam to solve printed Sudoku puzzles. Here you can see Teja\r\n% holding up an issue of MATLAB News and Notes in front of his webcam:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2011\/sudoku-36s.jpg>>\r\n%\r\n% And here you can see a MATLAB figure showing that the puzzle has been\r\n% read and solved:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2011\/sudoku-40s.jpg>>\r\n%\r\n% Teja makes nice use of Image Processing Toolbox functions for block\r\n% processing, binary morphology, region measurement, and geometric\r\n% transforms. And he's got the whole thing working for streaming input, not\r\n% just for a static image capture.\r\n%\r\n% Take a look at the <https:\/\/www.mathworks.com\/videos\/solving-a-sudoku-puzzle-using-a-webcam-68773.html\r\n% video Teja made>. You can find all the code for the demo on the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30088-video-sudoku-solver MATLAB Central\r\n% File Exchange>.\r\n%\r\n% Nice work, Teja!\r\n\r\n##### SOURCE END ##### f004c684661b48b6a8fbdf117a34d8c2\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   I just saw a very cool demo that I thought you might like. Teja Muppirala, an application engineer in our Japan office, created\r\n      a tool that uses MATLAB, Image Processing Toolbox, Image... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2011\/04\/29\/video-sudoku-solver\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/370"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/370\/revisions"}],"predecessor-version":[{"id":866,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/370\/revisions\/866"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}