static_saliency_algorithms.rst 2.79 KB
Newer Older
jaco's avatar
jaco committed
1 2 3 4 5
Static Saliency algorithms
============================

.. highlight:: cpp

jaco's avatar
jaco committed
6 7 8 9 10 11 12 13
Algorithms belonging to this category, exploit different image features that allow to detect salient objects in a non dynamic scenarios.

Presently, the Spectral Residual approach [SR]_ has been implemented.

.. [SR] Hou, Xiaodi, and Liqing Zhang. "Saliency detection: A spectral residual approach." Computer Vision and Pattern Recognition, 2007. CVPR'07. IEEE Conference on. IEEE, 2007.


SpectralResidual
jaco's avatar
jaco committed
14
----------------
jaco's avatar
jaco committed
15 16 17 18 19 20 21

Starting from the principle of natural image statistics, this method simulate the behavior of pre-attentive visual search. The algorithm analyze the log spectrum of each image and obtain the spectral residual. Then transform the spectral residual to spatial domain to obtain the saliency map, which suggests the positions of proto-objects.

.. ocv:class:: StaticSaliencySpectralResidual

Implementation of SpectralResidual from :ocv:class:`StaticSaliency`::

jaco's avatar
jaco committed
22
   class CV_EXPORTS StaticSaliencySpectralResidual : public StaticSaliency
jaco's avatar
jaco committed
23 24 25 26 27 28 29 30 31 32
   {
    public:

     StaticSaliencySpectralResidual();
     ~StaticSaliencySpectralResidual();

     typedef Ptr<Size> (Algorithm::*SizeGetter)();
     typedef void (Algorithm::*SizeSetter)( const Ptr<Size> & );

     Ptr<Size> getWsize();
jaco's avatar
jaco committed
33
     void setWsize( const Ptr<Size> &newSize );
jaco's avatar
jaco committed
34 35 36 37 38 39 40 41 42 43

     void read( const FileNode& fn );
     void write( FileStorage& fs ) const;

    protected:
     bool computeSaliencyImpl( const InputArray src, OutputArray dst );

   };


jaco's avatar
jaco committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
StaticSaliencySpectralResidual::StaticSaliencySpectralResidual
--------------------------------------------------------------

Constructor

.. ocv:function:: StaticSaliencySpectralResidual::StaticSaliencySpectralResidual()


StaticSaliencySpectralResidual::getWsize
----------------------------------------
Return the resized image size.

.. ocv:function:: Ptr<Size> StaticSaliencySpectralResidual::getWsize()


StaticSaliencySpectralResidual::setWsize
----------------------------------------
Set the dimension to which the image should be resized.

.. ocv:function:: StaticSaliencySpectralResidual::void setWsize( const Ptr<Size> &newSize )

    :param newSize: dimension to which the image should be resized
    
    
StaticSaliencySpectralResidual::computeSaliency
-----------------------------------------------
    
Performs all the operations and calls all internal functions necessary for the accomplishment of spectral residual saliency map.

.. ocv:function:: bool StaticSaliencySpectralResidual::computeSaliency( const InputArray image, OutputArray saliencyMap )
 
   :param image: input image. According to the needs of this specialized saliency algorithm, the param image is a single *Mat*
   :param saliencyMap: saliency map. According to the result given by this specialized saliency algorithm, the saliency map is a single *Mat*