Home > SaliencyToolbox > computeAllSaliencyMaps.m

computeAllSaliencyMaps

PURPOSE ^

computeAllSaliencyMaps - computes the saliency maps for many images.

SYNOPSIS ^

function computeAllSaliencyMaps(imageFile,salmapFile,salParams,fid)

DESCRIPTION ^

 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 filename of a .mat file with a vector of image
       structures called 'images'. 
    salmapFile - the file name of the file where the saliency maps
       should be saved.
    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.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

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