|
OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
|
This class represents high-level API for text recognition networks. More...
Public Member Functions | |
| TextRecognitionModel (Net network) | |
| Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method. | |
| TextRecognitionModel (string model) | |
| Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method. | |
| TextRecognitionModel (string model, string config) | |
| Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method. | |
| string | getDecodeType () |
| Get the decoding method. | |
| List< string > | getVocabulary () |
| Get the vocabulary for recognition. | |
| string | recognize (Mat frame) |
Given the input frame, create input blob, run net and return recognition result. | |
| void | recognize (Mat frame, List< Mat > roiRects, List< string > results) |
Given the input frame, create input blob, run net and return recognition result. | |
| TextRecognitionModel | setDecodeOptsCTCPrefixBeamSearch (int beamSize) |
Set the decoding method options for "CTC-prefix-beam-search" decode usage. | |
| TextRecognitionModel | setDecodeOptsCTCPrefixBeamSearch (int beamSize, int vocPruneSize) |
Set the decoding method options for "CTC-prefix-beam-search" decode usage. | |
| TextRecognitionModel | setDecodeType (string decodeType) |
| Set the decoding method of translating the network output into string. | |
| TextRecognitionModel | setVocabulary (List< string > vocabulary) |
| Set the vocabulary for recognition. | |
Public Member Functions inherited from OpenCVForUnity.DnnModule.Model | |
| 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) |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
| void | Dispose () |
| Releases resources used by this object. | |
| void | ThrowIfDisposed () |
| Throws ObjectDisposedException if this object has been disposed. | |
Static Public Member Functions | |
| static new TextRecognitionModel | __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) |
| Returns the native pointer, or throws CoreModule.CvException if it is zero. | |
Protected Member Functions | |
| override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.DnnModule.Model | |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
| DisposableOpenCVObject () | |
| Initializes a new instance with a zero native pointer and dispose enabled. | |
| DisposableOpenCVObject (bool isEnabledDispose) | |
| Initializes a new instance with a zero native pointer. | |
| DisposableOpenCVObject (IntPtr ptr) | |
| Initializes a new instance with the specified native pointer and dispose enabled. | |
| DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
| Initializes a new instance with the specified native pointer. | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
| DisposableObject () | |
| Initializes a new instance with dispose enabled. | |
| DisposableObject (bool isEnabledDispose) | |
| Initializes a new instance. | |
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] |
This class represents high-level API for text recognition networks.
TextRecognitionModel allows to set params for preprocessing input image. TextRecognitionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return recognition result. For TextRecognitionModel, CRNN-CTC is supported.
| OpenCVForUnity.DnnModule.TextRecognitionModel.TextRecognitionModel | ( | Net | network | ) |
Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method.
| network | Net object |
| OpenCVForUnity.DnnModule.TextRecognitionModel.TextRecognitionModel | ( | string | model, |
| string | config ) |
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method.
| model | Binary file contains trained weights |
| config | Text file contains network configuration |
| OpenCVForUnity.DnnModule.TextRecognitionModel.TextRecognitionModel | ( | string | model | ) |
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method.
| model | Binary file contains trained weights |
| config | Text file contains network configuration |
|
static |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.DnnModule.Model.
| string OpenCVForUnity.DnnModule.TextRecognitionModel.getDecodeType | ( | ) |
Get the decoding method.
| List< string > OpenCVForUnity.DnnModule.TextRecognitionModel.getVocabulary | ( | ) |
Get the vocabulary for recognition.
| string OpenCVForUnity.DnnModule.TextRecognitionModel.recognize | ( | Mat | frame | ) |
Given the input frame, create input blob, run net and return recognition result.
| frame | The input image |
| void OpenCVForUnity.DnnModule.TextRecognitionModel.recognize | ( | Mat | frame, |
| List< Mat > | roiRects, | ||
| List< string > | results ) |
Given the input frame, create input blob, run net and return recognition result.
| frame | The input image |
| roiRects | List of text detection regions of interest (cv::Rect, CV_32SC4). ROIs is be cropped as the network inputs |
| results | A set of text recognition results. |
| TextRecognitionModel OpenCVForUnity.DnnModule.TextRecognitionModel.setDecodeOptsCTCPrefixBeamSearch | ( | int | beamSize | ) |
Set the decoding method options for "CTC-prefix-beam-search" decode usage.
| beamSize | Beam size for search |
| vocPruneSize | Parameter to optimize big vocabulary search, only take top vocPruneSize tokens in each search step, vocPruneSize <= 0 stands for disable this prune. |
| TextRecognitionModel OpenCVForUnity.DnnModule.TextRecognitionModel.setDecodeOptsCTCPrefixBeamSearch | ( | int | beamSize, |
| int | vocPruneSize ) |
Set the decoding method options for "CTC-prefix-beam-search" decode usage.
| beamSize | Beam size for search |
| vocPruneSize | Parameter to optimize big vocabulary search, only take top vocPruneSize tokens in each search step, vocPruneSize <= 0 stands for disable this prune. |
| TextRecognitionModel OpenCVForUnity.DnnModule.TextRecognitionModel.setDecodeType | ( | string | decodeType | ) |
Set the decoding method of translating the network output into string.
| decodeType | The decoding method of translating the network output into string, currently supported type:
|
| TextRecognitionModel OpenCVForUnity.DnnModule.TextRecognitionModel.setVocabulary | ( | List< string > | vocabulary | ) |
Set the vocabulary for recognition.
| vocabulary | the associated vocabulary of the network. |