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

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

    fn detect(
        &mut self,
        frame: &dyn ToInputArray,
        class_ids: &mut VectorOfi32,
        confidences: &mut VectorOff32,
        boxes: &mut VectorOfRect,
        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

fn detect(
    &mut self,
    frame: &dyn ToInputArray,
    class_ids: &mut VectorOfi32,
    confidences: &mut VectorOff32,
    boxes: &mut VectorOfRect,
    conf_threshold: f32,
    nms_threshold: f32
) -> Result<()>

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...