def init(self): """ Descript. : """ self.force_update = False self.cam_type = self.getProperty("type").lower() self.cam_address = self.getProperty("address") try: self.cam_mirror = eval(self.getProperty("mirror")) except: pass if self.cam_type == 'prosilica': from Lima import Prosilica self.camera = Prosilica.Camera(self.cam_address) self.interface = Prosilica.Interface(self.camera) self.control = Core.CtControl(self.interface) self.video = self.control.video() self.image_dimensions = list(self.camera.getMaxWidthHeight()) self.setIsReady(True) if self.image_polling is None: self.video.startLive() self.change_owner() self.image_polling = gevent.spawn(self.do_image_polling, self.getProperty("interval")/1000.0) print 111 print self.getProperty("interval")
def init(self): """ Descript. : """ self.force_update = False self.scaling = pixmaptools.LUT.Scaling() self.cam_type = self.getProperty("type").lower() self.cam_address = self.getProperty("address") self.cam_mirror = eval(self.getProperty("mirror")) if self.cam_type == 'prosilica': from Lima import Prosilica self.camera = Prosilica.Camera(self.cam_address) self.interface = Prosilica.Interface(self.camera) if self.cam_type == 'ueye': from Lima import Ueye self.camera = Ueye.Camera(self.cam_address) self.interface = Ueye.Interface(self.camera) try: self.control = Core.CtControl(self.interface) self.video = self.control.video() self.image_dimensions = list(self.camera.getMaxWidthHeight()) except KeyError: logging.getLogger().warning("Lima video not initialized.") self.setImageTypeFromXml('imageType') self.setIsReady(True) if self.image_polling is None: self.video.startLive() self.change_owner() self.image_polling = gevent.spawn( self.do_image_polling, self.getProperty("interval") / 1000.0)
def _init(self): self.scalingType = None self.forceUpdate = False self.camMirror = None self.__brightnessExists = False self.__contrastExists = False self.__gainExists = False self.__gammaExists = False self.camType = self.getProperty("type").lower() self.camAddress = self.getProperty("address") #self.camMirror = eval(self.getProperty("mirror_hor_ver")) if self.camType == 'prosilica': from Lima import Prosilica self.camera = Prosilica.Camera(self.camAddress) self.interface = Prosilica.Interface(self.camera) if self.camType == 'simulation': from Lima import Simulator self.camera = Simulator.Camera() self.interface = Simulator.Interface(self.camera) try: self.control = Core.CtControl(self.interface) self.video = self.control.video() self.video.setExposure(self.getProperty("interval") / 1000.0) self.__imageDimensions = self.camera.getMaxWidthHeight() except KeyError: logging.getLogger().warning( '%s: not initialized. Check camera settings', self.name()) self.setImageTypeFromXml('imagetype') self.setIsReady(True)
def get_control(cam_ip_address = "0",**keys) : print ("cam_ip_address",cam_ip_address) global _ProsilicaCam global _ProsilicaInterface if _ProsilicaCam is None: _ProsilicaCam = ProsilicaAcq.Camera(cam_ip_address) _ProsilicaInterface = ProsilicaAcq.Interface(_ProsilicaCam) return Core.CtControl(_ProsilicaInterface)
def init(self): self.cam_address = self.getProperty("address") self.cam_type = self.getProperty("type").lower() if self.cam_type == 'prosilica': self.camera = Prosilica.Camera(self.cam_address) self.interface = Prosilica.Interface(self.camera) elif self.cam_type == 'basler': logging.getLogger("HWR").info("Connecting to camera with address %s" % self.cam_address) self.camera = Basler.Camera(self.cam_address) self.interface = Basler.Interface(self.camera) self.control = Core.CtControl(self.interface) self.video = self.control.video() GenericVideoDevice.init(self)
def init(self): self.cam_address = self.getProperty("address") self.cam_type = self.getProperty("type").lower() if self.cam_type == "prosilica": self.camera = Prosilica.Camera(self.cam_address, self.master_mode, False) self.interface = Prosilica.Interface(self.camera) elif self.cam_type == "basler": logging.getLogger("HWR").info( "Connecting to camera with address %s" % self.cam_address) self.camera = Basler.Camera(self.cam_address) self.interface = Basler.Interface(self.camera) self.control = Core.CtControl(self.interface) self.video = self.control.video() AbstractVideoDevice.init(self)