问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

matlab 没有wavefast函数,怎么回事,我是2012a

发布网友 发布时间:2023-07-16 16:48

我来回答

1个回答

热心网友 时间:2024-01-21 04:48

function [c, s] = wavefast(x, n, varargin)
%WAVEFAST Perform multi-level 2-dimensional fast wavelet transform.
% [C, L] = WAVEFAST(X, N, LP, HP) performs a 2D N-level FWT of
% image (or matrix) X with respect to decomposition filters LP and
% HP.
%
% [C, L] = WAVEFAST(X, N, WNAME) performs the same operation but
% fetches filters LP and HP for wavelet WNAME using WAVEFILTER.
%
% Scale parameter N must be less than or equal to log2 of the
% maximum image dimension. Filters LP and HP must be even. To
% rece border distortion, X is symmetrically extended. That is,
% if X = [c1 c2 c3 ... cn] (in 1D), then its symmetric extension
% would be [... c3 c2 c1 c1 c2 c3 ... cn cn cn-1 cn-2 ...].
%
% OUTPUTS:
% Matrix C is a coefficient decomposition vector:
%
% C = [ a(n) h(n) v(n) d(n) h(n-1) ... v(1) d(1) ]
%
% where a, h, v, and d are columnwise vectors containing
% approximation, horizontal, vertical, and diagonal coefficient
% matrices, respectively. C has 3n + 1 sections where n is the
% number of wavelet decompositions.
%
% Matrix S is an (n+2) x 2 bookkeeping matrix:
%
% S = [ sa(n, :); sd(n, :); sd(n-1, :); ... ; sd(1, :); sx ]
%
% where sa and sd are approximation and detail size entries.
%
% See also WAVEBACK and WAVEFILTER.

% Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
% Digital Image Processing Using MATLAB, Prentice-Hall, 2004
% $Revision: 1.5 $ $Date: 2003/10/13 01:14:17 $

% Check the input arguments for reasonableness.
error(nargchk(3, 4, nargin));

if nargin == 3
if ischar(varargin{1})
[lp, hp] = wavefilter(varargin{1}, 'd');
else
error('Missing wavelet name.');
end
else
lp = varargin{1}; hp = varargin{2};
end

fl = length(lp); sx = size(x);

if (ndims(x) ~= 2) | (min(sx) < 2) | ~isreal(x) | ~isnumeric(x)
error('X must be a real, numeric matrix.');
end

if (ndims(lp) ~= 2) | ~isreal(lp) | ~isnumeric(lp) ...
| (ndims(hp) ~= 2) | ~isreal(hp) | ~isnumeric(hp) ...
| (fl ~= length(hp)) | rem(fl, 2) ~= 0
error(['LP and HP must be even and equal length real, ' ...
'numeric filter vectors.']);
end

if ~isreal(n) | ~isnumeric(n) | (n < 1) | (n > log2(max(sx)))
error(['N must be a real scalar between 1 and ' ...
'log2(max(size((X))).']);
end

% Init the starting output data structures and initial approximation.
c = []; s = sx; app = double(x);

% For each decomposition ...
for i = 1:n
% Extend the approximation symmetrically.
[app, keep] = symextend(app, fl);

% Convolve rows with HP and downsample. Then convolve columns
% with HP and LP to get the diagonal and vertical coefficients.
rows = symconv(app, hp, 'row', fl, keep);
coefs = symconv(rows, hp, 'col', fl, keep);
c = [coefs(:)' c]; s = [size(coefs); s];
coefs = symconv(rows, lp, 'col', fl, keep);
c = [coefs(:)' c];

% Convolve rows with LP and downsample. Then convolve columns
% with HP and LP to get the horizontal and next approximation
% coeffcients.
rows = symconv(app, lp, 'row', fl, keep);
coefs = symconv(rows, hp, 'col', fl, keep);
c = [coefs(:)' c];
app = symconv(rows, lp, 'col', fl, keep);
end

% Append final approximation structures.
c = [app(:)' c]; s = [size(app); s];

%-------------------------------------------------------------------%
function [y, keep] = symextend(x, fl)
% Compute the number of coefficients to keep after convolution
% and downsampling. Then extend x in both dimensions.

keep = floor((fl + size(x) - 1) / 2);
y = padarray(x, [(fl - 1) (fl - 1)], 'symmetric', 'both');

%-------------------------------------------------------------------%
function y = symconv(x, h, type, fl, keep)
% Convolve the rows or columns of x with h, downsample,
% and extract the center section since symmetrically extended.

if strcmp(type, 'row')
y = conv2(x, h);
y = y(:, 1:2:end);
y = y(:, fl / 2 + 1:fl / 2 + keep(2));
else
y = conv2(x, h');
y = y(1:2:end, :);
y = y(fl / 2 + 1:fl / 2 + keep(1), :);
end
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
中美有什么经济冲突 杨凌衡水实验中学高中学费是多少 蒂芙尼珍珠项链怎么清洗和保养? tiffany&amp;co 的缺点 如何保养蒂芙尼的项链? tiffany保养要多久时间 Tiffany珠宝需要多长时间保养? 人为什么活着,怎样活着都是无憾!! 孩子犟的不行家长怎么教育 有什么比较好用的游戏视频录制软件? 适用于Windows的10个好用的游戏录制软件 养生12法口令动作 瑜伽初学者注意事项 瑜伽初学者必须知道的六误区、六口令、五体式 ...长得比柚子小,冬天成熟!味道酸甜带点苦味.小时候得了咳嗽,大人会用... 健康节能模式有什么好处呢? 山东省布谷鸟信息技术有限公司怎么样? 空调为什么要设置健康模式呢? ...在少林寺苦练功夫。主人功用的是龙拳 其次是鹤拳和虎拳 ...晓得叫什么名字里面的有3个主角他们的绝招是鹤拳虎拳龙拳,谁能告诉... 【百里杜鹃酒店价格】一个人说走就走三亚之旅 如何更改关机画面? 电脑屏幕在选择用户的时候(注销界面),出现一块明显的白色块区域,如图1... 栆油桃果面有很多小疙瘩是什么原因 电脑关机画面更改了,卸载了NETWARE还是无法更改,求救 阎鹤祥的介绍 怎样使注销计算机后的开机界面恢复正常 怎么换另一种注销界面? 钱与权哪个更重要? ...in the south of China. A.grows B.is grown c.was grown_百度... Tea grows in China 和Tea is grown in China ...bananas ___ in Hainan? A. grows B. is grown C. grew D. are gr... 商品房文件勘察有哪个机关部门管理 办理建筑工程施工许可证时的地质勘察报告是哪个部门出具? 低压70高压130是属于什么情况 高压130低压70怎么回事? 我喝的是汇源低糖的苹果醋,什么牌子的苹果醋最好呀? 在word中输入带箭头的向上和向下的符号是怎么做到? 异地恋女朋友上班累体贴的话 26000海关额度是实际支付吗 写出下列变化的化学方程式.(1)由丙烯为原料合成聚丙烯:___(2)葡... 建设工程扬尘治理的费用合同? 施工现场环保及扬尘防治专项工作? 上大学对你来说,最重要的收获是什么? 我家睡莲为什么开二天就不开了? ...每年可获利10元,如折现率为8%,则其估价应是多少? 以理化情什么意思 梦见男友摩托车车头着火了 宝骏510改黑色好看吗 法治日报评选新闻及人物有什么好处 你能给二十岁的女生哪些人生建议? 机票可以补买退票险吗