%
% [Weick98] J. Weickert: "Anisotropic Diffusion in Image Processing",% Teubner-Verlag, Stuttgart (Germany), 1998.
%% [Kothe03] U. Koethe: "Integrated edge and junction detection with
% the boundary tensor", Proc. IEEE ICCV, vol. 1, pp. 424?431, 2003.%
%% [Scheun03] P. Scheunders: "A wavelet representation of multispectral
% images", Frontiers of Remote Sensing Information Processing, pp.% 197?224. World Scientific, 2003.
% %
% [Tschum06] D. Tschumperle: "Fast anisotropic smoothing of multivalued% images using curvature-preserving PDE?s", International Journal of
% Computer Vision, 68(1):65?82, 2006.%
%% [WCFTA06] H. Wang, Y. Chen, T. Fang, J. Tyan and N. Ahuja: "Gradient
% adaptive image restoration and enhancement", Proc. ICIP, vol. 2, % pp. 893-896, 2006.
% %
%% Credit% (ISR-2/LANL)
%%% See also
% Ressembles:% ,
% ,% .
% Requires:% .
%% Function implementation
function varargout = gstfeature(gx2, gy2, gxy, varargin)
%%% parsing parameters
error(nargchk(1, 18, nargin, 'struct'));
error(nargoutchk(1, 7, nargout, 'struct'));
if ~(isnumeric(gx2) && isnumeric(gy2) && isnumeric(gxy)) error('gstfeature:inputerror','matrices are required in input');
end
p = createParser('GSTFEATURE'); % create an instance of the inputParser class.p.addOptional('f','norm', @(x)ischar(x) || iscell(x));
% any(strcmpi(x,{'norm','frob','orient','ordir','reorient','inert','coher'});p.addParamValue('eign',[],@(x)ischar(x) && ...
any(strcmpi(x,{'abs','zen','l1','sap','sum','ndi','dif','koe'})));p.addParamValue('ex',[],@(x)isnumeric(x));
p.addParamValue('ey',[],@(x)isnumeric(x));
% parse and validate all input argumentsp.parse(varargin{:});
p = getvarParser(p);
%% % internal variables and further testing
% check the compatibility of the input parameters
if any(size(gx2)~=size(gy2)) || any(size(gx2)~=size(gxy)) error('gstfeature:inputerror','matrices must have same dimensions');
end
% % create the list of feature names% if nb_dims(p.f)==2 % then already an array of feature names has been passed
% lfeat = p.f;%
% else % let's create such an array from the concatenate string% lfeat = str2vsubstr(p.f, ...
% strvcat('eigenorm','norm','frobenius','frob','orientation', ...% 'orient','direction','ordir','vectorial','orvec', ...
% 'inertia','inert','coherence','coher')); %#ok% end
if ischar(p.f), p.f = {p.f}; endnfeat = numel(p.f);
if nargout~=1 && nargout~=nfeat
error('gstfeature:inputerror', ... ['the no. of output arguments must be 1 or equal to the no. ' ...
'of computed features must be equal']);end
if ~any(strncmp('norm',p.f,4)) && ~any(strncmp('eigenorm',p.f,4)) && ...
~isempty(p.eign) warning('gstfeature:incompatibleparameter',...
'parameter eign ignored for features other than norm');else
p.eign = 'zen'; % default value, may be unusedend
test = ~any(strncmp('orvec',p.f,4)) && ~any(strncmp('vectorial',p.f,4));
if test && (~isempty(p.ex) || ~isempty(p.ey)) warning('gstfeature_base:incompatibleparameter',...
'parameters ex,ey ignored for features other than orvec');elseif ~test && isempty(p.ex) && isempty(p.ey)
error('gstfeature_base:incompatibleparameter',... 'parameters ex,ey need to be passed with feature orvec');
end
%% % main computation
varargout{1} = [];
for i=1:nfeat
F = gstfeature_base(gx2, gy2, gxy, p.f{i}, p.eign, p.ex, p.ey); if nargout==1, varargout{1} = cat(3, varargout{1}, F);
else varargout{i} = F; endend
%%
% displayif p.disp
figure, ncols = min(3,nfeat); nrows = ceil(nfeat/ncols);
for i=1:nfeat subplot(nrows,ncols,i), imagesc(varargout{i}), axis image off;
title(p.f(i,:)), colormap gray; end
end
end % end of gstfeature
##### SOURCE END #####-->