OpenCV for Unity 2.6.3
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.DnnModule.DetectionModel Class Reference

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

Inheritance diagram for OpenCVForUnity.DnnModule.DetectionModel:
OpenCVForUnity.DnnModule.Model OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject OpenCVForUnity.DisposableObject OpenCVForUnity.DisposableObject

Public Member Functions

 DetectionModel (string model, string config)
 Create detection model from network represented in one of the supported formats. An order of model and config arguments does not matter.
 
 DetectionModel (string model)
 Create detection model from network represented in one of the supported formats. An order of model and config arguments does not matter.
 
 DetectionModel (Net network)
 Create model from deep learning network.
 
DetectionModel setNmsAcrossClasses (bool value)
 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.
 
bool getNmsAcrossClasses ()
 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.
 
void detect (Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes, float confThreshold, float nmsThreshold)
 Given the input frame, create input blob, run net and return result detections.
 
void detect (Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes, float confThreshold)
 Given the input frame, create input blob, run net and return result detections.
 
void detect (Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes)
 Given the input frame, create input blob, run net and return result detections.
 
- Public Member Functions inherited from OpenCVForUnity.DnnModule.Model
IntPtr getNativeObjAddr ()
 
 Model (string model, string config)
 Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter.
 
 Model (string model)
 Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter.
 
 Model (Net network)
 Create model from deep learning network.
 
Model setInputSize (Size size)
 Set input size for frame.
 
Model setInputSize (int width, int height)
 
Model setInputMean (Scalar mean)
 Set mean value for frame.
 
Model setInputScale (Scalar scale)
 Set scalefactor value for frame.
 
Model setInputCrop (bool crop)
 Set flag crop for frame.
 
Model setInputSwapRB (bool swapRB)
 Set flag swapRB for frame.
 
Model setOutputNames (List< string > outNames)
 Set output names for frame.
 
void setInputParams (double scale, Size size, Scalar mean, bool swapRB, bool crop)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, Size size, Scalar mean, bool swapRB)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, Size size, Scalar mean)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, Size size)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale)
 Set preprocessing parameters for frame.
 
void setInputParams ()
 Set preprocessing parameters for frame.
 
void predict (Mat frame, List< Mat > outs)
 Given the input frame, create input blob, run net and return the output blobs.
 
Model setPreferableBackend (int backendId)
 
Model setPreferableTarget (int targetId)
 
Model enableWinograd (bool useWinograd)
 
Model setInputSize (in Vec2d size)
 Set input size for frame.
 
Model setInputMean (in Vec4d mean)
 Set mean value for frame.
 
Model setInputScale (in Vec4d scale)
 Set scalefactor value for frame.
 
void setInputParams (double scale, in Vec2d size, in Vec4d mean, bool swapRB, bool crop)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in Vec2d size, in Vec4d mean, bool swapRB)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in Vec2d size, in Vec4d mean)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in Vec2d size)
 Set preprocessing parameters for frame.
 
Model setInputSize (in(double width, double height) size)
 Set input size for frame.
 
Model setInputMean (in(double v0, double v1, double v2, double v3) mean)
 Set mean value for frame.
 
Model setInputScale (in(double v0, double v1, double v2, double v3) scale)
 Set scalefactor value for frame.
 
void setInputParams (double scale, in(double width, double height) size, in(double v0, double v1, double v2, double v3) mean, bool swapRB, bool crop)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in(double width, double height) size, in(double v0, double v1, double v2, double v3) mean, bool swapRB)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in(double width, double height) size, in(double v0, double v1, double v2, double v3) mean)
 Set preprocessing parameters for frame.
 
void setInputParams (double scale, in(double width, double height) size)
 Set preprocessing parameters for frame.
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new DetectionModel __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DnnModule.Model
static Model __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DnnModule.Model
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Functions inherited from OpenCVForUnity.DnnModule.Model
- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DetectionModel() [1/3]

OpenCVForUnity.DnnModule.DetectionModel.DetectionModel ( string model,
string config )

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

◆ DetectionModel() [2/3]

OpenCVForUnity.DnnModule.DetectionModel.DetectionModel ( string model)

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

◆ DetectionModel() [3/3]

OpenCVForUnity.DnnModule.DetectionModel.DetectionModel ( Net network)

Create model from deep learning network.

Member Function Documentation

◆ __fromPtr__()

static new DetectionModel OpenCVForUnity.DnnModule.DetectionModel.__fromPtr__ ( IntPtr addr)
static

◆ detect() [1/3]

void OpenCVForUnity.DnnModule.DetectionModel.detect ( Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes )

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

◆ detect() [2/3]

void OpenCVForUnity.DnnModule.DetectionModel.detect ( Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes,
float confThreshold )

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

◆ detect() [3/3]

void OpenCVForUnity.DnnModule.DetectionModel.detect ( Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes,
float confThreshold,
float nmsThreshold )

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

◆ Dispose()

override void OpenCVForUnity.DnnModule.DetectionModel.Dispose ( bool disposing)
protectedvirtual

Reimplemented from OpenCVForUnity.DisposableObject.

◆ getNmsAcrossClasses()

bool OpenCVForUnity.DnnModule.DetectionModel.getNmsAcrossClasses ( )

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.

◆ setNmsAcrossClasses()

DetectionModel OpenCVForUnity.DnnModule.DetectionModel.setNmsAcrossClasses ( bool value)

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.


The documentation for this class was generated from the following file: