I'm attempting some wavelet analysis on images, and I need some method for multiscale decomposition. I'm experimenting with the PyWavelets package. However, the dwt2
and idwt2
methods only provide a single scale. I could iterate these methods, and apply single scale decomposition to smaller areas of the image; if the result of dwt2
consists of 4 arrays:
---------
| A | B |
---------
| C | D |
---------
then I could apply dwt2
to the subarray A
and so on. However, there's a difficulty here in that many wavelets produce arrays bigger than the inputs. Note that on the PyWavelets example page the wavelet used is db1
. But if we try db2
:
>>> import pywt
>>> x = [3, 7, 1, 1, -2, 5, 4, 6]
>>> db2 = pywt.Wavelet('db2')
>>> X = pywt.wavedec(x, db2)
>>> print X[0]
[ 5.65685425 7.39923721 0.22414387 3.33677403 7.77817459]
>>> print X[1][0]
-2.44948974278
>>> print X[1][1]
-1.60368225335
>>> print X[1][2]
-4.44140056379
So I don't seem to be able to perform multilevel decompositions except with db1
(which is the Haar wavelet).
I know there are various wavelet implementations in other packages, but I don't know if any of them provide robust multiscale decomposition of multidimensional data. What's my best option here?