Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 public CVCapture(int cameraId)
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture(cameraId);
     CVUtils.CheckLastError();
 }
Ejemplo n.º 3
0
 public CVCapture()
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture((int)CV_CAP.CV_CAP_ANY);
     CVUtils.CheckLastError();
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
 public static extern __IplImagePtr cvQueryFrame(__CvCapturePtr capture);
Ejemplo n.º 6
0
 public static extern double cvGetCaptureProperty(__CvCapturePtr capture, int property_id);
Ejemplo n.º 7
0
 public static extern int cvSetCaptureProperty(__CvCapturePtr capture, int property_id, double value);
Ejemplo n.º 8
0
 public static extern void cvReleaseCapture(ref __CvCapturePtr capture);
Ejemplo n.º 9
0
 public CVCapture(int cameraId)
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture(cameraId);
     CVUtils.CheckLastError();
 }
Ejemplo n.º 10
0
 public CVCapture()
 {
     asImage = null;
     capture = PInvoke.cvCreateCameraCapture((int)CV_CAP.CV_CAP_ANY);
     CVUtils.CheckLastError();
 }