Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 6debd223f76e3f43fd43d56c2a8ea18f > files > 139

python3-pywavelets-doc-1.0.1-2.mga7.noarch.rpm




<!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="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>2D Forward and Inverse Discrete Wavelet Transform &#8212; PyWavelets Documentation</title>
    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <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 async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within PyWavelets Documentation"
          href="../_static/opensearch.xml"/>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="nD Forward and Inverse Discrete Wavelet Transform" href="nd-dwt-and-idwt.html" />
    <link rel="prev" title="Overview of multilevel wavelet decompositions" href="2d-decompositions-overview.html" />
 
<meta name="description" content="PyWavelets is a scientific Python module for Wavelet Transform calculations."/>
<meta name="keywords" content="PyWavelets, wavelets, Python, wavelet transform, discrete wavelet transform, dwt, idwt, swt, wavelet packets, stationary wavelet transform, pywt"/>
<meta name="author" content="Filip Wasilewski"/>
<meta name="Distribution" content="Global"/>
<meta name="Robots" content="INDEX,FOLLOW"/>

<script type="text/javascript">
    (function ($) {
        $(document).ready(function () {
            $("#toggle-edit-info").click(function (e) {
                e.preventDefault();
                $("#edit-info").toggle();
            });
        });
    })(jQuery);
</script>
<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-3396395-3']);
    _gaq.push(['_trackPageview']);
    (function () {
        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
    })();
</script>

  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="nd-dwt-and-idwt.html" title="nD Forward and Inverse Discrete Wavelet Transform"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="2d-decompositions-overview.html" title="Overview of multilevel wavelet decompositions"
             accesskey="P">previous</a> |</li>
    <li><a href="../index.html">Home &#187;</a></li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">API Reference</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="d-forward-and-inverse-discrete-wavelet-transform">
<span id="ref-dwt2"></span><h1>2D Forward and Inverse Discrete Wavelet Transform<a class="headerlink" href="#d-forward-and-inverse-discrete-wavelet-transform" title="Permalink to this headline">¶</a></h1>
<div class="section" id="single-level-dwt2">
<h2>Single level <code class="docutils literal notranslate"><span class="pre">dwt2</span></code><a class="headerlink" href="#single-level-dwt2" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pywt.dwt2">
<code class="descclassname">pywt.</code><code class="descname">dwt2</code><span class="sig-paren">(</span><em>data</em>, <em>wavelet</em>, <em>mode='symmetric'</em>, <em>axes=(-2</em>, <em>-1)</em><span class="sig-paren">)</span><a class="headerlink" href="#pywt.dwt2" title="Permalink to this definition">¶</a></dt>
<dd><p>2D Discrete Wavelet Transform.</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"><dl class="first docutils">
<dt><strong>data</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array_like</span></dt>
<dd><p class="first last">2D array with input data</p>
</dd>
<dt><strong>wavelet</strong> <span class="classifier-delimiter">:</span> <span class="classifier">Wavelet object or name string, or 2-tuple of wavelets</span></dt>
<dd><p class="first last">Wavelet to use.  This can also be a tuple containing a wavelet to
apply along each axis in <code class="docutils literal notranslate"><span class="pre">axes</span></code>.</p>
</dd>
<dt><strong>mode</strong> <span class="classifier-delimiter">:</span> <span class="classifier">str or 2-tuple of strings, optional</span></dt>
<dd><p class="first last">Signal extension mode, see Modes (default: ‘symmetric’).  This can
also be a tuple of modes specifying the mode to use on each axis in
<code class="docutils literal notranslate"><span class="pre">axes</span></code>.</p>
</dd>
<dt><strong>axes</strong> <span class="classifier-delimiter">:</span> <span class="classifier">2-tuple of ints, optional</span></dt>
<dd><p class="first last">Axes over which to compute the DWT. Repeated elements mean the DWT will
be performed multiple times along these axes.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>(cA, (cH, cV, cD))</strong> <span class="classifier-delimiter">:</span> <span class="classifier">tuple</span></dt>
<dd><p class="first last">Approximation, horizontal detail, vertical detail and diagonal
detail coefficients respectively.  Horizontal refers to array axis 0
(or <code class="docutils literal notranslate"><span class="pre">axes[0]</span></code> for user-specified <code class="docutils literal notranslate"><span class="pre">axes</span></code>).</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pywt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ones</span><span class="p">((</span><span class="mi">4</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coeffs</span> <span class="o">=</span> <span class="n">pywt</span><span class="o">.</span><span class="n">dwt2</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s1">&#39;haar&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cA</span><span class="p">,</span> <span class="p">(</span><span class="n">cH</span><span class="p">,</span> <span class="n">cV</span><span class="p">,</span> <span class="n">cD</span><span class="p">)</span> <span class="o">=</span> <span class="n">coeffs</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cA</span>
<span class="go">array([[ 2.,  2.],</span>
<span class="go">       [ 2.,  2.]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cV</span>
<span class="go">array([[ 0.,  0.],</span>
<span class="go">       [ 0.,  0.]])</span>
</pre></div>
</div>
</dd></dl>

<p>The relation to the other common data layout where all the approximation and
details coefficients are stored in one big 2D array is as follows:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                            <span class="o">-------------------</span>
                            <span class="o">|</span>        <span class="o">|</span>        <span class="o">|</span>
                            <span class="o">|</span> <span class="n">cA</span><span class="p">(</span><span class="n">LL</span><span class="p">)</span> <span class="o">|</span> <span class="n">cH</span><span class="p">(</span><span class="n">LH</span><span class="p">)</span> <span class="o">|</span>
                            <span class="o">|</span>        <span class="o">|</span>        <span class="o">|</span>
<span class="p">(</span><span class="n">cA</span><span class="p">,</span> <span class="p">(</span><span class="n">cH</span><span class="p">,</span> <span class="n">cV</span><span class="p">,</span> <span class="n">cD</span><span class="p">))</span>  <span class="o">&lt;---&gt;</span>   <span class="o">-------------------</span>
                            <span class="o">|</span>        <span class="o">|</span>        <span class="o">|</span>
                            <span class="o">|</span> <span class="n">cV</span><span class="p">(</span><span class="n">HL</span><span class="p">)</span> <span class="o">|</span> <span class="n">cD</span><span class="p">(</span><span class="n">HH</span><span class="p">)</span> <span class="o">|</span>
                            <span class="o">|</span>        <span class="o">|</span>        <span class="o">|</span>
                            <span class="o">-------------------</span>
</pre></div>
</div>
</div></blockquote>
<p>PyWavelets does not follow this pattern because of pure practical reasons of simple
access to particular type of the output coefficients.</p>
</div>
<div class="section" id="single-level-idwt2">
<h2>Single level <code class="docutils literal notranslate"><span class="pre">idwt2</span></code><a class="headerlink" href="#single-level-idwt2" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pywt.idwt2">
<code class="descclassname">pywt.</code><code class="descname">idwt2</code><span class="sig-paren">(</span><em>coeffs</em>, <em>wavelet</em>, <em>mode='symmetric'</em>, <em>axes=(-2</em>, <em>-1)</em><span class="sig-paren">)</span><a class="headerlink" href="#pywt.idwt2" title="Permalink to this definition">¶</a></dt>
<dd><p>2-D Inverse Discrete Wavelet Transform.</p>
<p>Reconstructs data from coefficient arrays.</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"><dl class="first last docutils">
<dt><strong>coeffs</strong> <span class="classifier-delimiter">:</span> <span class="classifier">tuple</span></dt>
<dd><p class="first last">(cA, (cH, cV, cD)) A tuple with approximation coefficients and three
details coefficients 2D arrays like from <cite>dwt2</cite>.  If any of these
components are set to <code class="docutils literal notranslate"><span class="pre">None</span></code>, it will be treated as zeros.</p>
</dd>
<dt><strong>wavelet</strong> <span class="classifier-delimiter">:</span> <span class="classifier">Wavelet object or name string, or 2-tuple of wavelets</span></dt>
<dd><p class="first last">Wavelet to use.  This can also be a tuple containing a wavelet to
apply along each axis in <code class="docutils literal notranslate"><span class="pre">axes</span></code>.</p>
</dd>
<dt><strong>mode</strong> <span class="classifier-delimiter">:</span> <span class="classifier">str or 2-tuple of strings, optional</span></dt>
<dd><p class="first last">Signal extension mode, see Modes (default: ‘symmetric’).  This can
also be a tuple of modes specifying the mode to use on each axis in
<code class="docutils literal notranslate"><span class="pre">axes</span></code>.</p>
</dd>
<dt><strong>axes</strong> <span class="classifier-delimiter">:</span> <span class="classifier">2-tuple of ints, optional</span></dt>
<dd><p class="first last">Axes over which to compute the IDWT. Repeated elements mean the IDWT
will be performed multiple times along these axes.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pywt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coeffs</span> <span class="o">=</span> <span class="n">pywt</span><span class="o">.</span><span class="n">dwt2</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s1">&#39;haar&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pywt</span><span class="o">.</span><span class="n">idwt2</span><span class="p">(</span><span class="n">coeffs</span><span class="p">,</span> <span class="s1">&#39;haar&#39;</span><span class="p">)</span>
<span class="go">array([[ 1.,  2.],</span>
<span class="go">       [ 3.,  4.]])</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="d-multilevel-decomposition-using-wavedec2">
<h2>2D multilevel decomposition using <code class="docutils literal notranslate"><span class="pre">wavedec2</span></code><a class="headerlink" href="#d-multilevel-decomposition-using-wavedec2" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pywt.wavedec2">
<code class="descclassname">pywt.</code><code class="descname">wavedec2</code><span class="sig-paren">(</span><em>data</em>, <em>wavelet</em>, <em>mode='symmetric'</em>, <em>level=None</em>, <em>axes=(-2</em>, <em>-1)</em><span class="sig-paren">)</span><a class="headerlink" href="#pywt.wavedec2" title="Permalink to this definition">¶</a></dt>
<dd><p>Multilevel 2D Discrete Wavelet Transform.</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"><dl class="first docutils">
<dt><strong>data</strong> <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">2D input data</p>
</dd>
<dt><strong>wavelet</strong> <span class="classifier-delimiter">:</span> <span class="classifier">Wavelet object or name string, or 2-tuple of wavelets</span></dt>
<dd><p class="first last">Wavelet to use.  This can also be a tuple containing a wavelet to
apply along each axis in <cite>axes</cite>.</p>
</dd>
<dt><strong>mode</strong> <span class="classifier-delimiter">:</span> <span class="classifier">str or 2-tuple of str, optional</span></dt>
<dd><p class="first last">Signal extension mode, see <cite>Modes</cite> (default: ‘symmetric’).  This can
also be a tuple containing a mode to apply along each axis in <cite>axes</cite>.</p>
</dd>
<dt><strong>level</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int, optional</span></dt>
<dd><p class="first last">Decomposition level (must be &gt;= 0). If level is None (default) then it
will be calculated using the <cite>dwt_max_level</cite> function.</p>
</dd>
<dt><strong>axes</strong> <span class="classifier-delimiter">:</span> <span class="classifier">2-tuple of ints, optional</span></dt>
<dd><p class="first last">Axes over which to compute the DWT. Repeated elements are not allowed.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>[cAn, (cHn, cVn, cDn), … (cH1, cV1, cD1)]</strong> <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd><p class="first last">Coefficients list.  For user-specified <cite>axes</cite>, <cite>cH*</cite>
corresponds to <code class="docutils literal notranslate"><span class="pre">axes[0]</span></code> while <cite>cV*</cite> corresponds to <code class="docutils literal notranslate"><span class="pre">axes[1]</span></code>.
The first element returned is the approximation coefficients for the
nth level of decomposition.  Remaining elements are tuples of detail
coefficients in descending order of decomposition level.
(i.e. <cite>cH1</cite> are the horizontal detail coefficients at the first level)</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pywt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coeffs</span> <span class="o">=</span> <span class="n">pywt</span><span class="o">.</span><span class="n">wavedec2</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">ones</span><span class="p">((</span><span class="mi">4</span><span class="p">,</span><span class="mi">4</span><span class="p">)),</span> <span class="s1">&#39;db1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Levels:</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">coeffs</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pywt</span><span class="o">.</span><span class="n">waverec2</span><span class="p">(</span><span class="n">coeffs</span><span class="p">,</span> <span class="s1">&#39;db1&#39;</span><span class="p">)</span>
<span class="go">array([[ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.]])</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="d-multilevel-reconstruction-using-waverec2">
<h2>2D multilevel reconstruction using <code class="docutils literal notranslate"><span class="pre">waverec2</span></code><a class="headerlink" href="#d-multilevel-reconstruction-using-waverec2" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pywt.waverec2">
<code class="descclassname">pywt.</code><code class="descname">waverec2</code><span class="sig-paren">(</span><em>coeffs</em>, <em>wavelet</em>, <em>mode='symmetric'</em>, <em>axes=(-2</em>, <em>-1)</em><span class="sig-paren">)</span><a class="headerlink" href="#pywt.waverec2" title="Permalink to this definition">¶</a></dt>
<dd><p>Multilevel 2D Inverse Discrete Wavelet Transform.</p>
<dl class="docutils">
<dt>coeffs <span class="classifier-delimiter">:</span> <span class="classifier">list or tuple</span></dt>
<dd>Coefficients list [cAn, (cHn, cVn, cDn), … (cH1, cV1, cD1)]</dd>
<dt>wavelet <span class="classifier-delimiter">:</span> <span class="classifier">Wavelet object or name string, or 2-tuple of wavelets</span></dt>
<dd>Wavelet to use.  This can also be a tuple containing a wavelet to
apply along each axis in <cite>axes</cite>.</dd>
<dt>mode <span class="classifier-delimiter">:</span> <span class="classifier">str or 2-tuple of str, optional</span></dt>
<dd>Signal extension mode, see <cite>Modes</cite> (default: ‘symmetric’).  This can
also be a tuple containing a mode to apply along each axis in <cite>axes</cite>.</dd>
<dt>axes <span class="classifier-delimiter">:</span> <span class="classifier">2-tuple of ints, optional</span></dt>
<dd>Axes over which to compute the IDWT. Repeated elements are not allowed.</dd>
</dl>
<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">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>2D array of reconstructed data.</strong></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>It may sometimes be desired to run <cite>waverec2</cite> with some sets of
coefficients omitted.  This can best be done by setting the corresponding
arrays to zero arrays of matching shape and dtype.  Explicitly removing
list or tuple entries or setting them to None is not supported.</p>
<p>Specifically, to ignore all detail coefficients at level 2, one could do:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">coeffs</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span> <span class="o">==</span> <span class="nb">tuple</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">zeros_like</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">coeffs</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]])</span>
</pre></div>
</div>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pywt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coeffs</span> <span class="o">=</span> <span class="n">pywt</span><span class="o">.</span><span class="n">wavedec2</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">ones</span><span class="p">((</span><span class="mi">4</span><span class="p">,</span><span class="mi">4</span><span class="p">)),</span> <span class="s1">&#39;db1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Levels:</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">coeffs</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pywt</span><span class="o">.</span><span class="n">waverec2</span><span class="p">(</span><span class="n">coeffs</span><span class="p">,</span> <span class="s1">&#39;db1&#39;</span><span class="p">)</span>
<span class="go">array([[ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.],</span>
<span class="go">       [ 1.,  1.,  1.,  1.]])</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="d-coordinate-conventions">
<h2>2D coordinate conventions<a class="headerlink" href="#d-coordinate-conventions" title="Permalink to this headline">¶</a></h2>
<p>The labels for “horizontal” and “vertical” used by <code class="docutils literal notranslate"><span class="pre">dwt2</span></code> and <code class="docutils literal notranslate"><span class="pre">idwt2</span></code>
follow the common mathematical convention that coordinate axis 0
is horizontal while axis 1 is vertical:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dwt2</span><span class="p">,</span> <span class="n">idwt2</span> <span class="n">convention</span>
<span class="o">----------------------</span>

<span class="n">axis</span> <span class="mi">1</span> <span class="o">^</span>
       <span class="o">|</span>
       <span class="o">|</span>
       <span class="o">|</span>
       <span class="o">|---------&gt;</span>
               <span class="n">axis</span> <span class="mi">0</span>
</pre></div>
</div>
<p>Note that this is different from another common convention used in computer
graphics and image processing (e.g. by matplotlib’s <code class="docutils literal notranslate"><span class="pre">imshow</span></code> and functions in
<code class="docutils literal notranslate"><span class="pre">scikit-image</span></code>).  In those packages axis 0 is a vertical axis and axis 1 is
horizontal as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">imshow</span> <span class="n">convention</span>
<span class="o">-------------------</span>
             <span class="n">axis</span> <span class="mi">1</span>
       <span class="o">|---------&gt;</span>
       <span class="o">|</span>
       <span class="o">|</span>
       <span class="o">|</span>
<span class="n">axis</span> <span class="mi">0</span> <span class="n">v</span>
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">2D Forward and Inverse Discrete Wavelet Transform</a><ul>
<li><a class="reference internal" href="#single-level-dwt2">Single level <code class="docutils literal notranslate"><span class="pre">dwt2</span></code></a></li>
<li><a class="reference internal" href="#single-level-idwt2">Single level <code class="docutils literal notranslate"><span class="pre">idwt2</span></code></a></li>
<li><a class="reference internal" href="#d-multilevel-decomposition-using-wavedec2">2D multilevel decomposition using <code class="docutils literal notranslate"><span class="pre">wavedec2</span></code></a></li>
<li><a class="reference internal" href="#d-multilevel-reconstruction-using-waverec2">2D multilevel reconstruction using <code class="docutils literal notranslate"><span class="pre">waverec2</span></code></a></li>
<li><a class="reference internal" href="#d-coordinate-conventions">2D coordinate conventions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="2d-decompositions-overview.html"
                        title="previous chapter">Overview of multilevel wavelet decompositions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="nd-dwt-and-idwt.html"
                        title="next chapter">nD Forward and Inverse Discrete Wavelet Transform</a></p><div>
<h3>Quick links</h3>
<ul>
<li><a href="https://github.com/PyWavelets/pywt"><img src="../_static/github.png" height="16" width="16" alt="" /> Fork on Github</a></li>
<li><a href="http://groups.google.com/group/pywavelets"><img src="../_static/comments.png" height="16" width="16" alt="" /> Discussion Group</a></li>
<li><a href="http://wavelets.pybytes.com/"><img src="../_static/wave.png" height="16" width="16" alt="" /> Explore Wavelets</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>


<div id="edit-instructions">
    <h3>Edit this document</h3>
    <p>
        <a href="#" id="toggle-edit-info">
        <img src="../_static/page_edit.png" height="16" width="16" alt="" />
        The source code of this file is hosted on GitHub. Everyone can
        update and fix errors in this document with few clicks -
        no downloads needed.
        </a>
    </p>
    <ol id="edit-info" style="display: none;">
        <li>
            Go to
            <i><a href="https://github.com/PyWavelets/pywt/blob/master/doc/source/ref/2d-dwt-and-idwt.rst" target="_blank">
                2D Forward and Inverse Discrete Wavelet Transform
            </a></i> on GitHub.
        </li>
        <li>
            Press <b>Edit this file</b> button.
        </li>
        <li>
            Edit file contents using GitHub's text editor in your web browser
        </li>
        <li>
            Fill in the <b>Commit message</b> text box at the end of the page
            telling <i>why</i> you did the changes.
            Press <b>Propose file change</b> button next to it when done.
        </li>
        <li>
            On <i>Send a pull request</i> page you don't need to fill in text
            anymore. Just press <b>Send pull request</b> button.
        </li>
        <li>
            Your changes are now queued for review under project's
            <a href="https://github.com/PyWavelets/pywt/pulls" target="_blank">Pull requests</a> tab
            on Github.
        </li>
    </ol>
</div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="nd-dwt-and-idwt.html" title="nD Forward and Inverse Discrete Wavelet Transform"
             >next</a> |</li>
        <li class="right" >
          <a href="2d-decompositions-overview.html" title="Overview of multilevel wavelet decompositions"
             >previous</a> |</li>
    <li><a href="../index.html">Home &#187;</a></li>
          <li class="nav-item nav-item-1"><a href="index.html" >API Reference</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2006-2019, The PyWavelets Developers.
      Last updated on Jan 12, 2019.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.3.
    </div>
  </body>
</html>