| 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
)
Public Function Open (
index As Integer,
Optional apiPreference As VideoCaptureAPIs = VideoCaptureAPIs.ANY
) As Boolean
public:
bool Open(
int index,
VideoCaptureAPIs apiPreference = VideoCaptureAPIs::ANY
)
member Open :
index : int *
?apiPreference : VideoCaptureAPIs
(* Defaults:
let _apiPreference = defaultArg apiPreference VideoCaptureAPIs.ANY
*)
-> bool
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