コード例 #1
0
ファイル: FaceRecognizer.cs プロジェクト: 0sv/opencvsharp
 /// <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;
 }
コード例 #2
0
ファイル: FaceRecognizer.cs プロジェクト: 0sv/opencvsharp
 /// <summary>
 /// Creates instance from cv::Ptr&lt;T&gt; .
 /// 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;
 }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <summary>
        /// Creates instance from cv::Ptr&lt;T&gt; .
        /// 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);
        }