简体   繁体   English

图像上python中的2D小波滤波

[英]2D wavelet filtering in python on an image

I'm trying to do 2d wavelet filtering in python.我正在尝试在 python 中进行二维小波滤波。 I found out about PyWavelets and I have been messing around with it for awhile.我发现了 PyWavelets 并且我一直在搞弄它一段时间。 I am trying to do the transformation for 4 levels.我正在尝试进行 4 个级别的转换。 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.任何有关使用 PyWavelets 或一般情况下在图像上执行 2d 小波的帮助将不胜感激。 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.你应该得到带有 cA、cL、cH 和 cD 系数的输出向量。 If you want to view the transform domain image, arrange the coefficients like below: cA, (cH, cV, cD)如果要查看变换域图像,请按如下方式排列系数:cA, (cH, cV, cD)

length of output vector = rows x columns of the input image (provided you have a square image)输出向量的长度 = 输入图像的行 x 列(前提是您有一个方形图像)

If you want to view a lower resolution image, arrange the first 1/4th elements (cA) in the output vector in square format.如果要查看较低分辨率的图像,请以方形格式排列输出向量中的前 1/4 元素 (cA)。 Currently, they will be like [Row 1, Row2, Row3...] Also, are you giving level parameter (optional) in pywt.dwt2 command?目前,它们将类似于 [Row 1, Row2, Row3...] 另外,您是否在 pywt.dwt2 命令中提供级别参数(可选)?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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