OpenCV for Unity
2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
|
This class represents high-level API for object detection networks. More...
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. More... | |
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. More... | |
DetectionModel (Net network) | |
Create model from deep learning network. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | detect (Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes) |
Given the input frame, create input blob, run net and return result detections. More... | |
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. More... | |
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. More... | |
Model (Net network) | |
Create model from deep learning network. More... | |
Model | setInputSize (Size size) |
Set input size for frame. More... | |
Model | setInputSize (int width, int height) |
Model | setInputMean (Scalar mean) |
Set mean value for frame. More... | |
Model | setInputScale (Scalar scale) |
Set scalefactor value for frame. More... | |
Model | setInputCrop (bool crop) |
Set flag crop for frame. More... | |
Model | setInputSwapRB (bool swapRB) |
Set flag swapRB for frame. More... | |
void | setInputParams (double scale, Size size, Scalar mean, bool swapRB, bool crop) |
Set preprocessing parameters for frame. More... | |
void | setInputParams (double scale, Size size, Scalar mean, bool swapRB) |
Set preprocessing parameters for frame. More... | |
void | setInputParams (double scale, Size size, Scalar mean) |
Set preprocessing parameters for frame. More... | |
void | setInputParams (double scale, Size size) |
Set preprocessing parameters for frame. More... | |
void | setInputParams (double scale) |
Set preprocessing parameters for frame. More... | |
void | setInputParams () |
Set preprocessing parameters for frame. More... | |
void | predict (Mat frame, List< Mat > outs) |
Given the input frame, create input blob, run net and return the output blobs . More... | |
Model | setPreferableBackend (int backendId) |
Model | setPreferableTarget (int targetId) |
Model | enableWinograd (bool useWinograd) |
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 | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
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.
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.
[in] | model | Binary file contains trained weights. |
[in] | config | Text file contains network configuration. |
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.
[in] | model | Binary file contains trained weights. |
[in] | config | Text file contains network configuration. |
OpenCVForUnity.DnnModule.DetectionModel.DetectionModel | ( | Net | network | ) |
Create model from deep learning network.
[in] | network | Net object. |
|
static |
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.
[in] | frame | The input image. |
[out] | classIds | Class indexes in result detection. |
[out] | confidences | A set of corresponding confidences. |
[out] | boxes | A set of bounding boxes. |
[in] | confThreshold | A threshold used to filter boxes by confidences. |
[in] | nmsThreshold | A threshold used in non maximum suppression. |
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.
[in] | frame | The input image. |
[out] | classIds | Class indexes in result detection. |
[out] | confidences | A set of corresponding confidences. |
[out] | boxes | A set of bounding boxes. |
[in] | confThreshold | A threshold used to filter boxes by confidences. |
[in] | nmsThreshold | A threshold used in non maximum suppression. |
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.
[in] | frame | The input image. |
[out] | classIds | Class indexes in result detection. |
[out] | confidences | A set of corresponding confidences. |
[out] | boxes | A set of bounding boxes. |
[in] | confThreshold | A threshold used to filter boxes by confidences. |
[in] | nmsThreshold | A threshold used in non maximum suppression. |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.DisposableOpenCVObject.
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.
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.
[in] | value | The new value for nmsAcrossClasses |