问题
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
回答1:
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
来源:https://stackoverflow.com/questions/34057765/2d-wavelet-filtering-in-python-on-an-image