Ejemplo n.º 1
0
 public bool InitCamera()
 {
     try
     {
         using (var cap = Cv.CreateCameraCapture(CameraNumber)) // カメラのキャプチャ
         { }
         videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
         videoDevice  = new VideoCaptureDevice2(videoDevices[CameraNumber].MonikerString);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 public void InitCamera()
 {
     try
     {
         using (var cap = Cv.CreateCameraCapture(CameraNumber)) // カメラのキャプチャ
         { }
         CamState     = true;
         videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
         videoDevice  = new VideoCaptureDevice2(videoDevices[CameraNumber].MonikerString);
     }
     catch
     {
         CamState = false;
     }
 }