Trait opencv::prelude::StaticSaliencyTrait  
source · pub trait StaticSaliencyTrait: SaliencyTrait + StaticSaliencyTraitConst {
    // Required method
    fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void;
    // Provided method
    fn compute_binary_map(
        &mut self,
        _saliency_map: &impl ToInputArray,
        _binary_map: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
}Expand description
Mutable methods for crate::saliency::StaticSaliency
Required Methods§
fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void
Provided Methods§
sourcefn compute_binary_map(
    &mut self,
    _saliency_map: &impl ToInputArray,
    _binary_map: &mut impl ToOutputArray,
) -> Result<bool>
 
fn compute_binary_map( &mut self, _saliency_map: &impl ToInputArray, _binary_map: &mut impl ToOutputArray, ) -> Result<bool>
This function perform a binary map of given saliency map. This is obtained in this way:
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.
§Parameters
- _saliencyMap: the saliency map obtained through one of the specialized algorithms
 - _binaryMap: the binary map