.
%%% Contact
% (ISR-2/LANL)%
%% See also% <../../../toolboxes/kovesi/PhaseCongruency/html/PHASECONG3.html |PHASECONG3|>,
% ,% ,
% ,% ,
% ,% ,
% ,% ,
% ,% .
% Requires: % .
%% Function implementation
function [M, m, varargout] = congruencyedge(I, varargin)
%%% check if possible
if ~exist('phasecong3','file')
error('congruencyedge:libraryerror','Kovesi''s library required');end
%%
% parsing and checking parameters
error(nargchk(1, 23, nargin, 'struct'));error(nargoutchk(1, 7, nargout, 'struct'));
if ~isnumeric(I)
error('congruencyedge:inputerror','matrix required in input'); end
p = createParser('CONGRUENCYEDGE');
% optional parameters% See PHASECON3 for default parameters' values
p.addOptional('nscale', 4, @(x)isscalar(x) && round(x)==x && x>0);p.addOptional('norient', 6, @(x)isscalar(x) && round(x)==x && x>0);
p.addOptional('minwave', 3, @(x)isscalar(x) && round(x)==x && x>0);p.addOptional('mult', 2.1, @(x)isscalar(x) && isfloat(x) && x>0);
p.addParamValue('sigonf', 0.55, @(x)isscalar(x) && isfloat(x) && x>=0 && x<=1);p.addParamValue('k', 2, @(x)isscalar(x) && isfloat(x) && x>0);
p.addParamValue('cutoff', 0.5, @(x)isscalar(x) && isfloat(x) && x>=0 && x<=1);p.addParamValue('g', 10, @(x)isscalar(x) && isfloat(x) && x>0);
p.addParamValue('noise', -1, @(x)isscalar(x) && ... isfloat(x) && (x>0 || x==-1 || x==-2));
% parse and validate all input arguments
p.parse(varargin{:});p = getvarParser(p);
%%
% main processing
[M, m, or, ft, pc, EO, T] = ... congruencyedge_base(I, p.nscale, p.norient, p.minwave, ...
p.mult, p.sigonf, p.k, p.cutoff, p.g, p.noise);
%%% set outputs
if nargout>=3,
varargout{1} = or; if nargout>=4,
varargout{2} = ft; if nargout>=5,
varargout{3} = pc; if nargout>=6,
varargout{4} = EO; if nargout==7,
varargout{5} = T; end
end end
endend
%%
% display
if p.disp C = size(I,3);
figure, subplot(1,nargout,1), imagesc(rescale(M,0,1)), axis image off
title('phase congruency covariance - max'); if nargout==2
subplot(1,2,2), imagesc(rescale(m,0,1)), axis image off title('phase congruency covariance - min');
end if C==1, colormap gray; end;
end
end % end of congruencyedge
##### SOURCE END #####-->