标签:
Matlab 小波变换
lean图像的行列应该满足2的幂次方
img = imread(‘lena.jpg‘); img =rgb2gray(img); img = double(img); [ca1 ch1,cv1,cd1] = dwt2(img,‘haar‘); figure; imshow([uint8(ca1),uint8(ch1);uint8(cv1),uint8(cd1)]); title(‘first wavelet decomposition‘); [ca2 ch2,cv2,cd2] = dwt2(ca1,‘haar‘); figure; imshow([uint8(ca2),uint8(ch2);uint8(cv2),uint8(cd2)]); title(‘second wavelet decomposition‘); % restruct img img_ca1 = idwt2(ca2,ch2,cv2,cd2,‘haar‘); img_re = idwt2(img_ca1,ch1,cv1,cd1,‘haar‘); figure; imshow( uint8(img_re)); title(‘wavelet restruct‘);
参考:
http://media.cs.tsinghua.edu.cn/~ahz/digitalimageprocess/chapter12/chapt12_ahz.htm
标签:
原文地址:http://www.cnblogs.com/adong7639/p/4635106.html