Home > SaliencyToolbox > maxNormalizeLocalMax.m

maxNormalizeLocalMax

PURPOSE ^

maxNormalizeLocalMax - normalization based on local maxima.

SYNOPSIS ^

function result = maxNormalizeLocalMax(data,varargin)

DESCRIPTION ^

 maxNormalizeLocalMax - normalization based on local maxima.

 result = maxNormalizeLocalMax(data)
    Normalize data by multiplying it with 
    (max(data) - avg(localMaxima))^2 as described in:
    L. Itti, C. Koch, E. Niebur, A Model of Saliency-Based 
    Visual Attention for Rapid Scene Analysis, IEEE PAMI, 
    Vol. 20, No. 11, pp. 1254-1259, Nov 1998.

 result = maxNormalizeLocalMax(data,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, maxNormalizeIterative, makeSaliencyMap.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % maxNormalizeLocalMax - normalization based on local maxima.
0002 %
0003 % result = maxNormalizeLocalMax(data)
0004 %    Normalize data by multiplying it with
0005 %    (max(data) - avg(localMaxima))^2 as described in:
0006 %    L. Itti, C. Koch, E. Niebur, A Model of Saliency-Based
0007 %    Visual Attention for Rapid Scene Analysis, IEEE PAMI,
0008 %    Vol. 20, No. 11, pp. 1254-1259, Nov 1998.
0009 %
0010 % result = maxNormalizeLocalMax(data,minmax)
0011 %    Specify a dynamic range for the initial maximum
0012 %    normalization of the input data (default: [0 10]).
0013 %    The special value minmax = [0 0] means that initial
0014 %    maximum normalization is omitted.
0015 %
0016 % See also maxNormalize, maxNormalizeIterative, makeSaliencyMap.
0017 
0018 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2013
0019 % by Dirk B. Walther and the California Institute of Technology.
0020 % See the enclosed LICENSE.TXT document for the license agreement.
0021 % More information about this project is available at:
0022 % http://www.saliencytoolbox.net
0023 
0024 function result = maxNormalizeLocalMax(data,varargin)
0025 
0026 if (length(varargin) >= 1) minmax = varargin{1}; 
0027 else minmax = [0 10]; end
0028 
0029 data = normalizeImage(clamp(data,0),minmax);
0030 
0031 if (minmax(1) == minmax(2))
0032   thresh = 1;
0033 else
0034   thresh = minmax(1) + (minmax(2) - minmax(1)) / 10;  
0035 end
0036 
0037 [lm_avg,lm_num,lm_sum] = getLocalMaxima(data,thresh);
0038 
0039 if (lm_num > 1)
0040   result = data * (minmax(2) - lm_avg)^2;
0041 elseif (lm_num == 1)
0042   result = data * minmax(2)^2;
0043 else
0044   error('Could not find any local maxima.');
0045 end

Generated on Thu 18-Jul-2013 06:10:46 by m2html © 2005