def return_devices(self, variable): cam_num = ueye.INT() ueye.is_GetNumberOfCameras(cam_num) for i in range(cam_num.value): hid = ueye.HIDS(cam_num) s = ueye.is_InitCamera(self.hid, self.hwnd) r = ueye.is_GetSensorInfo(self.hid, self.sinfo) sname = self.sinfo.strSensorName.decode('UTF-8') self.detected_devices[sname] = i + 1 variable.insert('end', sname) ueye.is_ExitCamera(self.hid)
def connect_device(self, name): """ Connect to camera specified by name. """ cam_num = self.detected_devices[name] cam_num = ueye.INT(cam_num) ueye.is_GetNumberOfCameras(cam_num) s = ueye.is_InitCamera(self.hid, self.hwnd) r = ueye.is_GetSensorInfo(self.hid, self.sinfo) self.configure_device() self.camera = True
def connect_device(self, variable): if not variable.curselection(): messagebox.showinfo(title='Error', message='No' + 'device selected!') return index = variable.curselection()[0] name = variable.get(index) cam_num = self.detected_devices[name] cam_num = ueye.INT(cam_num) ueye.is_GetNumberOfCameras(cam_num) s = ueye.is_InitCamera(self.hid, self.hwnd) r = ueye.is_GetSensorInfo(self.hid, self.sinfo) self.configure_device() self.configure_graph() self.camera = True
def return_devices(self): """ Return list of connected camera. """ varOut = [] cam_num = ueye.INT() ueye.is_GetNumberOfCameras(cam_num) for i in range(cam_num.value): hid = ueye.HIDS(cam_num) s = ueye.is_InitCamera(self.hid, self.hwnd) r = ueye.is_GetSensorInfo(self.hid, self.sinfo) sname = self.sinfo.strSensorName.decode('UTF-8') self.detected_devices[sname] = i+1 varOut.append(sname) ueye.is_ExitCamera(self.hid) return varOut
def __init__(self, serial): nc=ueye.c_int() self.status=True self._bgImage=0 self.bg=0 if ueye.is_GetNumberOfCameras(nc): _logger.error("Error Wrong number of cameras") return lst=ueye.UEYE_CAMERA_LIST((ueye.UEYE_CAMERA_INFO*nc.value)) lst.dwCount=nc.value ueye.is_GetCameraList(lst) index=None for i in range(nc.value): _logger.info("Got the following ccd: %s"%lst.uci[i].SerNo) if (lst.uci[i].SerNo==serial): index=i break if index is None: _logger.error("SerNo %s not found."%serial) return if lst.uci[index].dwStatus: _logger.error("Camera %d is already busy."%index) self.hcam=ueye.HIDS(index) if ueye.is_InitCamera(self.hcam, None): _logger.error("Error inializating camera.") self.status=True return self.bufCount=0 self.bitsPixel=8 self.Imgs=None self.LastSeqBuf1=ueye.c_mem_p(1) self.acq=False self.grabbingCB=dummy self.grabbing=False self.setColorMode(ueye.IS_CM_MONO8) if self.LoadSettings(): _logger.error("error laoding camera settings") sys.exit() self.status=False
def Number_Of_Cameras(): """gets number of availible uEye Cameras""" number = ueye.int(0) ueye.is_GetNumberOfCameras(number) return number.value