📄 filt_get_s_layer.m
字号:
function f = filt_get_S_layer (file_name, varargin)% FUNCTION f = filt_get_S_layer (file_name, varargin)%% Load the learned/saved S-layer filters. When loading the% pre-learned features, we can either replicate the features to all% scales or just grab the features as it is. For the former case,% varargin{1} specifies to how many scales to replicate. Another% varargin{2} specifies how many features to keep.% varargin{3} specifies the shift values (because the shift defined% in learn_file may be different from the definition in init_filter_def.m).f = [];load(file_name,'f');scales = aux_get_filt_info(fieldnames(f));f_size = getfield(f, ['size_s' num2str(scales(1))]);if length(varargin) > 0 num_scale_full = varargin{1}; % how many scales to replicate if length(varargin) > 1 num_features = varargin{2}; % how many features to keep if num_features > f_size(4) disp(['Too many features requested in ' file_name]); disp(['We will take all the available features.']); num_features = f_size(4); end else num_features = f_size(4); end f = aux_replicate_filters (f,num_scale_full,num_features);endif length(varargin)>2 shifts = varargin{3}; if length(shifts) ~= num_scale_full error('Not enough/Too few shift definitions.'); end for i = 1:num_scale_full f = setfield(f, ['shift_s' num2str(i)], shifts(i)); endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -