removeColorFeatures - removes color features from the saliency parameters. params = removeColorFeatures(params) removes all features from params that require a color image. params = removeColorFeatures(params,0) suppresses the warning. See also defaultSaliencyParams, runSaliency, dataStructures.
0001 % removeColorFeatures - removes color features from the saliency 0002 % parameters. 0003 % 0004 % params = removeColorFeatures(params) 0005 % removes all features from params that require a color image. 0006 % 0007 % params = removeColorFeatures(params,0) 0008 % suppresses the warning. 0009 % 0010 % See also defaultSaliencyParams, runSaliency, dataStructures. 0011 0012 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2008 0013 % by Dirk B. Walther and the California Institute of Technology. 0014 % See the enclosed LICENSE.TXT document for the license agreement. 0015 % More information about this project is available at: 0016 % http://www.saliencytoolbox.net 0017 0018 function params = removeColorFeatures(params,fid) 0019 0020 if nargin < 2 0021 fid = 1; 0022 end 0023 0024 colorTypes = {'Color','Hue','Skin'}; 0025 0026 numFeats = length(params.features); 0027 idx = [1:numFeats]; 0028 0029 for f = 1:numFeats 0030 if ismember(params.features{f},colorTypes) 0031 fprintf(fid,['Warning: Trying to use feature ''' params.features{f} '''\n' ... 0032 'for a non-color image. Skipping the feature.\n\n']); 0033 idx = setdiff(idx,f); 0034 end 0035 end 0036 0037 % actually remove the features and their weights 0038 params.features = {params.features{idx}}; 0039 params.weights = [params.weights(idx)];