[][src]Trait opencv::hub_prelude::SegmentationModelTrait

pub trait SegmentationModelTrait: ModelTrait + NetTrait {
    fn as_raw_SegmentationModel(&self) -> *mut c_void;

    fn segment(
        &mut self,
        frame: &dyn ToInputArray,
        mask: &mut dyn ToOutputArray
    ) -> Result<()> { ... } }

This class represents high-level API for segmentation models

SegmentationModel allows to set params for preprocessing input image. SegmentationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the class prediction for each pixel.

Required methods

Loading content...

Provided methods

fn segment(
    &mut self,
    frame: &dyn ToInputArray,
    mask: &mut dyn ToOutputArray
) -> Result<()>

Given the @p input frame, create input blob, run net

Parameters

  • frame: The input image.
  • mask:[out] Allocated class prediction for each pixel
Loading content...

Implementors

impl SegmentationModelTrait for SegmentationModel[src]

Loading content...