Esempio n. 1
0
 /// <summary>
 /// Release all the unmanaged memory associated with this framesource
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         SuperresInvoke.cvSuperresFrameSourceRelease(ref _ptr);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Release all the unmanaged memory associated to this object
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         SuperresInvoke.cvSuperResolutionRelease(ref _ptr);
     }
 }
Esempio n. 3
0
 /// <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;
     }
 }
Esempio n. 4
0
        /// <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;
        }
Esempio n. 5
0
 /// <summary>
 /// Get the next frame
 /// </summary>
 public void NextFrame(IOutputArray frame)
 {
     using (OutputArray oaFrame = frame.GetOutputArray())
         SuperresInvoke.cvSuperresFrameSourceNextFrame(_frameSourcePtr, oaFrame);
 }
Esempio n. 6
0
 ///<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;
 }
Esempio n. 7
0
 /// <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);
 }
Esempio n. 8
0
 /// <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;
 }