SaliencyToolbox 2.3 - documentation

Quick Start

m-file documentation
Bug reports

official SaliencyToolbox web page


Unpacking the code creates a directory structure under SaliencyToolbox. Simply add the SaliencyToolbox directory to your Matlab path:

addpath('<your SaliencyToolbox path>');

If you want to have access to the toolbox everytime you start Matlab, then place the above command into your startup.m file, which is located in ~/matlab/startup.m for Linux, Mac OS X and other Unix flavors. Or go to "File > Set Path > Add folder > [Select the SaliencyToolbox folder] > Save".

Quick Start

Okay, now that installation was so simple, you have some time left for a test drive, right? Version 2.0 sports a new graphical user interface (GUI) version of the saliency code. In Matlab, change to the SaliencyToolbox directory, then type:


Hit "Start" to start the saliency computation. Everything else should be fairly intuitive.

There is also the command-line version of the program:


After a few moments, you should see four figure windows with various intermediate results, and in the Matlab window you will see details about the most salient location, which is also marked in the image. You can now hit Return to go to the next most salient location and so forth. To quit, simply enter 'q' and press Return.

If you want to compute the saliency maps and fixations for several images in batch mode, then check out batchSaliency.

The SaliencyToolbox/img directory contains a few example images for you to play with. The guiSaliency, runSaliency, and batchSaliency functions also takes an optional second argument, a saliencyParams structure. Start exploring the documentation for runSaliency, batchSaliency, defaultSaliencyParams, and dataStructures to get an idea of what is happening. It may be a good idea to make a copy of runSaliency and start dissecting and adapting it for your purpose.

If you want to get more feedback on what is happening at each time step, then try switching debugging messages on in the GUI version. In the command-line version, you can do the following:


See the documentations for initializeGlobal, declareGlobal, and debugMsg for what is happening here.

Here is another common application, computing the saliency map for an image and upsampling it to full image resolution. Use this piece of code:

img = initializeImage('img/balloons.png');
params = defaultSaliencyParams;
salmap = makeSaliencyMap(img,params);
bigMap = imresize(,img.size(1:2));

Generating the documentation

The documentation for the m-files is generated from within Matlab, using the m2html toolbox. Make sure that m2html is in your Matlab path, then change to the SaliencyToolbox base directory and type:


And you'll have the documentation for the m-files in SaliencyToolbox/doc/mdoc.

Bug reports

Please submit any bugs, feature requests and support requests to:

SaliencyToolbox homepage
last modified: 2 July, 2013