using OpenCVForUnity.CoreModule; using OpenCVForUnity.UtilsModule; using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace OpenCVForUnity.FaceModule { // C++: class FacemarkTrain /** * Abstract base class for trainable facemark models * * To utilize this API in your program, please take a look at the REF: tutorial_table_of_content_facemark * ### Description * * The AAM and LBF facemark models in OpenCV are derived from the abstract base class FacemarkTrain, which * provides a unified access to those facemark algorithms in OpenCV. * * Here is an example on how to declare facemark algorithm: * * // Using Facemark in your code: * Ptr<Facemark> facemark = FacemarkLBF::create(); * * * * The typical pipeline for facemark detection is listed as follows: * */ public class FacemarkTrain : Facemark { protected override void Dispose(bool disposing) { try { if (disposing) { } if (IsEnabledDispose) { if (nativeObj != IntPtr.Zero) face_FacemarkTrain_delete(nativeObj); nativeObj = IntPtr.Zero; } } finally { base.Dispose(disposing); } } protected internal FacemarkTrain(IntPtr addr) : base(addr) { } // internal usage only public static new FacemarkTrain __fromPtr__(IntPtr addr) { return new FacemarkTrain(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 face_FacemarkTrain_delete(IntPtr nativeObj); } }