python中如何获得小波变换的低频图像

2025-11-21 19:04:01

1、读取灰度图:

import cv2

from pywt import dwt2, idwt2

img = cv2.imread('0.png',0)

m,n=img.shape

图像是512*512 dps的。

python中如何获得小波变换的低频图像

2、对img进行haar小波变换:

p,(q,r,s)=dwt2(img,'haar')

显示小波变换之后,p对应的图像:

import numpy as np

cv2.imwrite('02.png',np.uint8(p))

python中如何获得小波变换的低频图像

3、q对应的图像:

python中如何获得小波变换的低频图像

4、r对应的图像:

python中如何获得小波变换的低频图像

5、s对应的图像:

python中如何获得小波变换的低频图像

6、换个例子:

python中如何获得小波变换的低频图像

python中如何获得小波变换的低频图像

7、上面的灰度图,经过haar小波变换之后的低频信息是p:

python中如何获得小波变换的低频图像

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢