http://www.cnblogs.com/ToDoToTry/archive/2011/08/09/2133112.html
Below is MATLAB code which computes a salience/saliency map for an image or image sequence/video (either Graph-Based Visual Saliency (GBVS) or the standard Itti, Koch, Niebur PAMI 1998 saliency map). See the included readme file for details. I also have a newer, simpler version implementing only the Itti algorithm (see simpsal/readme.txt).
Please try it out and email me if you have any questions.
Download:
Please select one of the following to download:
>> gbvs_install
>> img = imread('samplepics/1.jpg');
>> map = gbvs(img); % map.master_map contains the actual saliency map
>> map_itti = ittikochmap(img); % map_itti.master_map contains the actual saliency map
>> show_imgnmap( img , map );
>> map = simpsal(img);
>> mapbig = mat2gray(imresize( map , [ size(img,1) size(img,2) ] ));
Last updated March 15, 2011.
Copyright:
The Itti, Koch, Niebur algorithm is provided for educational use only and for copyright information on that please read this.
The GBVS algorithm can be used for any purposes, but only if it is fully cited/acknowledged.
Reference:
original paper
Jonathan Harel
poster
Please cite use of this code as:
- J. Harel, C. Koch, and P. Perona, "Graph-Based Visual Saliency", Proceedings of Neural Information Processing Systems (NIPS), 2006. [pdf] |
- and/or - |
- J. Harel, A Saliency Implementation in MATLAB: http://www.klab.caltech.edu/~harel/share/gbvs.php |
Feel free to contact me via email with any questions.
Screen Shot:
My Interpretation of why GBVS is more predictive than Itti:
Two very trivial factors which greatly affect the measured prediction accuracy of saliency algorithms (up to 30% improvement in some cases) are (1) level of final blur (for instance, the width of a Gaussian blur kernel applied to the master map), and (2) extent of center bias (for instance, a global center bias multiplicatively applied to the master map). So, inherent variability in these two contributed to the reported performance gain the NIPS 2006 paper. However, even after controlling for these, there is a performance difference between GBVS and Itti. For instance, on a database of 200 face images you will find 0.841 mean ROC for GBVS and 0.812 mean ROC for Itti (NSS values 1.321 and 1.228 resp.) after optimizing for blur and center bias. Based on an inspection of many saliency maps, I believe that this remaining performance gain is due to long-range competition in the GBVS algorithm which is not captured accurately enough by the Itti algorithm.
-JH