Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]

Type "copyright", "credits" or "license" for more information.


IPython 0.12.dev -- An enhanced Interactive Python.

? -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help -> Python's own help system.

object? -> Details about 'object', use 'object??' for extra details.

%guiref -> A brief reference about the graphical user interface.


In [1]: import Image


In [2]: import wavepy as wv


In [3]: x=np.asarray(Image.open("lena512.bmp").convert("L"))


In [4]: imshow(x,cmap=cm.gray)

Out[4]: <matplotlib.image.AxesImage at 0x270da70>


In [5]: J=2


In [6]: nm='bior3.3'


In [7]: [swtop,length]=wv.dwt.swt2(x,J,nm)


In [8]: row=length[0]


In [9]: col=length[1]


In [10]: blur=swtop[0:row*col]


In [11]: blur=reshape(blur,[row,col])


In [12]: blur[blur<0.0]=0.0


In [13]: blur=blur*255.0/blur.max()


In [14]: blur[blur>255.0]=255.0


In [15]: imshow(blur,cmap=cm.gray)

Out[15]: <matplotlib.image.AxesImage at 0x29adef0>


In [16]: detail=swtop[row*col:]


In [17]: detail=reshape(detail,[row*J*3,col])


In [18]: detail[detail<0.0]=0.0


In [19]: imshow(detail,cmap=cm.gray)

Out[19]: <matplotlib.image.AxesImage at 0x2a4f090>


In [20]: imshow(detail[0:row,:],cmap=cm.gray)

Out[20]: <matplotlib.image.AxesImage at 0x2b505d0>


In [21]: imshow(detail[row:2*row,:],cmap=cm.gray)

Out[21]: <matplotlib.image.AxesImage at 0x2caf730>


In [22]: imshow(detail[2*row:3*row,:],cmap=cm.gray)

Out[22]: <matplotlib.image.AxesImage at 0x2d8a890>


In [23]: imshow(detail[3*row:4*row,:],cmap=cm.gray)

Out[23]: <matplotlib.image.AxesImage at 0x2e939b0>


In [24]: imshow(detail[4*row:5*row,:],cmap=cm.gray)

Out[24]: <matplotlib.image.AxesImage at 0x3098ad0>


In [25]: imshow(detail[5*row:6*row,:],cmap=cm.gray)

Out[25]: <matplotlib.image.AxesImage at 0x3169bf0>


In [26]: