# View Source Evision.Saliency.StaticSaliency (Evision v0.2.8)

# Summary

## Functions

This function perform a binary map of given saliency map. This is obtained in this way

This function perform a binary map of given saliency map. This is obtained in this way

# Types

@type t() :: %Evision.Saliency.StaticSaliency{ref: reference()}

Type that represents an `Saliency.StaticSaliency`

struct.

**ref**.`reference()`

The underlying erlang resource variable.

# Functions

@spec computeBinaryMap(t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | false | {:error, String.t()}

This function perform a binary map of given saliency map. This is obtained in this way:

##### Positional Arguments

**self**:`Evision.Saliency.StaticSaliency.t()`

**saliencyMap**:`Evision.Mat`

.the saliency map obtained through one of the specialized algorithms

##### Return

**retval**:`bool`

**binaryMap**:`Evision.Mat.t()`

.the binary map

In a first step, to improve the definition of interest areas and facilitate identification of
targets, a segmentation by clustering is performed, using *K-means algorithm*. Then, to gain a
binary representation of clustered saliency map, since values of the map can vary according to
the characteristics of frame under analysis, it is not convenient to use a fixed threshold. So,
Otsu's algorithm* is used, which assumes that the image to be thresholded contains two classes
of pixels or bi-modal histograms (e.g. foreground and back-ground pixels); later on, the
algorithm calculates the optimal threshold separating those two classes, so that their
intra-class variance is minimal.

Python prototype (for reference only):

`computeBinaryMap(_saliencyMap[, _binaryMap]) -> retval, _binaryMap`

@spec computeBinaryMap(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) :: Evision.Mat.t() | false | {:error, String.t()}

This function perform a binary map of given saliency map. This is obtained in this way:

##### Positional Arguments

**self**:`Evision.Saliency.StaticSaliency.t()`

**saliencyMap**:`Evision.Mat`

.the saliency map obtained through one of the specialized algorithms

##### Return

**retval**:`bool`

**binaryMap**:`Evision.Mat.t()`

.the binary map

In a first step, to improve the definition of interest areas and facilitate identification of
targets, a segmentation by clustering is performed, using *K-means algorithm*. Then, to gain a
binary representation of clustered saliency map, since values of the map can vary according to
the characteristics of frame under analysis, it is not convenient to use a fixed threshold. So,
Otsu's algorithm* is used, which assumes that the image to be thresholded contains two classes
of pixels or bi-modal histograms (e.g. foreground and back-ground pixels); later on, the
algorithm calculates the optimal threshold separating those two classes, so that their
intra-class variance is minimal.

Python prototype (for reference only):

`computeBinaryMap(_saliencyMap[, _binaryMap]) -> retval, _binaryMap`