/// <summary> ///Initialize a point Grey Camera, it take the first that it detect if their is more than one. ///Give the default setting. /// </summary> /// <exception cref="NoCameraDetectedException">Thrown if no camera is detected.</exception> public PtGreyCamera() { using ManagedBusManager busMgr = new ManagedBusManager(); setting = new PtGreyCameraSetting(); uint numCameras = busMgr.GetNumOfCameras(); if (numCameras == 0) { throw new NoCameraDetectedException { Source = "PointGrey" }; } ManagedPGRGuid guid = busMgr.GetCameraFromIndex(0); //If there is more than 1 camera, we take the first one cam = new ManagedCamera(); cam.Connect(guid); SetProp(); }
/// <summary> ///Initialize a point Grey Camera, it take the first that it detect if their is more than one. ///Utilize the given settings to initialize the camera. /// </summary> /// <exception cref="NoCameraDetectedException">Thrown if no camera is detected.</exception> /// <param name="setting">Setting used for the camera</param> public PtGreyCamera(PtGreyCameraSetting setting) { using ManagedBusManager busMgr = new ManagedBusManager(); this.setting = setting; uint numCameras = busMgr.GetNumOfCameras(); Console.WriteLine(numCameras); // Finish if there are no cameras if (numCameras == 0) { throw new NoCameraDetectedException(); } ManagedPGRGuid guid = busMgr.GetCameraFromIndex(0); //If there is more than 1 camera, we take the first one cam = new ManagedCamera(); cam.Connect(guid); SetProp(); }
public void ChangeSetting(PtGreyCameraSetting setting) { this.setting = setting; SetProp(); }