


computeAllSaliencyMaps - computes the saliency maps for many images.
computeAllSaliencyMaps(imageFile,salmapFile,salParams,log_fid)
Computes the saliency maps for all images in imageFile.
This function is useful for batch processing many images.
imageFile - the file name of a .mat file with a vector of image
structures called 'images'. imageFile is relative to DATA_DIR,
the locations of the actual image files are relative to
IMG_DIR.
salmapFile - the file name of the file where the saliency maps
should be saved, relative to DATA_DIR.
salParams - the parameters for computing the saliency maps.
log_fid - a file identifier to write logging information to
(0 for no log info, 1 for stdout).
See also batchSaliency, defaultSaliencyParams, makeSaliencyMap, initializeGlobal.

0001 % computeAllSaliencyMaps - computes the saliency maps for many images. 0002 % 0003 % computeAllSaliencyMaps(imageFile,salmapFile,salParams,log_fid) 0004 % Computes the saliency maps for all images in imageFile. 0005 % This function is useful for batch processing many images. 0006 % 0007 % imageFile - the file name of a .mat file with a vector of image 0008 % structures called 'images'. imageFile is relative to DATA_DIR, 0009 % the locations of the actual image files are relative to 0010 % IMG_DIR. 0011 % salmapFile - the file name of the file where the saliency maps 0012 % should be saved, relative to DATA_DIR. 0013 % salParams - the parameters for computing the saliency maps. 0014 % log_fid - a file identifier to write logging information to 0015 % (0 for no log info, 1 for stdout). 0016 % 0017 % See also batchSaliency, defaultSaliencyParams, makeSaliencyMap, initializeGlobal. 0018 0019 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2008 0020 % by Dirk B. Walther and the California Institute of Technology. 0021 % See the enclosed LICENSE.TXT document for the license agreement. 0022 % More information about this project is available at: 0023 % http://www.saliencytoolbox.net 0024 0025 function computeAllSaliencyMaps(imageFile,salmapFile,salParams,fid) 0026 0027 declareGlobal; 0028 0029 fprintf(fid,'Starting %s on %s at %s.\n',mfilename,imageFile,timeString); 0030 0031 tmp = load([DATA_DIR imageFile]); 0032 names = fieldnames(tmp); 0033 img = getfield(tmp,names{1}); 0034 numImg = length(img); 0035 0036 for i = 1:numImg 0037 fprintf(fid,'Processing image %d of %d ...\n',i,numImg); 0038 SaliencyMap(i) = makeSaliencyMap(img(i),salParams); 0039 end 0040 0041 save([DATA_DIR salmapFile],'SaliencyMap'); 0042 fprintf(fid,'Saved results in %s at %s.\n',salmapFile,timeString);