def __disable_hot_pixel_correction(self, value=0): hot_pixel = ueye.c_void_p(int(value)) if not ueye.is_HotPixel(self.cam, ueye.IS_HOTPIXEL_DISABLE_CORRECTION, hot_pixel, ueye.sizeof(hot_pixel)) == ueye.IS_SUCCESS: raise RuntimeError("IS_HOTPIXEL_DISABLE_CORRECTION failed") if not ueye.is_HotPixel(self.cam, ueye.IS_HOTPIXEL_DISABLE_SENSOR_CORRECTION, hot_pixel, ueye.sizeof(hot_pixel)) == ueye.IS_SUCCESS: raise RuntimeError("IS_HOTPIXEL_DISABLE_SENSOR_CORRECTION failed")
def main(config_path="/home/oran/Pictures/Settings/default-camera-settings.ini" ): print(config_path) # we need a QApplication, that runs our QT Gui Framework app = PyuEyeQtApp() # a basic qt window view = PyuEyeQtView() view.resize(1920 / 1.5, 1080 / 1.5) view.show() #update_config_gain(update={'red': '0','green' : '0','blue':'0'},set=True) #update_config_exposure(update=70,set=True) # view.user_callback = adjust_manually view.user_callback = print_means # view.user_callback = adjust_manually # camera class to simplify uEye API access cam = Camera() cam.init() # cam.set cam.set_colormode(ueye.IS_CM_BGR8_PACKED) pParam = ueye.wchar_p() pParam.value = config_path ueye.is_ParameterSet(1, ueye.IS_PARAMETERSET_CMD_LOAD_FILE, pParam, 0) # cam.set(cv2.cv.CV_CAP_PROP_EXPOSURE, 10) # cam.__getattribute__('is_CameraStatus') # cam.__setattr__('GetCameraInfo',0) #cam.set_aoi(0,0, 1280, 1024) cam.set_aoi(0, 0, 4912, 3684) cam.alloc() cam.capture_video() ueye._is_GetError ueye.is_Exposure(1, ueye.c_uint(1), ueye.c_void_p(), cbSizeOfParam=ueye.c_int(0)) # ueye.IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MIN = 20 # ueye.IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MAX = 21 # a thread that waits for new images and processes all connected views thread = FrameThread(cam, view) thread.start() # update_config_gain() # cleanup app.exit_connect(thread.stop) app.exec_() thread.stop() thread.join() cam.stop_video() cam.exit()