[][src]Trait opencv::dnn::prelude::DetectionModelTrait

pub trait DetectionModelTrait: ModelTrait {
    pub fn as_raw_DetectionModel(&self) -> *const c_void;
pub fn as_raw_mut_DetectionModel(&mut self) -> *mut c_void; pub fn set_nms_across_classes(
        &mut self,
        value: bool
    ) -> Result<DetectionModel> { ... }
pub fn get_nms_across_classes(&mut self) -> Result<bool> { ... }
pub fn detect(
        &mut self,
        frame: &dyn ToInputArray,
        class_ids: &mut Vector<i32>,
        confidences: &mut Vector<f32>,
        boxes: &mut Vector<Rect>,
        conf_threshold: f32,
        nms_threshold: f32
    ) -> Result<()> { ... } }

This class represents high-level API for object detection networks.

DetectionModel allows to set params for preprocessing input image. DetectionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return result detections. For DetectionModel SSD, Faster R-CNN, YOLO topologies are supported.

Required methods

Loading content...

Provided methods

pub fn set_nms_across_classes(&mut self, value: bool) -> Result<DetectionModel>[src]

nmsAcrossClasses defaults to false, such that when non max suppression is used during the detect() function, it will do so per-class. This function allows you to toggle this behaviour.

Parameters

  • value: The new value for nmsAcrossClasses

pub fn get_nms_across_classes(&mut self) -> Result<bool>[src]

Getter for nmsAcrossClasses. This variable defaults to false, such that when non max suppression is used during the detect() function, it will do so only per-class

pub fn detect(
    &mut self,
    frame: &dyn ToInputArray,
    class_ids: &mut Vector<i32>,
    confidences: &mut Vector<f32>,
    boxes: &mut Vector<Rect>,
    conf_threshold: f32,
    nms_threshold: f32
) -> Result<()>
[src]

Given the @p input frame, create input blob, run net and return result detections.

Parameters

  • frame: The input image.
  • classIds:[out] Class indexes in result detection.
  • confidences:[out] A set of corresponding confidences.
  • boxes:[out] A set of bounding boxes.
  • confThreshold: A threshold used to filter boxes by confidences.
  • nmsThreshold: A threshold used in non maximum suppression.

C++ default parameters

  • conf_threshold: 0.5f
  • nms_threshold: 0.0f
Loading content...

Implementors

impl DetectionModelTrait for DetectionModel[src]

Loading content...