[][src]Struct opencv::dnn::DetectionModel

pub struct DetectionModel { /* fields omitted */ }

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.

Methods

impl DetectionModel[src]

pub fn as_raw_DetectionModel(&self) -> *mut c_void[src]

pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self[src]

impl DetectionModel[src]

pub fn new(model: &str, config: &str) -> Result<DetectionModel>[src]

Create detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Parameters

  • model: Binary file contains trained weights.
  • config: Text file contains network configuration.

C++ default parameters

  • config: ""

pub fn new_1(network: &dyn NetTrait) -> Result<DetectionModel>[src]

Create model from deep learning network.

Parameters

  • network: Net object.

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

Trait Implementations

impl Drop for DetectionModel[src]

impl ModelTrait for DetectionModel[src]

impl NetTrait for DetectionModel[src]

impl Send for DetectionModel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.