steerchannels.m
来自「加州大学伯克利分校的一个车俩识别程序, 用matlab实现」· M 代码 · 共 52 行
M
52 行
function [fpyr, ch, combineGH] = steerChannels(ipyr, ch)%foo %if not pyramid input if(strcmp(class(ipyr),'cell')==1) pyr = ipyr; else pyr{1}=ipyr; end combineGH=0; if(ch<0) combineGH=1; ch=-ch; end if(length(ch)==1) ch = linspace(-pi/2, pi/2, ch+1); ch = ch(1:end-1); end for l=1:length(pyr) theta =[]; strength=[]; G2=[]; H2=[]; im = mean(pyr{l},3); basis = steerable_gauss(im,1); for d=1:length(ch) [G2 H2] = steer(ch(d),basis); if(combineGH) fpyr{l}(:,:,d,1) = sqrt(G2.^2+H2.^2); fpyr{l}(:,:,d,2) = abs(atan2(H2,G2)); else fpyr{l}(:,:,d,1) = G2; fpyr{l}(:,:,d,2) = H2; end end if(combineGH) maxmap = max(fpyr{l}(:,:,:,1),[],3)+eps; fpyr{l}(:,:,:,1) = min(0.4,fpyr{l}(:,:,:,1).^2./... repmat(maxmap, [1,1,length(ch)])); else maxmap = max(max(abs(fpyr{l}),[],4),[],3)+eps; fpyr{l} = max(-0.4, min(0.4,fpyr{l}.*abs(fpyr{l})./... repmat(maxmap, [1,1,length(ch),2]))); end end if(strcmp(class(pyr),'cell')==1) fpyr = fpyr{1}; end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?