File: 2d-dwt-and-idwt.rst

package info (click to toggle)
pywavelets 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,680 kB
  • sloc: python: 8,849; ansic: 5,134; makefile: 93
file content (80 lines) | stat: -rw-r--r-- 2,139 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.. _ref-dwt2:

.. currentmodule:: pywt

=================================================
2D Forward and Inverse Discrete Wavelet Transform
=================================================


Single level ``dwt2``
~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: dwt2

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:

  ::

                                -------------------
                                |        |        |
                                | cA(LL) | cH(LH) |
                                |        |        |
    (cA, (cH, cV, cD))  <--->   -------------------
                                |        |        |
                                | cV(HL) | cD(HH) |
                                |        |        |
                                -------------------

PyWavelets does not follow this pattern because of pure practical reasons of simple
access to particular type of the output coefficients.


Single level ``idwt2``
~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: idwt2

2D multilevel decomposition using ``wavedec2``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: wavedec2

2D multilevel reconstruction using ``waverec2``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: waverec2


2D coordinate conventions
~~~~~~~~~~~~~~~~~~~~~~~~~

The labels for "horizontal" and "vertical" used by ``dwt2`` and ``idwt2``
follow the common mathematical convention that coordinate axis 0
is horizontal while axis 1 is vertical::

    dwt2, idwt2 convention
    ----------------------

    axis 1 ^
           |
           |
           |
           |--------->
                   axis 0

Note that this is different from another common convention used in computer
graphics and image processing (e.g. by matplotlib's ``imshow`` and functions in
``scikit-image``).  In those packages axis 0 is a vertical axis and axis 1 is
horizontal as follows::

     imshow convention
    -------------------
                 axis 1
           |--------->
           |
           |
           |
    axis 0 v