{"id":2606,"date":"2010-10-08T13:14:29","date_gmt":"2010-10-08T13:14:29","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/08\/two-amigos-the-contest-is-over-and-the-results-are-in\/"},"modified":"2010-10-18T14:12:15","modified_gmt":"2010-10-18T14:12:15","slug":"two-amigos-the-contest-is-over-and-the-results-are-in","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/08\/two-amigos-the-contest-is-over-and-the-results-are-in\/","title":{"rendered":"Two Amigos: The contest is over, and the results are in!"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#1\">Recap<\/a><\/li>\r\n         <li><a href=\"#2\">Five Entries<\/a><\/li>\r\n         <li><a href=\"#3\">Corey<\/a><\/li>\r\n         <li><a href=\"#6\">Gajendra<\/a><\/li>\r\n         <li><a href=\"#9\">Igor<\/a><\/li>\r\n         <li><a href=\"#11\">Richard<\/a><\/li>\r\n         <li><a href=\"#13\">Sean<\/a><\/li>\r\n         <li><a href=\"#15\">Prizes<\/a><\/li>\r\n         <li><a href=\"#16\">Brett's Solution on Steve's Image Processing Blog<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Recap<a name=\"1\"><\/a><\/h3>\r\n   <p>Last month, in the wake of Bob's departure from MathWorks, I <a href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/09\/03\/two-amigos\/\">challenged readers<\/a> to alter our picture of the Three Amigos--Brett, Bob, and Jiro--to create a Bob-free image usable for this blog. That competition\r\n      is officially over, and I would like to recap the entries.\r\n   <\/p>\r\n   <h3>Five Entries<a name=\"2\"><\/a><\/h3>\r\n   <p>We received official entries from five readers: Corey Hahn, Gajendra Katuwal, Igor, Richard Cotton, and Sean de Wolski\r\n      (listed alphabetically by first name). Let's look the results of their submissions in turn :\r\n   <\/p>\r\n   <h3>Corey<a name=\"3\"><\/a><\/h3>\r\n   <p>Corey's code calculated in a series of lines the \"extent\" of Bob, and erased him line-by-line. Here's the image Corey's code\r\n      produces:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/cory.png\"> <\/p>\r\n   <p>Corey wrote that he first implemented this using point-by-point deletion, \"but that took way too long.\" So he resubmitted using\r\n      the line-by-line approach, with which he saw a significant speedup.\r\n   <\/p>\r\n   <h3>Gajendra<a name=\"6\"><\/a><\/h3>\r\n   <p>Gajendra came up with a clever approach to the problem only a week after his introduction to MATLAB(!). First, he cropped\r\n      Bob column-by-column. But as we've seen, that leaves a portion of Bob's torso visible. However, Gajendra cleverly\r\n      masked and filled in the torso region with a \"tiled stamp\" sampled from the background trees. His result is shown here:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/himalaya.png\"> <\/p>\r\n   <p>Impressive, especially considering that Gajendra is a newbie!<\/p>\r\n   <h3>Igor<a name=\"9\"><\/a><\/h3>\r\n   <p>Igor provided a late entry, basically cropping and concatenating the left and right halves of the image. He suggested that\r\n      erasing Bob completely is impossible; that we cannot get rid of the hole (the \"ice of separation\") left by simply cropping\r\n      out the middle of the image. He also postulated that fixing the resulting discontinuity (step) in the background is not possible.\r\n       Here's Igor's image:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/igor.png\"> <\/p>\r\n   <h3>Richard<a name=\"11\"><\/a><\/h3>\r\n   <p>Richard took a different tack: he blurred the image in the rectangular region over Bob. The resulting image suggests that\r\n      Bob is fading from our memory. Not so! Nonetheless, here is Richard's image:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/richard.png\"> <\/p>\r\n   <h3>Sean<a name=\"13\"><\/a><\/h3>\r\n   <p>Sean first did a crop-and-concatenation to eliminate most of Bob. But then he went further. Using his own \"ShrinkWrap\" helper\r\n      function (you should consider sharing that on the File Exchange, Sean!), he created a binary map of large, bright objects,\r\n      and manually determined which one corresponded to Bob's torso. With a neat bit of code, he replaced Bob's torso with a snip\r\n      of trees. To hide some of the discontinuity lines, he then executed an overall median filter to slightly blur the image. Here\r\n      is the result:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/sean.png\"> <\/p>\r\n   <h3>Prizes<a name=\"15\"><\/a><\/h3>\r\n   <p>I promised to award two prizes for this competition: \"one for the person whose code results in the best usable Bob-free image,\r\n      and one for the person with the most creative approach to solving the problem.\" I'm going to say that Sean wins the grand\r\n      prize for best re-usable image. His approach, and his mastery of image processing, are impressive. Congratulations, Sean!\r\n      For most creative approach, I like the tiled stamp method that Gajendra used to fill in the void left by deleting Bob's\r\n      torso. (Richard's masking of Bob was creative, too, but didn't really result in a \"Bob-free\" image.) Congratulations, Gajendra!\r\n      And what the heck: everyone who played will be receiving a small token of our appreciation! Thanks, guys, for making this\r\n      competition fun and successful!\r\n   <\/p>\r\n   <h3>Brett's Solution on Steve's Image Processing Blog<a name=\"16\"><\/a><\/h3>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/steve\/2010\/10\/08\/the-two-amigos\/\">My own solution<\/a> is presented today as a guest post on <a href=\"https:\/\/blogs.mathworks.com\/steve\/\">Steve on Image Processing<\/a>. Steve's blog, by the way, always makes for interesting reading, and is highly recommended for anyone interested in the topic.\r\n       Subscribe via email <a title=\"http:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=SteveOnImageProcessing (link no longer works)\">here<\/a>, of follow the blog as a feed by subscribing <a href=\"http:\/\/feeds.feedburner.com\/SteveOnImageProcessing\">here<\/a>.\r\n   <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2606#respond\"> Comments?<\/a><\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_53c327625d264a4bbd0be74ad844f343() {\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='53c327625d264a4bbd0be74ad844f343 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 53c327625d264a4bbd0be74ad844f343';\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_53c327625d264a4bbd0be74ad844f343()\"><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.11<br><\/p>\r\n<\/div>\r\n<!--\r\n53c327625d264a4bbd0be74ad844f343 ##### SOURCE BEGIN #####\r\n%% Two Amigos: The contest is over, and the results are in!\r\n\r\n%% Recap\r\n% Last month, in the wake of Bob's departure from MathWorks, I <https:\/\/blogs.mathworks.com\/pick\/2010\/09\/03\/two-amigos\/ challenged readers> \r\n% to alter our picture of the Three AmigosREPLACE_WITH_DASH_DASHBrett, Bob, and JiroREPLACE_WITH_DASH_DASHto create\r\n% a Bob-free image usable for this blog. That competition is officially\r\n% over, and I would like to recap the entries.\r\n\r\n%% Five Entries\r\n% We received official entries from five readers: Corey Hahn, Gajendra Katuwal, Igor, Richard\r\n% Cotton, and Sean de Wolski (listed alphabetically by first name). Let's look the results of their\r\n% submissions in turn :\r\n\r\n%% Corey\r\n% Corey's code calculated in a series of lines the \"extent\" of Bob, and erased him line-by-line. Here's the image Corey's code produces:\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/cory.png>>\r\n% \r\n\r\n%%\r\n% Corey wrote that he first implemented this using point-by-point deletion,\r\n% \"but that took way too long.\" So he resubmitted using the line-by-line\r\n% approach, with which he saw a significant speedup.  \r\n\r\n%% Gajendra\r\n% Gajendra came up with a clever approach to the problem only a week\r\n% after his introduction to MATLAB(!). First, he cropped Bob\r\n% column-by-column. But as we've seen, that leaves a portion of Bob's torso\r\n% visible. However, Gajendra cleverly masked and filled in the torso region\r\n% with a \"tiled stamp\" sampled from the background trees. His result is\r\n% shown here:\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/himalaya.png>>\r\n% \r\n\r\n%%\r\n% Impressive, especially considering that Gajendra is a newbie!\r\n\r\n%% Igor\r\n% Igor provided a late entry, basically cropping and concatenating the left and right\r\n% halves of the image. He suggested that erasing Bob completely is\r\n% impossible; that we cannot get rid of the hole (the \"ice of separation\") \r\n% left by simply cropping out the middle of the image. He also postulated\r\n% that fixing the resulting discontinuity (step) in the background is not\r\n% possible.  Here's Igor's image:\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/igor.png>>\r\n% \r\n \r\n%% Richard\r\n% Richard took a different tack: he blurred the image in the rectangular\r\n% region over Bob. The resulting image suggests that Bob is fading from our\r\n% memory. Not so! Nonetheless, here is Richard's image:\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/richard.png>>\r\n% \r\n\r\n%% Sean\r\n% Sean first did a crop-and-concatenation to eliminate most of Bob. But\r\n% then he went further. Using his own \"ShrinkWrap\" helper function (you should consider sharing that on the File Exchange, Sean!), he\r\n% created a binary map of large, bright objects, and manually determined\r\n% which one corresponded to Bob's torso. With a neat bit of code, he\r\n% replaced Bob's torso with a snip of trees. To hide some of the\r\n% discontinuity lines, he then executed an overall median filter to slightly blur the\r\n% image. Here is the result:\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/sean.png>>\r\n% \r\n\r\n%% Prizes\r\n% I promised to award two prizes for this competition: \"one for the person\r\n% whose code results in the best usable Bob-free image, and one for the\r\n% person with the most creative approach to solving the problem.\" I'm going\r\n% to say that Sean wins the grand prize for best re-usable image. His\r\n% approach, and his mastery of image processing, are impressive.\r\n% Congratulations, Sean! For most creative approach, I like the tiled stamp\r\n% method that Gajendra used to fill in the void left by deleting Bob's\r\n% torso. (Richard's masking of Bob was creative, too, but didn't really\r\n% result in a \"Bob-free\" image.) Congratulations, Gajendra! And what\r\n% the heck: everyone who played will be receiving a small token of our\r\n% appreciation! Thanks, guys, for making this competition fun and\r\n% successful!\r\n\r\n%% Brett's Solution on Steve's Image Processing Blog\r\n% <https:\/\/blogs.mathworks.com\/steve\/2010\/10\/08\/the-two-amigos\/ My own solution>\r\n% is presented today as a guest post on <https:\/\/blogs.mathworks.com\/steve\/ Steve on Image Processing>. Steve's\r\n% blog, by the way, always makes for interesting reading, and is highly\r\n% recommended for anyone interested in the topic.  Subscribe via email\r\n% <http:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=SteveOnImageProcessing\r\n% here>, of follow the blog as a feed by subscribing\r\n% <http:\/\/feeds.feedburner.com\/SteveOnImageProcessing here>.\r\n%\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2606#respond  Comments?>\r\n##### SOURCE END ##### 53c327625d264a4bbd0be74ad844f343\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   Contents\r\n   \r\n      \r\n         Recap\r\n         Five Entries\r\n         Corey\r\n     ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/08\/two-amigos-the-contest-is-over-and-the-results-are-in\/\">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\/2606"}],"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=2606"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2606\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}