📄 getusan.m
字号:
%function U = getUSAN(A,maxInt,sigma,thresh,width)%% Returns the USAN response of a greysale image%% INPUT:% A - the image. Intensity must be quantized as integers with a minimum% intensity 0 to a maximum maxInt% maxInt- the maximum intensity% sigma - the guassian mask coefficient% thresh - the maximum allowed difference between intensity values% width(optional) - the width of the mask, which must be odd.%% OUTPUT:% U - the normalized USAN responsefunction U = getUSAN(A,maxInt,sigma,thresh,width)if(nargin == 4) width = 2*ceil(sigma)+1;end%prepare AA = double(A);if(isrgb(A)) A = rgb2gray(A);end%create the guassian maskhalfWidth = (width-1)/2;mask = meshgrid(-halfWidth:halfWidth,-halfWidth:halfWidth)/(sqrt(2)*sigma);mask = exp(-mask.^2 - (mask').^2);maxResponse = sum(mask(:));%make the lookup tabletable = [exp(-([maxInt:-1:0]/thresh).^6) exp(-([1:maxInt]/thresh).^6)];%pass it to the nonlinear filterU = nlDiffFilter(A,table,mask)/maxResponse;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -