📄 wavefeat_all.m
字号:
function [fm, fmm, fml, we] = wavefeat_all(dbname, dirname, ... nlevels, filt, edge)% WAVEFEAT_ALL Wavelet-based feature extraction from ALL images%% Input:% dbname: name of the test collection, e.g. 'VisTex'% dirname: directory that contains all images, e.g. '../VisTex/sub128'% nlevels: (optional) number of wavelet pyramid levels (default 3)% filt: (optional) string naming a standard filter % (see wfilters, default 'haar')% edge: (optional) specifies edge-handling % (see dwtmode, default 'per')%% Output: (one column per image) % fm: feature vectors based on mean and standard deviation% of the magnitute of the wavelet coefficients% fmm: feature vectors based on generalized Gaussian pdf parameters% (Moment Matching Estimation)% fml: feature vectors based on generalized Gaussian pdf parameters% (Maximum Likelihood Estimation)% we: entropy of wavelet subbands%% See also: WAVEFEAT% Suppose that dbname is a function that returns the names of texture classesname = eval(dbname);%执行ntexs = length(name);nsubs = 16;% Checking other inputs,使得'nlevels','filt','per'不是变量而是定义为指定的默认值if ~exist('nlevels', 'var') nlevels = 3;endif ~exist('filt', 'var') filt = 'haar';endif ~exist('edge', 'var') edge = 'per';end% Filters from name[LoF_D, HiF_D] = wfilters(filt, 'd');%小波分解harr过滤% Set edge-handling mode% dwtmode(edge);st = dwtmode('status', 'nodisp');%returns in st the current mode and no text (status or warning) is displayed in the MATLAB command windowif ~strcmp(st, edge) dwtmode(edge); % DWT扩展模式为edgeend% Initializefm = [];fmm = [];fml = [];we = [];for p = 1:ntexs for q = 1:nsubs file = sprintf('%s/%s.%02d.tif', dirname, name{p}, q); [fv1, fv2, fv3, w] = wavefeat(file, nlevels, LoF_D, HiF_D); fm = [fm, fv1]; fmm = [fmm, fv2]; fml = [fml, fv3]; we = [we, w]; endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -