|
@@ -0,0 +1,681 @@
|
|
|
+
|
|
|
+
|
|
|
+<!DOCTYPE html>
|
|
|
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
|
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+
|
|
|
+ <title>ipfml.metrics — IPFML v0.2.8 documentation</title>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
|
|
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|
|
+ <link rel="index" title="Index" href="../genindex.html" />
|
|
|
+ <link rel="search" title="Search" href="../search.html" />
|
|
|
+ <link rel="next" title="ipfml.processing" href="ipfml.processing.html" />
|
|
|
+ <link rel="prev" title="Documentation" href="../ipfml.html" />
|
|
|
+
|
|
|
+
|
|
|
+ <script src="../_static/js/modernizr.min.js"></script>
|
|
|
+
|
|
|
+</head>
|
|
|
+
|
|
|
+<body class="wy-body-for-nav">
|
|
|
+
|
|
|
+
|
|
|
+ <div class="wy-grid-for-nav">
|
|
|
+
|
|
|
+
|
|
|
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
|
+ <div class="wy-side-scroll">
|
|
|
+ <div class="wy-side-nav-search">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <a href="../index.html" class="icon icon-home"> IPFML
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </a>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <div class="version">
|
|
|
+ 0.2.8
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<div role="search">
|
|
|
+ <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
|
+ <input type="text" name="q" placeholder="Search docs" />
|
|
|
+ <input type="hidden" name="check_keywords" value="yes" />
|
|
|
+ <input type="hidden" name="area" value="default" />
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <p class="caption"><span class="caption-text">Contents:</span></p>
|
|
|
+<ul class="current">
|
|
|
+<li class="toctree-l1"><a class="reference internal" href="../description.html">Description</a></li>
|
|
|
+<li class="toctree-l1 current"><a class="reference internal" href="../ipfml.html">Documentation</a><ul class="current">
|
|
|
+<li class="toctree-l2 current"><a class="current reference internal" href="#">ipfml.metrics</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="ipfml.processing.html">ipfml.processing</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="ipfml.utils.html">ipfml.utils</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="ipfml.exceptions.html">ipfml.exceptions</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="../ipfml.html#ipfml-filters">ipfml.filters</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="../ipfml.html#ipfml-iqa">ipfml.iqa</a></li>
|
|
|
+</ul>
|
|
|
+</li>
|
|
|
+<li class="toctree-l1"><a class="reference internal" href="../examples.html">Examples</a></li>
|
|
|
+<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing</a></li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+
|
|
|
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
+
|
|
|
+
|
|
|
+ <nav class="wy-nav-top" aria-label="top navigation">
|
|
|
+
|
|
|
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
|
+ <a href="../index.html">IPFML</a>
|
|
|
+
|
|
|
+ </nav>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="wy-nav-content">
|
|
|
+
|
|
|
+ <div class="rst-content">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<div role="navigation" aria-label="breadcrumbs navigation">
|
|
|
+
|
|
|
+ <ul class="wy-breadcrumbs">
|
|
|
+
|
|
|
+ <li><a href="../index.html">Docs</a> »</li>
|
|
|
+
|
|
|
+ <li><a href="../ipfml.html">Documentation</a> »</li>
|
|
|
+
|
|
|
+ <li>ipfml.metrics</li>
|
|
|
+
|
|
|
+
|
|
|
+ <li class="wy-breadcrumbs-aside">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <a href="https://github.com/jbuisine/IPFML/blob/master/docs/source/ipfml/ipfml.metrics.rst" class="fa fa-github"> Edit on GitHub</a>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </li>
|
|
|
+
|
|
|
+ </ul>
|
|
|
+
|
|
|
+
|
|
|
+ <hr/>
|
|
|
+</div>
|
|
|
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
|
+ <div itemprop="articleBody">
|
|
|
+
|
|
|
+ <div class="section" id="module-ipfml.metrics">
|
|
|
+<span id="ipfml-metrics"></span><h1>ipfml.metrics<a class="headerlink" href="#module-ipfml.metrics" title="Permalink to this headline">¶</a></h1>
|
|
|
+<p>Functions which can be used to extract information from image</p>
|
|
|
+<p class="rubric">Functions</p>
|
|
|
+<table border="1" class="longtable docutils">
|
|
|
+<colgroup>
|
|
|
+<col width="10%" />
|
|
|
+<col width="90%" />
|
|
|
+</colgroup>
|
|
|
+<tbody valign="top">
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_LAB" title="ipfml.metrics.get_LAB"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_LAB</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into Lab</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_LAB_L" title="ipfml.metrics.get_LAB_L"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_LAB_L</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into Lab and returns L</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_LAB_a" title="ipfml.metrics.get_LAB_a"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_LAB_a</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into LAB and returns a</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_LAB_b" title="ipfml.metrics.get_LAB_b"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_LAB_b</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into LAB and returns b</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_SVD" title="ipfml.metrics.get_SVD"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_SVD</span></code></a>(image)</td>
|
|
|
+<td>Transforms Image using SVD compression</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_SVD_U" title="ipfml.metrics.get_SVD_U"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_SVD_U</span></code></a>(image)</td>
|
|
|
+<td>Transforms Image into SVD and returns only ‘U’ part</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_SVD_V" title="ipfml.metrics.get_SVD_V"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_SVD_V</span></code></a>(image)</td>
|
|
|
+<td>Transforms Image into SVD and returns only ‘V’ part</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_SVD_s" title="ipfml.metrics.get_SVD_s"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_SVD_s</span></code></a>(image)</td>
|
|
|
+<td>Transforms Image into SVD and returns only ‘s’ part</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_XYZ" title="ipfml.metrics.get_XYZ"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_XYZ</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into XYZ</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_XYZ_X" title="ipfml.metrics.get_XYZ_X"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_XYZ_X</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into XYZ and returns X</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_XYZ_Y" title="ipfml.metrics.get_XYZ_Y"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_XYZ_Y</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into XYZ and returns Y</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_XYZ_Z" title="ipfml.metrics.get_XYZ_Z"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_XYZ_Z</span></code></a>(image)</td>
|
|
|
+<td>Transforms RGB Image into XYZ and returns Z</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.get_bits_img" title="ipfml.metrics.get_bits_img"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_bits_img</span></code></a>(image, interval)</td>
|
|
|
+<td>Returns only bits specified into the interval</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.metrics.get_low_bits_img" title="ipfml.metrics.get_low_bits_img"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_low_bits_img</span></code></a>(image[, nb_bits])</td>
|
|
|
+<td>Returns Image or Numpy array with data information reduced using only low bits</td>
|
|
|
+</tr>
|
|
|
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.metrics.gray_to_mscn" title="ipfml.metrics.gray_to_mscn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gray_to_mscn</span></code></a>(image)</td>
|
|
|
+<td>Convert Grayscale Image into Mean Subtracted Contrast Normalized (MSCN)</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_LAB">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_LAB</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_LAB"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_LAB" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into Lab</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Lab information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">Lab</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_LAB</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">Lab</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_LAB_L">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_LAB_L</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_LAB_L"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_LAB_L" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into Lab and returns L</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The L chanel from Lab information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">L</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_LAB_L</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">L</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_LAB_a">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_LAB_a</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_LAB_a"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_LAB_a" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into LAB and returns 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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The a chanel from Lab information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">a</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_LAB_a</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_LAB_b">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_LAB_b</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_LAB_b"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_LAB_b" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into LAB and returns b</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The b chanel from Lab information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage :</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">b</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_LAB_b</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">b</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_SVD">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_SVD</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_SVD"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_SVD" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms Image using SVD compression</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>image</strong> – image to convert into SVD compression</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">U, s, V obtained from SVD compression</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">U</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">V</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_SVD</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">U</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
|
|
|
+<span class="go">200</span>
|
|
|
+<span class="gp">>>> </span><span class="n">V</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 3, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_SVD_U">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_SVD_U</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_SVD_U"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_SVD_U" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms Image into SVD and returns only ‘U’ part</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">U matrix from SVD compression</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">U</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_SVD_U</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">U</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_SVD_V">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_SVD_V</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_SVD_V"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_SVD_V" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms Image into SVD and returns only ‘V’ part</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">V matrix obtained from SVD compression</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage :</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">V</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_SVD_V</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">V</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 3, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_SVD_s">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_SVD_s</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_SVD_s"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_SVD_s" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms Image into SVD and returns only ‘s’ part</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">vector of singular values obtained from SVD compression</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_SVD_s</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
|
|
|
+<span class="go">200</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_XYZ">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_XYZ</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_XYZ"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_XYZ" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into XYZ</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">XYZ information obtained from transformation</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">metrics</span><span class="o">.</span><span class="n">get_XYZ</span><span class="p">(</span><span class="n">img</span><span class="p">)</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_XYZ_X">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_XYZ_X</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_XYZ_X"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_XYZ_X" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into XYZ and returns X</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The X chanel from XYZ information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_XYZ_X</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_XYZ_Y">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_XYZ_Y</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_XYZ_Y"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_XYZ_Y" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into XYZ and returns Y</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The Y chanel from XYZ information</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">y</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_XYZ_Y</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">y</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_XYZ_Z">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_XYZ_Z</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_XYZ_Z"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_XYZ_Z" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Transforms RGB Image into XYZ and returns Z</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>image</strong> – image to convert</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The Z chanel from XYZ information</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – If <cite>nb_bits</cite> has unexpected value. <cite>nb_bits</cite> needs to be in interval [1, 8].</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">z</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_XYZ_Z</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">z</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_bits_img">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_bits_img</code><span class="sig-paren">(</span><em>image</em>, <em>interval</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_bits_img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_bits_img" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Returns only bits specified into the interval</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>image</strong> – image to convert using this interval of bits value to keep</li>
|
|
|
+<li><strong>interval</strong> – (begin, end) of bits values</li>
|
|
|
+</ul>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Numpy array with reduced values</p>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
|
|
|
+<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – If min value from interval is not >= 1.</li>
|
|
|
+<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – If max value from interval is not <= 8.</li>
|
|
|
+<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – If min value from interval >= max value.</li>
|
|
|
+</ul>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">bits_img</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_bits_img</span><span class="p">(</span><span class="n">img</span><span class="p">,</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
|
|
|
+<span class="gp">>>> </span><span class="n">bits_img</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.get_low_bits_img">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">get_low_bits_img</code><span class="sig-paren">(</span><em>image</em>, <em>nb_bits=4</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#get_low_bits_img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.get_low_bits_img" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Returns Image or Numpy array with data information reduced using only low bits</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>image</strong> – image to convert</li>
|
|
|
+<li><strong>nb_bits</strong> – optional parameter which indicates the number of bits to keep</li>
|
|
|
+</ul>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Numpy array with reduced values</p>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">metrics</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">low_bits_img</span> <span class="o">=</span> <span class="n">metrics</span><span class="o">.</span><span class="n">get_low_bits_img</span><span class="p">(</span><span class="n">img</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">low_bits_img</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200, 3)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="function">
|
|
|
+<dt id="ipfml.metrics.gray_to_mscn">
|
|
|
+<code class="descclassname">ipfml.metrics.</code><code class="descname">gray_to_mscn</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/metrics.html#gray_to_mscn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.metrics.gray_to_mscn" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Convert Grayscale Image into Mean Subtracted Contrast Normalized (MSCN)</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>image</strong> – grayscale image</td>
|
|
|
+</tr>
|
|
|
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">MSCN matrix obtained from transformation</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+<p>Usage:</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">PIL</span> <span class="k">import</span> <span class="n">Image</span>
|
|
|
+<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">processing</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'./images/test_img.png'</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img_mscn</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">rgb_to_mscn</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
|
|
|
+<span class="gp">>>> </span><span class="n">img_mscn</span><span class="o">.</span><span class="n">shape</span>
|
|
|
+<span class="go">(200, 200)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <footer>
|
|
|
+
|
|
|
+ <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
+
|
|
|
+ <a href="ipfml.processing.html" class="btn btn-neutral float-right" title="ipfml.processing" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
|
|
+
|
|
|
+
|
|
|
+ <a href="../ipfml.html" class="btn btn-neutral" title="Documentation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <hr/>
|
|
|
+
|
|
|
+ <div role="contentinfo">
|
|
|
+ <p>
|
|
|
+ © Copyright 2019, Jérôme BUISINE
|
|
|
+
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
+
|
|
|
+</footer>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </section>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></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>
|
|
|
+ <script type="text/javascript" src="../_static/language_data.js"></script>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <script type="text/javascript" src="../_static/js/theme.js"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ jQuery(function () {
|
|
|
+ SphinxRtdTheme.Navigation.enable(true);
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+
|
|
|
+</body>
|
|
|
+</html>
|