/// <summary> /// Creates instance from raw pointer T* /// </summary> /// <param name="ptr"></param> internal static DenseOpticalFlowImpl FromRawPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) throw new OpenCvSharpException("Invalid DenseOpticalFlow pointer"); var obj = new DenseOpticalFlowImpl { detectorPtr = null, ptr = ptr }; return obj; }
/// <summary> /// Creates instance from cv::Ptr<T> . /// ptr is disposed when the wrapper disposes. /// </summary> /// <param name="ptr"></param> internal static DenseOpticalFlowImpl FromPtr(IntPtr ptr) { if (ptr == IntPtr.Zero) { throw new OpenCvSharpException("Invalid DenseOpticalFlow pointer"); } var ptrObj = new Ptr <DenseOpticalFlow>(ptr); var obj = new DenseOpticalFlowImpl { detectorPtr = ptrObj, ptr = ptrObj.Get() }; return(obj); }
/// <summary> /// /// </summary> /// <returns></returns> public static DenseOpticalFlow CreateOptFlow_DualTVL1() { IntPtr ptr = NativeMethods.video_createOptFlow_DualTVL1(); return(DenseOpticalFlowImpl.FromPtr(ptr)); }