def __init__(self): self._device = IC.TIS_CAM() print('Available devices:', IC.TIS_CAM().GetDevices()) print('Open device {}'.format(self.camera_model)) self._device.open(self.camera_model) print('Available formats:', self._device.GetVideoFormats()) self._device.SetVideoFormat(self.camera_format) ### Disable auto settings self._device.SetPropertySwitch('Gain', 'Auto', 0) self._device.enableCameraAutoProperty(4, 0) # Disable auto exposure (for REAL) ### Enable frame acquisition self._device.StartLive(0)
def __init__(self): self.Camera = IC.TIS_CAM() #self.Camera.ShowDeviceSelectionDialog() print("Open Camera: ", self.Camera.openVideoCaptureDevice( "DMK 33UX174")) # Hier richtige Kamera einfügen!! print("VideoFormat: ", self.Camera.SetVideoFormat("Y800 (1920x1200)") ) # Format der Kamera auf Y16 setzen mit richtiger Auflösung!! self.Camera.SetFormat(IC.SinkFormats.Y800) # No Return Value print("Continuous Mode OFF: ", self.Camera.SetContinuousMode(0)) self.Camera.StartLive(0) print("Gain Auto off: ", self.Camera.SetPropertySwitch("Gain", "Auto", 0)) # Gain Manuell einstellen print("Gain Value set: ", self.Camera.SetPropertyValue("Gain", "Value", 280)) # Gain auf 0 print("Brightness Value Set:", self.Camera.SetPropertyValue( "Brightness", "Value", 240)) # Brightness auch auf 0 (=BlackLevel) print("Exposure Auto off: ", self.Camera.SetPropertySwitch("Exposure", "Auto", 0)) print("Exposure Value set: ", self.Camera.SetPropertyAbsoluteValue( "Exposure", "Value", 0.01)) #Exposure time in seconds self.maxIntensity = 65536 self.minIntensity = 0 # Für Callback: self.ImProc = ImageProcessing() self.Callbackfunc = IC.TIS_GrabberDLL.FRAMEREADYCALLBACK(self.Callback) self.ImageDescription = CallbackUserdata() print( "set Callback :", self.Camera.SetFrameReadyCallback(self.Callbackfunc, self.ImageDescription)) self.Imageformat = self.Camera.GetImageDescription()[:3] self.ImageDescription.width = self.Imageformat[0] self.ImageDescription.height = self.Imageformat[1] self.ImageDescription.iBitsPerPixel = self.Imageformat[2] // 8 self.ImageDescription.buffer_size = self.ImageDescription.width * self.ImageDescription.height * self.ImageDescription.iBitsPerPixel print("ImageDescription height:", self.ImageDescription.height) print("ImageDescription width :", self.ImageDescription.width) print("ImageDescription BpP :", self.ImageDescription.iBitsPerPixel) self.Camera.StopLive()
DBA_Collection = [] colors = [] ############################################################################### ############################################################################### # Camera setup resolution = '1920x1080' def_exp, def_gain = 0.01, 480 # exp in units of sec, gain in units of 1/10 dB # # Access CCD data and grab initial frame # Camera = IC.TIS_CAM() # Camera.ShowDeviceSelectionDialog() ############################################################################### # Access CCD data to get initial image Camera = IC.TIS_CAM() Camera.ShowDeviceSelectionDialog() if Camera.IsDevValid() == 1: # Set a video format temp = "RGB32 (" + resolution + ")" Camera.SetVideoFormat(temp) del temp Camera.SetPropertyAbsoluteValue("Exposure", "Value", def_exp) Camera.SetPropertyValue("Gain", "Value", def_gain) # Communicate with camera Camera.StartLive(1) # Initial image snap
def __init__(self): self.cam = IC.TIS_CAM()