Click or drag to resize

VideoCaptureOpen Method (Int32, VideoCaptureAPIs)

Opens a camera for video capturing

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public bool Open(
	int index,
	VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY
)

Parameters

index
Type: SystemInt32
id of the video capturing device to open. To open default camera using default backend just pass 0. (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
apiPreference (Optional)
Type: OpenCvSharpVideoCaptureAPIs
preferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.

Return Value

Type: Boolean
`true` if the file has been successfully opened
See Also