%function [U,V,USAN] = SUSAN(A,maxInt,sigma,thresh,g,radius,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
% g - the geometric threshold (0-1)
% radius(optional) - radius considered in non-maximal suprresion
% width(optional) - the width of the mask, which must be odd.
%
% OUTPUT:
% U - the U coordinates of the corners
% V - the V coordinates of the corners
% USAN(optional) - the USAN image
function [U,V,USAN] = SUSAN(A,maxInt,sigma,thresh,g,radius,width)
if(nargin<6)
radius = 2*ceil(sigma)+1;
width = radius;
elseif(nargin==6)
width = 2*ceil(sigma)+1;
end
%compute the USAN response
USAN = getUSAN(A,maxInt,sigma,thresh,width);
%find the maximum points using non-maximal suppression
[U,V] = localMax(-USAN, radius, -g);