<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>mmthick</title> <link href="../tbxdok.css" rel="stylesheet"> </head> <body> <table class="topNav"> <tr> <td class="index"> [<a href="../morph/mmswatershed.html"><tt>mmswatershed</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmthin.html"><tt>mmthin</tt></a>] </td> <td class="title">Thinning And Thickening</td> </tr> </table> <h1>mmthick <br> <span class="subtitle">Image transformation by thickening. </span> </h1> <div class="synopsis"> <H2>Synopsis</H2> <div class="H2"> <div class="prototype">y = <span class="fun">mmthick</span>( <span class="par">f</span>, <span class="par">Iab</span> = None, <span class="par">n</span> = -1, <span class="par">theta</span> = 45, <span class="par">DIRECTION</span> = "CLOCKWISE" ) </div> <p>Implemented in <b>Python.</b> </p> <div class="input"> <H3>Input</H3> <div class="H3"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><span class="par">f</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmImage.html">Image</a></span> Binary image. </td> </tr> <tr> <td class="term"><span class="par">Iab</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmInterval.html">Interval</a></span><p>Default: <code>None</code> (mmhomothick) </p></td> </tr> <tr> <td class="term"><span class="par">n</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmDouble.html">Double</a></span> Non-negative integer. <p>Number of iterations.</p><p>Default: <code>-1</code> </p></td> </tr> <tr> <td class="term"><span class="par">theta</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmDouble.html">Double</a></span><p>Degrees of rotation: 45, 90, or 180.</p><p>Default: <code>45</code> </p></td> </tr> <tr> <td class="term"><span class="par">DIRECTION</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmString.html">String</a></span><p>'CLOCKWISE' or ' ANTI-CLOCKWISE'</p><p>Default: <code>"CLOCKWISE"</code> </p></td> </tr> </tbody> </table> </div> </div> <div class="output"> <H3>Output</H3> <div class="H3"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><span class="par">y</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmImage.html">Image</a></span> Binary image. </td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="descr"> <H2>Description</H2> <div class="H2"> <p> <span class="fun">mmthick</span> creates the binary image <code>y</code> by performing a thickening of the binary image <code>f</code>. The number of iterations of the thickening is <code>n</code> and each iteration is performed by union of <code>f</code> with the points that are detected in <code>f</code> by the hit-miss operators characterized by rotations of <code>theta</code> degrees of the interval <code>Iab</code>. </p> </div> </div> <div class="equation"> <H2>Equation</H2> <div class="H2"> <p> <div class="eqfig"> <img src="../images/eq_mmthick001.png"> </div> </p> </div> </div> <div class="sourcecode"> <H2>Source Code</H2> <div class="H2"> <pre class="listing"> def mmthick(f, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"): from Numeric import product from string import upper if Iab is None: Iab = mmhomothick() DIRECTION = upper(DIRECTION) assert mmisbinary(f),'f must be binary image' if n == -1: n = product(f.shape) y = f zero = mmintersec(f,0) for i in range(n): aux = zero for t in range(0,360,theta): sup = mmsupgen( y, mminterot(Iab, t, DIRECTION)) aux = mmunion( aux, sup) y = mmunion( y, sup) if mmisequal(aux,zero): break return y </pre> </div> </div> <div class="seealso"> <H2>See also</H2> <div class="H2"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><a href="../morph/mmfreedom.html">mmfreedom</a></td> <td class="def">Control automatic data type conversion.</td> </tr> <tr> <td class="term"><a href="../morph/mmcthick.html">mmcthick</a></td> <td class="def">Image transformation by conditional thickening.</td> </tr> <tr> <td class="term"><a href="../morph/mmthin.html">mmthin</a></td> <td class="def">Image transformation by thinning.</td> </tr> <tr> <td class="term"><a href="../morph/mmhomothick.html">mmhomothick</a></td> <td class="def">Interval for homotopic thickening.</td> </tr> <tr> <td class="term"><a href="../morph/mmse2hmt.html">mmse2hmt</a></td> <td class="def">Create a Hit-or-Miss Template (or interval) from a pair of structuring elements.</td> </tr> </tbody> </table> </div> </div> <center> <table class="botNav"> <tr> <td class="index"> [<a href="../morph/mmswatershed.html"><tt>mmswatershed</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmthin.html"><tt>mmthin</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>