<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>mmskiz</title> <link href="../tbxdok.css" rel="stylesheet"> </head> <body> <table class="topNav"> <tr> <td class="index"> [<a href="../morph/mmcwatershed.html"><tt>mmcwatershed</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmswatershed.html"><tt>mmswatershed</tt></a>] </td> <td class="title">Thinning And Thickening</td> </tr> </table> <h1>mmskiz <br> <span class="subtitle">Skeleton of Influence Zone - also know as Generalized Voronoi Diagram </span> </h1> <div class="synopsis"> <H2>Synopsis</H2> <div class="H2"> <div class="prototype">y = <span class="fun">mmskiz</span>( <span class="par">f</span>, <span class="par">Bc</span> = None, <span class="par">LINEREG</span> = "LINES", <span class="par">METRIC</span> = None ) </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">Bc</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmSe.html">Structuring Element</a></span><p>Connectivity for the distance measurement.</p><p>Default: <code>None</code> (3x3 elementary cross) </p></td> </tr> <tr> <td class="term"><span class="par">LINEREG</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmString.html">String</a></span><p>'LINES' or 'REGIONS'.</p><p>Default: <code>"LINES"</code> </p></td> </tr> <tr> <td class="term"><span class="par">METRIC</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmString.html">String</a></span><p>'EUCLIDEAN' if specified.</p><p>Default: <code>None</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> Gray-scale (uint8 or uint16) or binary image. </td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="descr"> <H2>Description</H2> <div class="H2"> <p> <span class="fun">mmskiz</span> creates the image <code>y</code> by detecting the lines which are equidistant to two or more connected components of <code>f</code>, according to the connectivity defined by <code>Bc</code>. Depending on with the flag LINEREG, <code>y</code> will be a binary image with the skiz lines or a labeled image representing the zone of influence regions. When the connected objects of <code>f</code> are single points, the skiz is the Voronoi diagram. </p> </div> </div> <div class="examples"> <H2>Examples</H2> <div class="H2"> <p> <div class="bridge">Skiz:</div> <div class="example"> <div class="listing"> <pre class="user">>>> f=mmreadgray('blob2.tif')</pre> <pre class="computer"></pre> <pre class="user">>>> y=mmskiz(f,mmsebox(),'LINES','EUCLIDEAN')</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(f,y)</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="260" src="../images/img_mmskiz_001.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmskiz_001.jpg">f,y</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> <div class="bridge">Voronoi diagram:</div> <div class="example"> <div class="listing"> <pre class="user">>>> from Numeric import zeros</pre> <pre class="computer"></pre> <pre class="user">>>> f=mmbinary(zeros((100,100)))</pre> <pre class="computer"></pre> <pre class="user">>>> f[30,25],f[20,75],f[50,50],f[70,30],f[80,70] = 1,1,1,1,1</pre> <pre class="computer"></pre> <pre class="user">>>> y = mmskiz(f,mmsebox(),'LINES','EUCLIDEAN')</pre> <pre class="computer"></pre> <pre class="user">>>> mmshow(f,y)</pre> <pre class="computer"></pre> </div> <table class="images"> <tbody align="center"> <tr class="image" valign="bottom"> <td><img width="100" src="../images/img_mmskiz_002.jpg"></td> <td class="spare"></td> </tr> <tr class="title" valign="baseline"> <td><a href="../images/img_mmskiz_002.jpg">f,y</a></td> <td class="spare"></td> </tr> </tbody> </table> </div> </p> </div> </div> <div class="descr"> <H2>Limitations</H2> <div class="H2"> <p> For Euclidean metric, please see <code><span class="fun">mmdist</span></code>. </p> </div> </div> <div class="sourcecode"> <H2>Source Code</H2> <div class="H2"> <pre class="listing"> def mmskiz(f, Bc=None, LINEREG="LINES", METRIC=None): from string import upper if Bc is None: Bc = mmsecross() LINEREG = upper(LINEREG) if METRIC is not None: METRIC = upper(METRIC) d = mmdist( mmneg(f), Bc, METRIC) return mmcwatershed(d,f,Bc,LINEREG) 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/mmdist.html">mmdist</a></td> <td class="def">Distance transform.</td> </tr> <tr> <td class="term"><a href="../morph/mmcwatershed.html">mmcwatershed</a></td> <td class="def">Detection of watershed from markers.</td> </tr> </tbody> </table> </div> </div> <center> <table class="botNav"> <tr> <td class="index"> [<a href="../morph/mmcwatershed.html"><tt>mmcwatershed</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmswatershed.html"><tt>mmswatershed</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>