✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
????个人主页:Matlab科研工作室
????个人信条:格物致知。
更多Matlab仿真内容点击????
⛄ 内容介绍
小波变换克服了傅利叶变换在单分辨率上的缺陷,具有多分辨率分析的特点,在时域和频域都有表征信号局部信息的能力,从而使得小波理论在图像处理等领域得到广泛的应用.本文基于Matlab数学分析工具环境下从实验角度出发,探讨了小波变换在图像压缩中的应用和小波基的选取.并采用蚁群算法优化小波变换实现图像压缩。
⛄ 部分代码
function [W,resol,qmf] = func_DWT_2D(X,scale,wbase,mom)
% Forward 2D-wavelet transform
% [W,resolution,qmf] = WaveletTransform2D(X,scale,wbase,mom)
% 2D-wavelet transform: returns in W[n,T] the 2D-wavelet transform
% of X[n,T] along the second dimension (i.e each row represents an image).
%
% INPUTS
% ------
% X : [n by T] matrix of images
% wbase : wavelet basis ('Haar', 'Symmlet', 'Daubechies', ...)
% scale : scale parameter (ineteger)
% mom : number of vanishing moments
%
% DEFAULT: wbase = 'Symmlet', mom = 4, scale = 0.
%
% OUTPUTS
% -------
% W : [n by T] matrix of 2D-wavelet coefficients
% resolution : resolution level,
% qmf : quadratic mirror filters.
%
% see also: IWaveletTransform2D, MakeONFilter, FWT2_PO
%
qmf = func_MakeONFilter(wbase,mom);
resol = log2(size(X,2)) - scale;
Image = func_FWT2_PO(X, scale, qmf);
W(i,:) = Image(:)';
% [m,T] = size(X);
% W = zeros(m,T);
% I = sqrt(T);
% Image = zeros(I,I);
%
% %%% INPUT CHECK
% if nargin <= 3
% mom = '';
% if nargin <= 2
% wbase = 'Symmlet';
% mom = 4;
% if nargin <= 1
% scale = 0;
% end
% end
% end
%
% if isempty(mom)
% qmf = func_MakeONFilter(wbase);
% else
% qmf = func_MakeONFilter(wbase,mom);
% end
% %%% INPUT CHECK
%
% resolution = log2(I) - scale;
%
% for i = 1:m
% Image = reshape(X(i,:),I,I);
% Image = func_FWT2_PO(Image,scale,qmf);
% W(i,:) = Image(:)';
% end
⛄ 运行结果
⛄ 参考文献
[1]易美华, 朱自强, 黄国祥,等. 小波变换在遥感图像压缩中的应用及Matlab实现[J]. 物探化探计算技术, 2003, 25(3):3.