Table of Contents

Class Cv2.Dnn

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

cv::dnn functions

public static class Cv2.Dnn
Inheritance
Cv2.Dnn
Inherited Members

Methods

BlobFromImage(Mat, double, Size, Scalar, bool, bool)

Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center, subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.

BlobFromImageWithParams(InputArray, Image2BlobParams?)

Creates 4-dimensional blob from image with given params. This function is an extension of BlobFromImage(Mat, double, Size, Scalar, bool, bool) to meet more image preprocess needs.

BlobFromImages(IEnumerable<Mat>, double, Size, Scalar, bool, bool)

Creates 4-dimensional blob from series of images. Optionally resizes and crops @p images from center, subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.

BlobFromImagesWithParams(IEnumerable<Mat>, Image2BlobParams?)

Creates 4-dimensional blob from series of images with given params.

EnableModelDiagnostics(bool)

Enables detailed logging of the DNN model loading with CV DNN API. Diagnostic mode provides detailed logging of the model loading stage to explore potential problems (ex.: not implemented layer type).

GetAvailableBackends()

Returns the list of available (backend, target) pairs supported by this build.

GetAvailableTargets(Backend)

Returns the list of available computation targets for the given backend.

ImagesFromBlob(Mat)

Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std::vector<cv::Mat>).

NMSBoxes(IEnumerable<Rect2d>, IEnumerable<float>, float, float, out int[], float, int)

Performs non maximum suppression given boxes and corresponding scores.

NMSBoxes(IEnumerable<Rect>, IEnumerable<float>, float, float, out int[], float, int)

Performs non maximum suppression given boxes and corresponding scores.

NMSBoxes(IEnumerable<RotatedRect>, IEnumerable<float>, float, float, out int[], float, int)

Performs non maximum suppression given boxes and corresponding scores.

NMSBoxesBatched(IEnumerable<Rect2d>, IEnumerable<float>, IEnumerable<int>, float, float, out int[], float, int)

Performs batched non maximum suppression on given boxes and corresponding scores across different classes.

NMSBoxesBatched(IEnumerable<Rect>, IEnumerable<float>, IEnumerable<int>, float, float, out int[], float, int)

Performs batched non maximum suppression on given boxes and corresponding scores across different classes.

ReadNet(string, string, string, EngineType)

Read deep learning network represented in one of the supported formats.

This function automatically detects an origin framework of trained model and calls an appropriate function such @ref readNetFromTensorflow, @ref readNetFromONNX, or @ref readNetFromModelOptimizer. The Caffe, Darknet and Torch parsers were removed in OpenCV 5.

ReadNetFromONNX(byte[], EngineType)

Reads a network model ONNX https://onnx.ai/ from memory

ReadNetFromONNX(Stream, EngineType)

Reads a network model ONNX https://onnx.ai/ from stream.

ReadNetFromONNX(ReadOnlySpan<byte>, EngineType)

Reads a network model ONNX https://onnx.ai/ from memory

ReadNetFromONNX(string, EngineType)

Reads a network model ONNX https://onnx.ai/ from memory

ReadNetFromTFLite(byte[], EngineType)

Reads a network model stored in TFLite framework's format from memory.

ReadNetFromTFLite(Stream, EngineType)

Reads a network model stored in TFLite framework's format from stream.

ReadNetFromTFLite(ReadOnlySpan<byte>, EngineType)

Reads a network model stored in TFLite framework's format from memory.

ReadNetFromTFLite(string, EngineType)

Reads a network model stored in TFLite (https://www.tensorflow.org/lite) framework's format.

ReadNetFromTensorflow(byte[], byte[]?, EngineType)

Reads a network model stored in Tensorflow model file from memory.

ReadNetFromTensorflow(Stream, Stream?, EngineType)

Reads a network model stored in Tensorflow model file from stream.

ReadNetFromTensorflow(string, string?, EngineType)

Reads a network model stored in Tensorflow model file.

ReadTensorFromONNX(string)

Creates blob from .pb file.

ResetMyriadDevice()

Release a Myriad device is binded by OpenCV.

Single Myriad device cannot be shared across multiple processes which uses Inference Engine's Myriad plugin.

SoftNMSBoxes(IEnumerable<Rect>, IEnumerable<float>, out float[], float, float, out int[], int, float, SoftNMSMethod)

Performs soft non maximum suppression given boxes and corresponding scores. Reference: https://arxiv.org/abs/1704.04503

WriteTextGraph(string, string)

Create a text representation for a binary network stored in protocol buffer format.