📄 steer_max.m
字号:
function [theta,strength,phase,energy] = steer_max(basis)% [theta,strength,phase,energy] = steer_max(basis)% returns the local angles of maximum response,% the strength of the dominant orientation, .%% as per freeman & adelson, pami, sept 1991%% charless fowlkes, 2000%% compute the second and third coeffecients% of the fourier expansion of the energy % function:%% E = C1 + C2*cos(2theta) + C3*sin(2theta) +% C2 = 0.5*(basis.Ga.^2-basis.Gc.^2) + ... 0.46785*(basis.Ha.^2 - basis.Hd.^2) + ... 0.28125*(basis.Hb.^2-basis.Hc.^2) + ... 0.1875*(basis.Ha.*basis.Hc - basis.Hb.*basis.Hd); C3 = -(basis.Ga .* basis.Gb) -(basis.Gb .* basis.Gc) ... -0.9375*(basis.Hc .* basis.Hd + basis.Ha .* basis.Hb) ... -1.6875 * basis.Hb .* basis.Hc - 0.1875 * basis.Ha .* basis.Hd;% use the low order coeficients to estimate% the orientation of greates energy at each% point as well as the strength at that point theta = 0.5*atan2(C3,C2); strength = sqrt(C2.^2 + C3.^2); if(nargout>2) % compute theta for a smoothed version % of the image. steer the filter in the % most energetic direction at each of % those points and compute the phase % response in that direction ... Za = smooth_image(strength.*C2,1); Zb = smooth_image(strength.*C3,1); Q = 0.5*atan2(Zb,Za); [G2,H2] = steer(Q,basis); phase = abs(atan2(H2,G2)); energy = G2.*G2 + H2.*H2; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -