/// <summary> /// Release all the unmanaged memory associated with this framesource /// </summary> protected override void DisposeObject() { if (_ptr != IntPtr.Zero) { SuperresInvoke.cvSuperresFrameSourceRelease(ref _ptr); } }
/// <summary> /// Release all the unmanaged memory associated to this object /// </summary> protected override void DisposeObject() { if (_ptr != IntPtr.Zero) { SuperresInvoke.cvSuperResolutionRelease(ref _ptr); } }
/// <summary> /// Release all the unmanaged memory associated to this object /// </summary> protected override void DisposeObject() { if (_sharedPtr != IntPtr.Zero) { SuperresInvoke.cveSuperResolutionRelease(ref _sharedPtr); _frameSourcePtr = IntPtr.Zero; _ptr = IntPtr.Zero; } }
/// <summary> /// Create video frame source from video file /// </summary> /// <param name="fileName">The name of the file</param> /// <param name="tryUseGpu">If true, it will try to create video frame source using gpu</param> public FrameSource(String fileName, bool tryUseGpu) { using (CvString s = new CvString(fileName)) if (tryUseGpu) { try { _ptr = SuperresInvoke.cvSuperresCreateFrameSourceVideo(s, true); } catch { _ptr = SuperresInvoke.cvSuperresCreateFrameSourceVideo(s, false); } } else { _ptr = SuperresInvoke.cvSuperresCreateFrameSourceVideo(s, false); } _frameSourcePtr = _ptr; }
/// <summary> /// Get the next frame /// </summary> public void NextFrame(IOutputArray frame) { using (OutputArray oaFrame = frame.GetOutputArray()) SuperresInvoke.cvSuperresFrameSourceNextFrame(_frameSourcePtr, oaFrame); }
///<summary> Create a framesource using the specific camera</summary> ///<param name="camIndex"> The index of the camera to create capture from, starting from 0</param> public FrameSource(int camIndex) { _ptr = SuperresInvoke.cvSuperresCreateFrameSourceCamera(camIndex); _frameSourcePtr = _ptr; }
/// <summary> /// Create a super resolution solver for the given frameSource /// </summary> /// <param name="type">The type of optical flow algorithm to use</param> /// <param name="frameSource">The frameSource</param> public SuperResolution(SuperResolution.OpticalFlowType type, FrameSource frameSource) : base() { _ptr = SuperresInvoke.cvSuperResolutionCreate(type, frameSource, ref _frameSourcePtr); }
/// <summary> Create a framesource using the specific camera</summary> /// <param name="camIndex"> The index of the camera to create capture from, starting from 0</param> public FrameSource(int camIndex) { _ptr = SuperresInvoke.cveSuperresCreateFrameSourceCamera(camIndex, ref _sharedPtr); //_frameSourcePtr = _ptr; }