%
%% Credit% & (ISR-2/LANL)
%%% See also
% Ressembles:% ,
% ,% <../../../vista/html/CANNYEDGES.html |CANNYEDGES|>,
% Requires:% .
%% Function implementation
function map = cannyedgemap(gx,gy,varargin)
%%% parsing and checking parameters
error(nargchk(1, 20, nargin, 'struct'));
error(nargoutchk(1, 1, nargout, 'struct'));
if ~(isnumeric(gx) && isnumeric(gy)) error('cannyedgemap:inputparameter','matrices required in input');
elseif ~isequal(size(gx),size(gy)) error('cannyedgemap:inputparameter', ...
'input matrices with same size required in input'); end
p = createParser('CANNYEDGEMAP'); % create an instance of the inputParser class.
% function handling the function used for estimating Canny edgesp.addParamValue('mag', [], @(x)isfloat(x));
p.addParamValue('or', [], @(x)isfloat(x));p.addParamValue('der', 'matlab', @(x)ischar(x) && ...
any(strcmpi(x,{'vista','edge','matlab','kovesi'})));p.addParamValue('hyst', [], ...
@(x)isvector(x) && length(x)<=2 && all(x>=0) && all(x<1));p.addParamValue('ratio', [1/3 0.08], ...
@(x)isvector(x) && length(x)==2 && all(x>=0) && all(x<1));
% parse and validate all input argumentsp.parse(varargin{:});
p = getvarParser(p);
%%% main computation
map = cannyedgemap_base(gx, gy, p.der, p.mag, p.or, p.hyst, p.ratio);
%%
% display
if p.disp figure, imagesc(edgemap), axis image off, title('edge map');
if size(edgemap,3) == 1, colormap 'gray'; end;end
end % end of cannyedgemap
##### SOURCE END #####-->