📄 ridge_awt.sci
字号:
function localmaxima = Ridge_AWT(m,par,ABS)
// Ridge_AWT -- Ridges of an Analytic Wavelet Transform
// Usage
// localmaxima = Ridge_AWT(m,par,ABS);
// Inputs
// m input matrix
// par parameter, 2*par is how many neighbours to compare
// ABS flag, compare by absolute value(1) or not(0)
// Outputs
// localmaxima local maxima of every column, binary matrix same size
// as m.
// Description
// see section 4.4.2 of Mallat's book
// Algorithm
// Get the local maxima first, then compare with original value
// References
//
// Copyright Aldo I Maalouf
[lhs,rhs]=argn();
if rhs < 3,
ABS = 1;
end;
if rhs < 2,
end;
if ABS,
m = abs(m);
end;
[nrows,ncols] = size(m);
localmaxima = zeros(nrows,ncols);
t = 1:nrows;
tplus = rshift(t);
tminus = lshift(t);
Thresh = max(max(abs(m)))/20;
c1=ones(nrows,ncols);
c2=ones(nrows,ncols);
c3=ones(nrows,ncols);
for i = 1:ncols,
x = ShapeAsRow(m(:,i));
for j = 1:par,
x = max(x(t), x(tplus), x(tminus));
end;
x = ShapeAsRow(x)';
thresh = max(x)/2;
for j=1:nrows,
if m(j,i)<x(j,1),
c1(j,i)=0;
end
if m(j,i)<=thresh,
c2(j,i)=0;
end
if m(j,i)<=Thresh,
c3(j,i)=0;
end
end
localmaxima(:,i) = c1(:,i).*c2(:,i).*c3(:,i);
//localmaxima(:,i) = (~(m(:,i)<x)).*(m(:,i)>thresh).*(m(:,i)>Thresh);
end;
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -