简体   繁体   中英

2D wavelet filtering in python on an image

I'm trying to do 2d wavelet filtering in python. I found out about PyWavelets and I have been messing around with it for awhile. I am trying to do the transformation for 4 levels. When I print it out it gives werid output and I'm not sure exactly what is going on. I've tried a few things but this is the latest as an example:

test = pywt.dwt2(picture,'db1')

Any help on preforming 2d wavelets on images with PyWavelets or just in general would be much appreciated. Thank you.

Edit: The type of wavelet transformation doesn't matter

Can you explain what exactly is the weird output? you should get output vector with cA,cL,cH and cD coefficients. If you want to view the transform domain image, arrange the coefficients like below: cA, (cH, cV, cD)

length of output vector = rows x columns of the input image (provided you have a square image)

If you want to view a lower resolution image, arrange the first 1/4th elements (cA) in the output vector in square format. Currently, they will be like [Row 1, Row2, Row3...] Also, are you giving level parameter (optional) in pywt.dwt2 command?

Refer this http://www.pybytes.com/pywavelets/ref/2d-dwt-and-idwt.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM