OpenCV for Unity 3.0.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.12.0/index.html ) for the details of the argument of the method.
|
This class is presented high-level API for neural networks. More...
Public Member Functions | |
Model (Net network) | |
Create model from deep learning network. | |
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 (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 | enableWinograd (bool useWinograd) |
IntPtr | getNativeObjAddr () |
void | predict (Mat frame, List< Mat > outs) |
Given the input frame, create input blob, run net and return the output blobs . | |
Model | setInputCrop (bool crop) |
Set flag crop for frame. | |
Model | setInputMean (in Vec4d mean) |
Set mean value for frame. | |
Model | setInputMean (in(double v0, double v1, double v2, double v3) mean) |
Set mean value for frame. | |
Model | setInputMean (Scalar mean) |
Set mean value for frame. | |
void | setInputParams () |
Set preprocessing parameters for frame. | |
void | setInputParams (double scale) |
Set preprocessing parameters for frame. | |
void | setInputParams (double scale, in Vec2d size) |
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, in Vec4d mean, bool swapRB) |
Set preprocessing parameters 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(double width, double height) size) |
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, 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, bool swapRB, bool crop) |
Set preprocessing parameters for frame. | |
void | setInputParams (double scale, Size size) |
Set preprocessing parameters for frame. | |
void | setInputParams (double scale, Size size, Scalar mean) |
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, bool swapRB, bool crop) |
Set preprocessing parameters for frame. | |
Model | setInputScale (in Vec4d scale) |
Set scalefactor value for frame. | |
Model | setInputScale (in(double v0, double v1, double v2, double v3) scale) |
Set scalefactor value for frame. | |
Model | setInputScale (Scalar scale) |
Set scalefactor value for frame. | |
Model | setInputSize (in Vec2d size) |
Set input size for frame. | |
Model | setInputSize (in(double width, double height) size) |
Set input size for frame. | |
Model | setInputSize (int width, int height) |
Model | setInputSize (Size size) |
Set input size for frame. | |
Model | setInputSwapRB (bool swapRB) |
Set flag swapRB for frame. | |
Model | setOutputNames (List< string > outNames) |
Set output names for frame. | |
Model | setPreferableBackend (int backendId) |
Model | setPreferableTarget (int targetId) |
![]() | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static Model | __fromPtr__ (IntPtr addr) |
![]() | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Protected Member Functions | |
override void | Dispose (bool disposing) |
![]() | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
![]() | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
![]() | |
![]() | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
This class is presented high-level API for neural networks.
Model allows to set params for preprocessing input image. Model creates net from file with trained weights and config, sets preprocessing input and runs forward pass.
OpenCVForUnity.DnnModule.Model.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 | Binary file contains trained weights. |
config | Text file contains network configuration. |
OpenCVForUnity.DnnModule.Model.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 | Binary file contains trained weights. |
config | Text file contains network configuration. |
OpenCVForUnity.DnnModule.Model.Model | ( | Net | network | ) |
Create model from deep learning network.
network | Net object. |
|
static |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.DisposableOpenCVObject.
Reimplemented in OpenCVForUnity.DnnModule.SegmentationModel, OpenCVForUnity.DnnModule.TextDetectionModel, OpenCVForUnity.DnnModule.TextDetectionModel_DB, OpenCVForUnity.DnnModule.TextDetectionModel_EAST, and OpenCVForUnity.DnnModule.TextRecognitionModel.
Model OpenCVForUnity.DnnModule.Model.enableWinograd | ( | bool | useWinograd | ) |
IntPtr OpenCVForUnity.DnnModule.Model.getNativeObjAddr | ( | ) |
Given the input
frame, create input blob, run net and return the output blobs
.
frame | The input image. |
outs | Allocated output blobs, which will store results of the computation. |
Model OpenCVForUnity.DnnModule.Model.setInputCrop | ( | bool | crop | ) |
Set flag crop for frame.
crop | Flag which indicates whether image will be cropped after resize or not. |
Set mean value for frame.
mean | Scalar with mean values which are subtracted from channels. |
Model OpenCVForUnity.DnnModule.Model.setInputMean | ( | in(double v0, double v1, double v2, double v3) | mean | ) |
Set mean value for frame.
mean | Scalar with mean values which are subtracted from channels. |
Set mean value for frame.
mean | Scalar with mean values which are subtracted from channels. |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale | ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
in Vec2d | size ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
in Vec2d | size, | ||
in Vec4d | mean, | ||
bool | swapRB ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
in Vec2d | size, | ||
in Vec4d | mean, | ||
bool | swapRB, | ||
bool | crop ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
in(double width, double height) | size ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
in(double width, double height) | size, | ||
in(double v0, double v1, double v2, double v3) | mean ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.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.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.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.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
Size | size ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
Size | size, | ||
Scalar | mean, | ||
bool | swapRB ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
void OpenCVForUnity.DnnModule.Model.setInputParams | ( | double | scale, |
Size | size, | ||
Scalar | mean, | ||
bool | swapRB, | ||
bool | crop ) |
Set preprocessing parameters for frame.
size | New input size. |
mean | Scalar with mean values which are subtracted from channels. |
scale | Multiplier for frame values. |
swapRB | Flag which indicates that swap first and last channels. |
crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
Set scalefactor value for frame.
scale | Multiplier for frame values. |
Model OpenCVForUnity.DnnModule.Model.setInputScale | ( | in(double v0, double v1, double v2, double v3) | scale | ) |
Set scalefactor value for frame.
scale | Multiplier for frame values. |
Set scalefactor value for frame.
scale | Multiplier for frame values. |
Set input size for frame.
size | New input size. |
If shape of the new blob less than 0, then frame size not change.
Model OpenCVForUnity.DnnModule.Model.setInputSize | ( | in(double width, double height) | size | ) |
Set input size for frame.
size | New input size. |
If shape of the new blob less than 0, then frame size not change.
Model OpenCVForUnity.DnnModule.Model.setInputSize | ( | int | width, |
int | height ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
width | New input width. |
height | New input height. |
Set input size for frame.
size | New input size. |
If shape of the new blob less than 0, then frame size not change.
Model OpenCVForUnity.DnnModule.Model.setInputSwapRB | ( | bool | swapRB | ) |
Set flag swapRB for frame.
swapRB | Flag which indicates that swap first and last channels. |
Model OpenCVForUnity.DnnModule.Model.setOutputNames | ( | List< string > | outNames | ) |
Set output names for frame.
outNames | Names for output layers. |
Model OpenCVForUnity.DnnModule.Model.setPreferableBackend | ( | int | backendId | ) |
Model OpenCVForUnity.DnnModule.Model.setPreferableTarget | ( | int | targetId | ) |