<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>mmdcookies</title> <link href="../tbxdok.css" rel="stylesheet"> </head> <body> <table class="topNav"> <tr> <td class="index"> [<a href="../mmdemos/mmdconcrete.html"><tt>mmdconcrete</tt></a>] [<a href="index.html">Up</a>] [<a href="../mmdemos/mmdcornea.html"><tt>mmdcornea</tt></a>] </td> <td class="title">Demonstrations</td> </tr> </table> <h1>mmdcookies <br> <span class="subtitle">Detect broken rounded biscuits. </span> </h1> <div class="descr"> <H2>Description</H2> <div class="H2"> <p> The input image is a gray-scale image of two rounded-shaped biscuits. One of them is broken. The purpose is to detect the broken biscuit. </p> </div> </div> <div class="script"> <H2>Demo Script</H2> <div class="H2"> <div class="slide"> <H3>Reading</H3> <div class="H3"> <p> <p> The input image is read. </p> <div class="example"> <div class="listing"> <pre class="user">>>> a = mmreadgray('cookies.tif');</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(a);</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="314" src="../images/img_mmdcookies_001.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmdcookies_001.jpg">a</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> <div class="slide"> <H3>Thresholding</H3> <div class="H3"> <p> <p> Convert to binary objects by thresholding </p> <div class="example"> <div class="listing"> <pre class="user">>>> b = mmthreshad(a, uint8(100));</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(b);</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="314" src="../images/img_mmdcookies_002.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmdcookies_002.jpg">b</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> <div class="slide"> <H3>Open tophat with large octagon disk</H3> <div class="H3"> <p> <p> The tophat of the binary image by an octagon disk with a radius fits the good biscuit but does not fit in the broken biscuit can detect the broken one. </p> <div class="example"> <div class="listing"> <pre class="user">>>> c = mmopenth(b,mmsedisk(55,'2D','OCTAGON'));</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(c);</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="314" src="../images/img_mmdcookies_003.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmdcookies_003.jpg">c</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> <div class="slide"> <H3>Remove the residues</H3> <div class="H3"> <p> <p> Clean the residues from the octagon disk and the rounded shaped biscuits by eliminating small connected regions </p> <div class="example"> <div class="listing"> <pre class="user">>>> d = mmareaopen(c,400);</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(d);</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="314" src="../images/img_mmdcookies_004.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmdcookies_004.jpg">d</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> <div class="slide"> <H3>Final display</H3> <div class="H3"> <p> <p> Display the detected broken biscuit </p> <div class="example"> <div class="listing"> <pre class="user">>>> mmshow(a,d);</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="314" src="../images/img_mmdcookies_005.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmdcookies_005.jpg">a,d</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> </div> </div> <center> <table class="botNav"> <tr> <td class="index"> [<a href="../mmdemos/mmdconcrete.html"><tt>mmdconcrete</tt></a>] [<a href="index.html">Up</a>] [<a href="../mmdemos/mmdcornea.html"><tt>mmdcornea</tt></a>] </td> <td rowspan="2" class="xhtml"><a href="http://www.python.org"><img width="55" alt="Python" height="22" src="../PythonPoweredSmall.gif"></a></td> </tr> <tr> <td class="copyright">Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.</td> </tr> </table> </center> </body> </html>