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; }
public CVCapture(int cameraId) { asImage = null; capture = PInvoke.cvCreateCameraCapture(cameraId); CVUtils.CheckLastError(); }
public CVCapture() { asImage = null; capture = PInvoke.cvCreateCameraCapture((int)CV_CAP.CV_CAP_ANY); CVUtils.CheckLastError(); }
public static extern __IplImagePtr cvQueryFrame(__CvCapturePtr capture);
public static extern double cvGetCaptureProperty(__CvCapturePtr capture, int property_id);
public static extern int cvSetCaptureProperty(__CvCapturePtr capture, int property_id, double value);
public static extern void cvReleaseCapture(ref __CvCapturePtr capture);