Trait SelectiveSearchSegmentationStrategyTrait

Source
pub trait SelectiveSearchSegmentationStrategyTrait: AlgorithmTrait + SelectiveSearchSegmentationStrategyTraitConst {
    // Required method
    fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void;

    // Provided methods
    fn set_image(
        &mut self,
        img: &impl ToInputArray,
        regions: &impl ToInputArray,
        sizes: &impl ToInputArray,
        image_id: i32,
    ) -> Result<()> { ... }
    fn set_image_def(
        &mut self,
        img: &impl ToInputArray,
        regions: &impl ToInputArray,
        sizes: &impl ToInputArray,
    ) -> Result<()> { ... }
    fn get(&mut self, r1: i32, r2: i32) -> Result<f32> { ... }
    fn merge(&mut self, r1: i32, r2: i32) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn set_image( &mut self, img: &impl ToInputArray, regions: &impl ToInputArray, sizes: &impl ToInputArray, image_id: i32, ) -> Result<()>

Set a initial image, with a segmentation.

§Parameters
  • img: The input image. Any number of channel can be provided
  • regions: A segmentation of the image. The parameter must be the same size of img.
  • sizes: The sizes of different regions
  • image_id: If not set to -1, try to cache pre-computations. If the same set og (img, regions, size) is used, the image_id need to be the same.
§C++ default parameters
  • image_id: -1
Source

fn set_image_def( &mut self, img: &impl ToInputArray, regions: &impl ToInputArray, sizes: &impl ToInputArray, ) -> Result<()>

Set a initial image, with a segmentation.

§Parameters
  • img: The input image. Any number of channel can be provided
  • regions: A segmentation of the image. The parameter must be the same size of img.
  • sizes: The sizes of different regions
  • image_id: If not set to -1, try to cache pre-computations. If the same set og (img, regions, size) is used, the image_id need to be the same.
§Note

This alternative version of SelectiveSearchSegmentationStrategyTrait::set_image function uses the following default values for its arguments:

  • image_id: -1
Source

fn get(&mut self, r1: i32, r2: i32) -> Result<f32>

Return the score between two regions (between 0 and 1)

§Parameters
  • r1: The first region
  • r2: The second region
Source

fn merge(&mut self, r1: i32, r2: i32) -> Result<()>

Inform the strategy that two regions will be merged

§Parameters
  • r1: The first region
  • r2: The second region

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategy>

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategyColor>

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategyFill>

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategyMultiple>

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategySize>

Source§

impl SelectiveSearchSegmentationStrategyTrait for BoxedRefMut<'_, SelectiveSearchSegmentationStrategyTexture>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategy>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategyColor>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategyFill>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategyMultiple>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategySize>

Source§

impl SelectiveSearchSegmentationStrategyTrait for Ptr<SelectiveSearchSegmentationStrategyTexture>

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategy

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyColor

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyFill

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyMultiple

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategySize

Source§

impl SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyTexture