Пример #1
0
        public void Open(string filename)
        {
            Release();

            capture.ptr = IntPtr.Zero;
            asImage     = null;

            string ext = System.IO.Path.GetExtension(filename);

            // if the extension of the filename is not AVI, try opening as an image.
            if (ext.ToUpper().CompareTo(".AVI") != 0)
            {
                asImage = new CVImage(filename);
            }
            else
            {
                capture = PInvoke.cvCreateFileCapture(filename);
                CVUtils.CheckLastError();
                if (capture.ptr == IntPtr.Zero)
                {
                    throw new CVException(
                              string.Format("Unable to open file	'{0}' for capture.", filename));
                }
            }

            this.filename = filename;
        }
Пример #2
0
 public CVCapture(int cameraId)
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture(cameraId);
     CVUtils.CheckLastError();
 }
Пример #3
0
 public CVCapture()
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture((int)CV_CAP.CV_CAP_ANY);
     CVUtils.CheckLastError();
 }
Пример #4
0
        public void Open(string filename)
        {
            Release();

            capture.ptr = IntPtr.Zero;
            asImage = null;

            string ext = System.IO.Path.GetExtension(filename);

            // if the extension of the filename is not AVI, try opening as an image.
            if (ext.ToUpper().CompareTo(".AVI") != 0)
            {
                asImage = new CVImage(filename);
            }
            else
            {
                capture = PInvoke.cvCreateFileCapture(filename);
                CVUtils.CheckLastError();
                if (capture.ptr == IntPtr.Zero)
                {
                    throw new CVException(
                        string.Format("Unable to open file	'{0}' for capture.", filename));
                }
            }

            this.filename = filename;
        }
Пример #5
0
 public static extern __IplImagePtr cvQueryFrame(__CvCapturePtr capture);
Пример #6
0
 public static extern double cvGetCaptureProperty(__CvCapturePtr capture, int property_id);
Пример #7
0
 public static extern int cvSetCaptureProperty(__CvCapturePtr capture, int property_id, double value);
Пример #8
0
 public static extern void cvReleaseCapture(ref __CvCapturePtr capture);
Пример #9
0
 public CVCapture(int cameraId)
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture(cameraId);
     CVUtils.CheckLastError();
 }
Пример #10
0
 public CVCapture()
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture((int)CV_CAP.CV_CAP_ANY);
     CVUtils.CheckLastError();
 }