maxNormalizeIterative - normalize data with the an iterative algorithm. result = maxNormalizeIterative(data,numIter) Normalize the data with the iterative normalization algorithm described in: L. Itti, C. Koch, A saliency-based search mechanism for overt and covert shifts of visual attention, Vision Research, Vol. 40, No. 10-12, pp. 1489-1506, May 2000. data: a 2d input array numIter: number of iterations result: the normalized image result = maxNormalizeIterative(data,numIter,minmax) Specify a dynamic range for the initial maximum normalization of the input data (default: [0 10]). The special value minmax = [0 0] means that initial maximum normalization is omitted. See also maxNormalize, maxNormalizeLocalMax, makeSaliencyMap.
0001 % maxNormalizeIterative - normalize data with the an iterative algorithm. 0002 % 0003 % result = maxNormalizeIterative(data,numIter) 0004 % Normalize the data with the iterative 0005 % normalization algorithm described in: 0006 % L. Itti, C. Koch, A saliency-based search mechanism for overt 0007 % and covert shifts of visual attention, Vision Research, 0008 % Vol. 40, No. 10-12, pp. 1489-1506, May 2000. 0009 % data: a 2d input array 0010 % numIter: number of iterations 0011 % result: the normalized image 0012 % 0013 % result = maxNormalizeIterative(data,numIter,minmax) 0014 % Specify a dynamic range for the initial maximum 0015 % normalization of the input data (default: [0 10]). 0016 % The special value minmax = [0 0] means that initial 0017 % maximum normalization is omitted. 0018 % 0019 % See also maxNormalize, maxNormalizeLocalMax, makeSaliencyMap. 0020 0021 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2007 0022 % by Dirk B. Walther and the California Institute of Technology. 0023 % See the enclosed LICENSE.TXT document for the license agreement. 0024 % More information about this project is available at: 0025 % http://www.saliencytoolbox.net 0026 0027 function result = maxNormalizeIterative(data,numIter,varargin) 0028 0029 % a few parameters for the convolution filters 0030 iterInhi = 2.0; 0031 iterCoEx = 0.5; 0032 iterCoIn = 1.5; 0033 iterExSig = 2; 0034 iterInSig = 25; 0035 0036 if (length(varargin) >= 1) minmax = varargin{1}; 0037 else minmax = [0 10]; end 0038 0039 result = normalizeImage(clamp(data,0),minmax); 0040 0041 % make 1d Gaussian kernels for excitation and inhibition 0042 sz = max(size(result)); 0043 maxhw = max(0,floor(min(size(result))/2) - 1); 0044 esig = sz * iterExSig * 0.01; 0045 isig = sz * iterInSig * 0.01; 0046 gExc = gaussian(iterCoEx/(esig*sqrt(2*pi)),esig,maxhw); 0047 gInh = gaussian(iterCoIn/(isig*sqrt(2*pi)),isig,maxhw); 0048 0049 % go through the normalization iterations 0050 for iter = 1:numIter 0051 0052 % get the excitatory and inhibitory receptive fields 0053 excit = sepConv2PreserveEnergy(gExc,gExc,result); 0054 inhib = sepConv2PreserveEnergy(gInh,gInh,result); 0055 0056 % global inhibition to prevent explosion of the map activity 0057 globinhi = 0.01 * iterInhi * max(result(:)); 0058 0059 % putting all the terms together and clamping them 0060 result = clamp((result + excit - inhib - globinhi), 0); 0061 end