123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Classes/Modules — image features extraction 1.0.0 documentation</title>
- <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '1.0.0',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true,
- SOURCELINK_SUFFIX: '.txt'
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="prev" title="Tutorial" href="tutorial.html" />
-
- <link rel="stylesheet" href="_static/custom.css" type="text/css" />
-
-
- <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
- </head>
- <body>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="classes-modules">
- <h1>Classes/Modules<a class="headerlink" href="#classes-modules" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="module-Images">
- <span id="images"></span><h2>Images<a class="headerlink" href="#module-Images" title="Permalink to this headline">¶</a></h2>
- <dl class="class">
- <dt id="Images.Images">
- <em class="property">class </em><code class="descclassname">Images.</code><code class="descname">Images</code><span class="sig-paren">(</span><em>folder_name, image_file_ext=['tif', 'tiff']</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Images.html#Images"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Images.Images" title="Permalink to this definition">¶</a></dt>
- <dd><p>This class is used as collection of images which will be loaded from a given folder name</p>
- <dl class="method">
- <dt id="Images.Images.count">
- <code class="descname">count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Images.Images.count" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="Images.Images.count_update">
- <code class="descname">count_update</code><span class="sig-paren">(</span><em>count</em><span class="sig-paren">)</span><a class="headerlink" href="#Images.Images.count_update" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="Images.Images.item">
- <code class="descname">item</code><span class="sig-paren">(</span><em>i</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Images.html#Images.item"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Images.Images.item" title="Permalink to this definition">¶</a></dt>
- <dd><p>image item</p>
- </dd></dl>
- </dd></dl>
- </div>
- <div class="section" id="module-Image">
- <span id="image"></span><h2>Image<a class="headerlink" href="#module-Image" title="Permalink to this headline">¶</a></h2>
- <dl class="class">
- <dt id="Image.Image">
- <em class="property">class </em><code class="descclassname">Image.</code><code class="descname">Image</code><span class="sig-paren">(</span><em>full_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Image.html#Image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Image.Image" title="Permalink to this definition">¶</a></dt>
- <dd><p>Class image containing the single image obtained from the collection <a class="reference internal" href="#module-Images" title="Images"><code class="xref py py-class docutils literal"><span class="pre">Images</span></code></a></p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Example:</th><td class="field-body"></td>
- </tr>
- </tbody>
- </table>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="Image.Image.file_name">
- <code class="descname">file_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Image.html#Image.file_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Image.Image.file_name" title="Permalink to this definition">¶</a></dt>
- <dd><p>file_name(…) return the full file name of the image</p>
- </dd></dl>
- <dl class="method">
- <dt id="Image.Image.regions">
- <code class="descname">regions</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Image.html#Image.regions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Image.Image.regions" title="Permalink to this definition">¶</a></dt>
- <dd><p>regions(…) returns the Object Regions</p>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">regs</span> <span class="o">=</span> <span class="n">img</span><span class="o">.</span><span class="n">Regions</span><span class="p">()</span>
- </pre></div>
- </div>
- </dd></dl>
- </dd></dl>
- </div>
- <div class="section" id="module-Regions">
- <span id="regions"></span><h2>Regions<a class="headerlink" href="#module-Regions" title="Permalink to this headline">¶</a></h2>
- <dl class="class">
- <dt id="Regions.Regions">
- <em class="property">class </em><code class="descclassname">Regions.</code><code class="descname">Regions</code><span class="sig-paren">(</span><em>obj_regions</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Regions.html#Regions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Regions.Regions" title="Permalink to this definition">¶</a></dt>
- <dd><p>This class represent a collection of regions: segmented image elements
- It cannot be instanced directly. It is returned from the object <a class="reference internal" href="#module-Image" title="Image"><code class="xref py py-class docutils literal"><span class="pre">Image</span></code></a> through the function
- Regions(…)</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Example:</th><td class="field-body"></td>
- </tr>
- </tbody>
- </table>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">regs</span> <span class="o">=</span> <span class="n">img</span><span class="o">.</span><span class="n">Regions</span><span class="p">()</span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="Regions.Regions.count">
- <code class="descname">count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Regions.Regions.count" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="Regions.Regions.count_update">
- <code class="descname">count_update</code><span class="sig-paren">(</span><em>count</em><span class="sig-paren">)</span><a class="headerlink" href="#Regions.Regions.count_update" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="Regions.Regions.get_features">
- <code class="descname">get_features</code><span class="sig-paren">(</span><em>features</em>, <em>class_value=None</em>, <em>class_name='class_name'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Regions.html#Regions.get_features"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Regions.Regions.get_features" title="Permalink to this definition">¶</a></dt>
- <dd><p>get_features(…) returns a table with all values for the property names given in input, and supplies an
- additional parameter for feature classification</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>features</strong> (<em>List</em>) – list of property/measure names (e.g, ‘area’, ‘centroid’, etc )</li>
- <li><strong>class_value</strong> (<em>int</em><em>, </em><em>string</em><em> (</em><em>default=None</em><em>)</em>) – classification label</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">table cointaining all property values (columns) for all elements in the regions object (rows)</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Pandas.DataFrame</p>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Example:</th><td class="field-body"></td>
- </tr>
- </tbody>
- </table>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">regs</span> <span class="o">=</span> <span class="n">img</span><span class="o">.</span><span class="n">Regions</span><span class="p">()</span>
- <span class="gp">>>> </span><span class="n">df</span> <span class="o">=</span> <span class="n">regs</span><span class="o">.</span><span class="n">get_features</span><span class="p">([</span><span class="s1">'label'</span><span class="p">,</span> <span class="s1">'area'</span><span class="p">,</span><span class="s1">'perimeter'</span><span class="p">,</span> <span class="s1">'centroid'</span><span class="p">],</span> <span class="n">class_value</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
- </pre></div>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="Regions.Regions.item">
- <code class="descname">item</code><span class="sig-paren">(</span><em>i</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Regions.html#Regions.item"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Regions.Regions.item" title="Permalink to this definition">¶</a></dt>
- <dd><p>Item(..) returns the i-th image element of the regions.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>i</strong> (<em>int</em>) – the i-th element of the collection region</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Region</td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Example:</th><td class="field-body"></td>
- </tr>
- </tbody>
- </table>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">regs</span> <span class="o">=</span> <span class="n">img</span><span class="o">.</span><span class="n">Regions</span><span class="p">()</span>
- <span class="gp">>>> </span><span class="n">reg</span> <span class="o">=</span> <span class="n">regs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- </pre></div>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="Regions.Regions.prop_values">
- <code class="descname">prop_values</code><span class="sig-paren">(</span><em>prop_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Regions.html#Regions.prop_values"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Regions.Regions.prop_values" title="Permalink to this definition">¶</a></dt>
- <dd><p>prop_values(…) returns the values of the specified property/measure name (e.g., ‘area’) for all image
- elements contained in the object Regions. For a list of property names refer to “regionprops <<a class="reference external" href="http://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops">http://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops</a>>”_.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>prop_name</strong> (<em>string</em>) – name of the property to measure (e.g, ‘area’)</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">values of the property name in input</td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">List</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Example:</th><td class="field-body"></td>
- </tr>
- </tbody>
- </table>
- <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">image_features_extraction</span> <span class="k">as</span> <span class="nn">fe</span>
- <span class="gp">>>> </span><span class="n">imgs</span> <span class="o">=</span> <span class="n">fe</span><span class="o">.</span><span class="n">Images</span><span class="p">(</span><span class="n">folder_name</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">imgs</span><span class="o">.</span><span class="n">item</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">regs</span> <span class="o">=</span> <span class="n">img</span><span class="o">.</span><span class="n">Regions</span><span class="p">()</span>
- <span class="gp">>>> </span><span class="n">areas</span> <span class="o">=</span> <span class="n">regs</span><span class="o">.</span><span class="n">prop_values</span><span class="p">(</span><span class="s1">'area'</span><span class="p">)</span>
- </pre></div>
- </div>
- </dd></dl>
- </dd></dl>
- </div>
- <div class="section" id="module-Region">
- <span id="region"></span><h2>Region<a class="headerlink" href="#module-Region" title="Permalink to this headline">¶</a></h2>
- <dl class="class">
- <dt id="Region.Region">
- <em class="property">class </em><code class="descclassname">Region.</code><code class="descname">Region</code><span class="sig-paren">(</span><em>obj_region</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Region.html#Region"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Region.Region" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="method">
- <dt id="Region.Region.area">
- <code class="descname">area</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Region.html#Region.area"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Region.Region.area" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- </dd></dl>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <h1 class="logo"><a href="index.html">image features extraction</a></h1>
- <h3>Navigation</h3>
- <p class="caption"><span class="caption-text">Contents:</span></p>
- <ul class="current">
- <li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
- <li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
- <li class="toctree-l1 current"><a class="current reference internal" href="#">Classes/Modules</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="#module-Images">Images</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#module-Image">Image</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#module-Regions">Regions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#module-Region">Region</a></li>
- </ul>
- </li>
- </ul>
- <div class="relations">
- <h3>Related Topics</h3>
- <ul>
- <li><a href="index.html">Documentation overview</a><ul>
- <li>Previous: <a href="tutorial.html" title="previous chapter">Tutorial</a></li>
- </ul></li>
- </ul>
- </div>
- <div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <div><input type="text" name="q" /></div>
- <div><input type="submit" value="Go" /></div>
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="footer">
- ©2017, Remigio Picone.
-
- |
- Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.3</a>
- & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
-
- |
- <a href="_sources/code.rst.txt"
- rel="nofollow">Page source</a>
- </div>
-
-
- </body>
- </html>
|