com.soviby.unity.ui.ugui-to.../Assets/Plugins/org/opencv_contrib/text/OCRBeamSearchDecoder_ClassifierCallback.cs
2024-12-10 02:39:04 +08:00

71 lines
2.1 KiB
C#

#if !UNITY_WSA_10_0
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.UtilsModule;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace OpenCVForUnity.TextModule
{
// C++: class ClassifierCallback
/**
* Callback with the character classifier is made a class.
*
* This way it hides the feature extractor and the classifier itself, so developers can write
* their own OCR code.
*
* The default character classifier and feature extractor can be loaded using the utility function
* loadOCRBeamSearchClassifierCNN with all its parameters provided in
* <https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/OCRBeamSearch_CNN_model_data.xml.gz>.
*/
public class OCRBeamSearchDecoder_ClassifierCallback : DisposableOpenCVObject
{
protected override void Dispose(bool disposing)
{
try
{
if (disposing)
{
}
if (IsEnabledDispose)
{
if (nativeObj != IntPtr.Zero)
text_OCRBeamSearchDecoder_1ClassifierCallback_delete(nativeObj);
nativeObj = IntPtr.Zero;
}
}
finally
{
base.Dispose(disposing);
}
}
protected internal OCRBeamSearchDecoder_ClassifierCallback(IntPtr addr) : base(addr) { }
public IntPtr getNativeObjAddr() { return nativeObj; }
// internal usage only
public static OCRBeamSearchDecoder_ClassifierCallback __fromPtr__(IntPtr addr) { return new OCRBeamSearchDecoder_ClassifierCallback(addr); }
#if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
const string LIBNAME = "__Internal";
#else
const string LIBNAME = "opencvforunity";
#endif
// native support for java finalize()
[DllImport(LIBNAME)]
private static extern void text_OCRBeamSearchDecoder_1ClassifierCallback_delete(IntPtr nativeObj);
}
}
#endif