/// <summary> /// Creates instance from raw pointer T* /// </summary> /// <param name="ptr"></param> internal static FaceRecognizer FromRawPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) throw new OpenCvSharpException("Invalid FaceRecognizer pointer"); var detector = new FaceRecognizer { recognizerPtr = null, ptr = ptr }; return detector; }
/// <summary> /// Creates instance from cv::Ptr<T> . /// ptr is disposed when the wrapper disposes. /// </summary> /// <param name="ptr"></param> internal static FaceRecognizer FromPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) throw new OpenCvSharpException("Invalid cv::Ptr<FaceRecognizer> pointer"); var ptrObj = new Ptr<FaceRecognizer>(ptr); var detector = new FaceRecognizer { recognizerPtr = ptrObj, ptr = ptrObj.Obj }; return detector; }
/// <summary> /// Creates instance from raw pointer T* /// </summary> /// <param name="ptr"></param> internal static FaceRecognizer FromRawPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) { throw new OpenCvSharpException("Invalid FaceRecognizer pointer"); } var detector = new FaceRecognizer { recognizerPtr = null, ptr = ptr }; return(detector); }
/// <summary> /// Creates instance from cv::Ptr<T> . /// ptr is disposed when the wrapper disposes. /// </summary> /// <param name="ptr"></param> internal static FaceRecognizer FromPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) { throw new OpenCvSharpException("Invalid cv::Ptr<FaceRecognizer> pointer"); } var ptrObj = new Ptr <FaceRecognizer>(ptr); var detector = new FaceRecognizer { recognizerPtr = ptrObj, ptr = ptrObj.Obj }; return(detector); }