C# Класс OpenCvSharp.VideoCapture

Video capturing class
Наследование: OpenCvSharp.DisposableCvObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Clean up any resources being used.

VideoCapture ( IntPtr ptr ) : System

Initializes from native pointer

Описание методов

Dispose() защищенный Метод

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. ///
Результат void

FromCamera() публичный статический Метод

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
Результат VideoCapture

FromCamera() публичный статический Метод

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.
Результат VideoCapture

FromCamera() публичный статический Метод

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.
Результат VideoCapture

FromFile() публичный статический Метод

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.
Результат VideoCapture

Get() публичный Метод

Retrieves the specified property of camera or video file.
public Get ( CaptureProperty propertyId ) : double
propertyId CaptureProperty property identifier.
Результат double

Get() публичный Метод

Retrieves the specified property of camera or video file.
public Get ( int propertyId ) : double
propertyId int property identifier.
Результат double

Grab() публичный Метод

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
Результат bool

IsOpened() публичный Метод

Returns true if video capturing has been initialized already.
public IsOpened ( ) : bool
Результат bool

Open() публичный Метод

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
Результат void

Open() публичный Метод

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.
Результат void

Open() публичный Метод

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.
Результат void

Open() публичный Метод

Opens the specified video file
public Open ( string fileName ) : void
fileName string
Результат void

Read() публичный Метод

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
Результат bool

Release() публичный Метод

Closes video file or capturing device.
public Release ( ) : void
Результат void

Retrieve() публичный Метод

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
Результат bool

Retrieve() публичный Метод

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
Результат bool

RetrieveMat() публичный Метод

Decodes and returns the grabbed video frame.
public RetrieveMat ( ) : OpenCvSharp.Mat
Результат OpenCvSharp.Mat

Set() публичный Метод

Sets the specified property of video capturing.
public Set ( CaptureProperty propertyId, double value ) : int
propertyId CaptureProperty property identifier.
value double value of the property.
Результат int

Set() публичный Метод

Sets the specified property of video capturing.
public Set ( int propertyId, double value ) : int
propertyId int property identifier.
value double value of the property.
Результат int

VideoCapture() публичный Метод

Initializes empty capture. To use this, you should call Open.
public VideoCapture ( ) : System
Результат System

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).
public VideoCapture ( CaptureDevice device ) : System
device CaptureDevice Device type
Результат System

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).
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.
Результат System

VideoCapture() защищенный Метод

Initializes from native pointer
protected VideoCapture ( IntPtr ptr ) : System
ptr IntPtr CvCapture*
Результат System

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).
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.
Результат System

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.
public VideoCapture ( string fileName ) : System
fileName string Name of the video file.
Результат System