C# Class OpenCvSharp.VideoCapture

Video capturing class
Inheritance: OpenCvSharp.DisposableCvObject
Afficher le fichier Open project: shimat/opencvsharp Class Usage Examples

Méthodes publiques

Méthode Description
FromCamera ( CaptureDevice device ) : VideoCapture

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

FromCamera ( CaptureDevice device, int index ) : VideoCapture

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

FromCamera ( int index ) : VideoCapture

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

FromFile ( string fileName ) : VideoCapture

Allocates and initialized the CvCapture structure for reading the video stream from the specified file. After the allocated structure is not used any more it should be released by cvReleaseCapture function.

Get ( CaptureProperty propertyId ) : double

Retrieves the specified property of camera or video file.

Get ( int propertyId ) : double

Retrieves the specified property of camera or video file.

Grab ( ) : bool

Grabs the frame from camera or file. The grabbed frame is stored internally. The purpose of this function is to grab frame fast that is important for syncronization in case of reading from several cameras simultaneously. The grabbed frames are not exposed because they may be stored in compressed format (as defined by camera/driver). To retrieve the grabbed frame, cvRetrieveFrame should be used.

IsOpened ( ) : bool

Returns true if video capturing has been initialized already.

Open ( CaptureDevice device ) : void

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

Open ( CaptureDevice device, int index ) : void

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

Open ( int index ) : void

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

Open ( string fileName ) : void

Opens the specified video file

Read ( OpenCvSharp.Mat image ) : bool

Grabs a frame from camera or video file, decompresses and returns it. This function is just a combination of cvGrabFrame and cvRetrieveFrame in one call. The returned image should not be released or modified by user.

Release ( ) : void

Closes video file or capturing device.

Retrieve ( OpenCvSharp.Mat image, CameraChannels streamIdx = CameraChannels.OpenNI_DepthMap ) : bool

Returns the pointer to the image grabbed with cvGrabFrame function. The returned image should not be released or modified by user.

Retrieve ( OpenCvSharp.Mat image, int channel ) : bool

Decodes and returns the grabbed video frame.

RetrieveMat ( ) : OpenCvSharp.Mat

Decodes and returns the grabbed video frame.

Set ( CaptureProperty propertyId, double value ) : int

Sets the specified property of video capturing.

Set ( int propertyId, double value ) : int

Sets the specified property of video capturing.

VideoCapture ( ) : System

Initializes empty capture. To use this, you should call Open.

VideoCapture ( CaptureDevice device ) : System

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

VideoCapture ( CaptureDevice device, int index ) : System

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

VideoCapture ( int index ) : System

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).

VideoCapture ( string fileName ) : System

Allocates and initialized the CvCapture structure for reading the video stream from the specified file. After the allocated structure is not used any more it should be released by cvReleaseCapture function.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

VideoCapture ( IntPtr ptr ) : System

Initializes from native pointer

Method Details

Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
Résultat void

FromCamera() public static méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public static FromCamera ( CaptureDevice device ) : VideoCapture
device CaptureDevice Device type
Résultat VideoCapture

FromCamera() public static méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public static FromCamera ( CaptureDevice device, int index ) : VideoCapture
device CaptureDevice Device type
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat VideoCapture

FromCamera() public static méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public static FromCamera ( int index ) : VideoCapture
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat VideoCapture

FromFile() public static méthode

Allocates and initialized the CvCapture structure for reading the video stream from the specified file. After the allocated structure is not used any more it should be released by cvReleaseCapture function.
public static FromFile ( string fileName ) : VideoCapture
fileName string Name of the video file.
Résultat VideoCapture

Get() public méthode

Retrieves the specified property of camera or video file.
public Get ( CaptureProperty propertyId ) : double
propertyId CaptureProperty property identifier.
Résultat double

Get() public méthode

Retrieves the specified property of camera or video file.
public Get ( int propertyId ) : double
propertyId int property identifier.
Résultat double

Grab() public méthode

Grabs the frame from camera or file. The grabbed frame is stored internally. The purpose of this function is to grab frame fast that is important for syncronization in case of reading from several cameras simultaneously. The grabbed frames are not exposed because they may be stored in compressed format (as defined by camera/driver). To retrieve the grabbed frame, cvRetrieveFrame should be used.
public Grab ( ) : bool
Résultat bool

IsOpened() public méthode

Returns true if video capturing has been initialized already.
public IsOpened ( ) : bool
Résultat bool

Open() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public Open ( CaptureDevice device ) : void
device CaptureDevice Device type
Résultat void

Open() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public Open ( CaptureDevice device, int index ) : void
device CaptureDevice Device type
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat void

Open() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public Open ( int index ) : void
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat void

Open() public méthode

Opens the specified video file
public Open ( string fileName ) : void
fileName string
Résultat void

Read() public méthode

Grabs a frame from camera or video file, decompresses and returns it. This function is just a combination of cvGrabFrame and cvRetrieveFrame in one call. The returned image should not be released or modified by user.
public Read ( OpenCvSharp.Mat image ) : bool
image OpenCvSharp.Mat
Résultat bool

Release() public méthode

Closes video file or capturing device.
public Release ( ) : void
Résultat void

Retrieve() public méthode

Returns the pointer to the image grabbed with cvGrabFrame function. The returned image should not be released or modified by user.
public Retrieve ( OpenCvSharp.Mat image, CameraChannels streamIdx = CameraChannels.OpenNI_DepthMap ) : bool
image OpenCvSharp.Mat
streamIdx CameraChannels non-zero streamIdx is only valid for multi-head camera live streams
Résultat bool

Retrieve() public méthode

Decodes and returns the grabbed video frame.
public Retrieve ( OpenCvSharp.Mat image, int channel ) : bool
image OpenCvSharp.Mat
channel int non-zero streamIdx is only valid for multi-head camera live streams
Résultat bool

RetrieveMat() public méthode

Decodes and returns the grabbed video frame.
public RetrieveMat ( ) : OpenCvSharp.Mat
Résultat OpenCvSharp.Mat

Set() public méthode

Sets the specified property of video capturing.
public Set ( CaptureProperty propertyId, double value ) : int
propertyId CaptureProperty property identifier.
value double value of the property.
Résultat int

Set() public méthode

Sets the specified property of video capturing.
public Set ( int propertyId, double value ) : int
propertyId int property identifier.
value double value of the property.
Résultat int

VideoCapture() public méthode

Initializes empty capture. To use this, you should call Open.
public VideoCapture ( ) : System
Résultat System

VideoCapture() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public VideoCapture ( CaptureDevice device ) : System
device CaptureDevice Device type
Résultat System

VideoCapture() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public VideoCapture ( CaptureDevice device, int index ) : System
device CaptureDevice Device type
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat System

VideoCapture() protected méthode

Initializes from native pointer
protected VideoCapture ( IntPtr ptr ) : System
ptr IntPtr CvCapture*
Résultat System

VideoCapture() public méthode

Allocates and initialized the CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
public VideoCapture ( int index ) : System
index int Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed.
Résultat System

VideoCapture() public méthode

Allocates and initialized the CvCapture structure for reading the video stream from the specified file. After the allocated structure is not used any more it should be released by cvReleaseCapture function.
public VideoCapture ( string fileName ) : System
fileName string Name of the video file.
Résultat System