Table of Contents

Method FromCamera

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

FromCamera(int, VideoCaptureAPIs)

Opens a camera for video capturing

public static VideoCapture FromCamera(int index, VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY)

Parameters

index int

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 VideoCaptureAPIs

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.

Returns

VideoCapture