示例#1
0
    def SetIntegTime(self, integ_time):
        """
        Sets the exposure time in s. Currently assumes that we will want to go as fast as possible at this exposure time
        and also sets the frame rate to match.

        Parameters
        ----------
        iTime : float
            Exposure time in s

        Returns
        -------
        None

        See Also
        --------
        GetIntegTime
        """
        new_fps = ueye.double()
        self.check_success(
            ueye.is_SetFrameRate(self.h, 1 / integ_time, new_fps))
        # by default, set exposure time to max for this frame rate
        # "If 0 is passed, the exposure time is set to the maximum value of 1/frame rate."
        exposure = ueye.double(0)
        self.check_success(
            ueye.is_Exposure(self.h, ueye.IS_EXPOSURE_CMD_SET_EXPOSURE,
                             exposure, ueye.sizeof(exposure)))
示例#2
0
    def set_fps(self, fps):
        """
        Set the fps.

        Returns
        =======
        fps: number
            Real fps, can be slightly different than the asked one.
        """
        # checking available fps
        mini, maxi = self.get_fps_range()
        if fps < mini:
            print(f'Warning: Specified fps ({fps:.2f}) not in possible range:'
                  f' [{mini:.2f}, {maxi:.2f}].'
                  f' fps has been set to {mini:.2f}.')
            fps = mini
        if fps > maxi:
            print(f'Warning: Specified fps ({fps:.2f}) not in possible range:'
                  f' [{mini:.2f}, {maxi:.2f}].'
                  f' fps has been set to {maxi:.2f}.')
            fps = maxi
        fps = ueye.c_double(fps)
        new_fps = ueye.c_double()
        check(ueye.is_SetFrameRate(self.h_cam, fps, new_fps))
        self.current_fps = float(new_fps)
        return new_fps
示例#3
0
    def set_full_auto(self):
        print("full auto")
        disable = ueye.DOUBLE(0)
        enable = ueye.DOUBLE(1)
        zero = ueye.DOUBLE(0)
        ms = ueye.DOUBLE(20)
        rate = ueye.DOUBLE(50)
        newrate = ueye.DOUBLE()
        number = ueye.UINT()

        nRet = ueye.is_SetAutoParameter(self.h_cam, ueye.IS_SET_ENABLE_AUTO_GAIN, enable, zero);
        print('AG:',nRet)
        nRet = ueye.is_SetAutoParameter(self.h_cam, ueye.IS_SET_ENABLE_AUTO_SHUTTER, enable, zero);
        print('A_SHUTTER:',nRet)
        nRet = ueye.is_SetFrameRate(self.h_cam, rate, newrate);
        print('FR:',nRet,newrate)
        nRet = ueye.is_Exposure(self.h_cam, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE, ms, ueye.sizeof(ms));
        print('EXP:',nRet,ms)
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET_NUMBER, number, ueye.sizeof(number))
        print('PxCLK #:',nRet, number)
        PCrange = (ctypes.c_uint * 3)()
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET_RANGE, PCrange, 3*ueye.sizeof(number))
        print('PxCLK range:', nRet, PCrange[0], PCrange[1], PCrange[2])
        list_pixel_clocks = (ctypes.c_uint * 150)()
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET_LIST,  list_pixel_clocks, number*ueye.sizeof(number))
        list_np = np.frombuffer(list_pixel_clocks, int)
        print('PxCLK list:', nRet, list_np[0:number.value])
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET, number, ueye.sizeof(number))
        print('PxCLK current:',nRet, number)
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET_DEFAULT, number, ueye.sizeof(number))
        print('PxCLK default:',nRet, number)
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_SET, ueye.UINT(20), ueye.sizeof(number))
        print('PxCLK set:',nRet, number)
        nRet = ueye.is_PixelClock(self.h_cam, ueye.IS_PIXELCLOCK_CMD_GET, number, ueye.sizeof(number))
        print('PxCLK current:',nRet, number)
示例#4
0
文件: ids.py 项目: jsalort/pymanip
 def set_frame_rate(self, framerate_fps):
     """Sets the framerate in frames per seconds
     """
     newFPS = ctypes.c_double()
     nRet = ueye.is_SetFrameRate(self.hCam, float(framerate_fps), newFPS)
     if nRet != ueye.IS_SUCCESS:
         raise RuntimeError("SetFrameRate failed")
     if newFPS.value != framerate_fps:
         print("Warning actual framerate is", newFPS.value)
     return newFPS.value
 def setFrameRate(self, fr):
     """
     Note: values out of range are automatically clipped
     fr (0>float): framerate (in Hz) to be set
     return (0>float): actual framerate applied
     """
     newfps = ctypes.c_double()
     hasWorked = ueye.is_SetFrameRate(self.cam, ctypes.c_double(fr), newfps)
     self.check(hasWorked, 'setFrameRate')
     return newfps.value
    def set_fps(self, fps):
        new_fps = ueye.ctypes.c_double()
        if not ueye.is_SetFrameRate(self.cam, float(fps),
                                    new_fps) == ueye.IS_SUCCESS:
            raise RuntimeError("Frame Rate not set")

        if new_fps.value != fps:
            print("Warning actual fps is", new_fps.value)
        else:
            print("Frame rate set to %8.3f" % fps)

        return new_fps.value
示例#7
0
    def initialize_camera_settings(self):
        '''Sets pixel_clock, fps, exposure, autofocus, autogain based on self.config.'''
        # get max pixel clock
        pixel_clock_range = (ueye.c_uint * 3)()
        ret = ueye.is_PixelClock(self.input, ueye.IS_PIXELCLOCK_CMD_GET_RANGE, pixel_clock_range, 3 * ueye.sizeof(ueye.UINT()))
        log.info(f'pixel_clock max: {pixel_clock_range[0]}, pixel_clock min: {pixel_clock_range[1]}, ret val: {ret}')
        # set max pixel clock
        pixel_clock = ueye.c_int(pixel_clock_range[1])
        ret = ueye.is_PixelClock(self.input, ueye.IS_PIXELCLOCK_CMD_SET, pixel_clock, ueye.sizeof(pixel_clock))
        self.config['pixel_clock'] = pixel_clock.value
        log.info(f'Actual pixel clock: {pixel_clock}, ret val: {ret}')

        # max out frame rate
        target_frame_rate = ueye.double(self.config.get('fps'))
        actual_frame_rate = ueye.double(0.0)
        ret = ueye.is_SetFrameRate(self.input, target_frame_rate, actual_frame_rate)
        self.config['fps'] = actual_frame_rate.value
        log.info(f'Attempted to set frame rate to {target_frame_rate}, ret value: {ret}, actual frame rate: {actual_frame_rate}')

        # max out exposure
        target_exposure = ueye.double(self.config.get('exposure'))
        actual_exposure = ueye.double(0.0)
        ret = ueye.is_Exposure(self.input, ueye.IS_EXPOSURE_CMD_SET_EXPOSURE, target_exposure, ueye.sizeof(target_exposure))
        get_ret = ueye.is_Exposure(self.input, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE, actual_exposure, ueye.sizeof(actual_exposure))
        self.config['exposure'] = actual_exposure.value
        log.info(f'Attempted to set exposure to {target_exposure}, ret value: {ret}, actual frame rate: {actual_exposure}')

        # set autofocus limits
        if self.config.get('focus_min') is not None and self.config.get('focus_max') is not None:
            limit = ueye.AUTOFOCUS_LIMIT()
            limit.sMin = ueye.c_int(self.config['focus_min'])
            limit.sMax = ueye.c_int(self.config['focus_max'])
            ret = ueye.is_Focus(self.input, ueye.FOC_CMD_SET_AUTOFOCUS_LIMIT, limit, ueye.sizeof(limit));
            if ret == ueye.IS_SUCCESS:
                log.info(f'Successfully set focus min: {self.config["focus_min"]}, focus max: {self.config["focus_max"]}')
            else:
                log.error('Failed to set focus min/max.')

        # enable autofocus
        if self.config.get('autofocus'):
            ret = ueye.is_Focus(self.input, ueye.FOC_CMD_SET_ENABLE_AUTOFOCUS, None, 0)
            if ret == ueye.IS_SUCCESS:
                log.info(f'Successfully set autofocus to {self.config.get("autofocus")}.')
            else:
                log.error('Failed to set autofocus.')

        # enable autogain
        if self.config.get('autogain'):
            ret = ueye.is_SetAutoParameter(self.input, ueye.IS_SET_ENABLE_AUTO_GAIN, ueye.double(1), ueye.double(0))
            if ret == ueye.IS_SUCCESS:
                log.info(f'Successfully set autogain to {self.config.get("autogain")}.')
            else:
                log.error('Failed to set autogain.')
示例#8
0
    def Camera_Initialization(self):
        self.hcam = ueye.HIDS(0)
        self.ret = ueye.is_InitCamera(self.hcam, None)
        self.ret = ueye.is_SetColorMode(self.hcam, ueye.IS_CM_MONO12)
        self.IDS_FPS = float(50)
        self.newrate = ueye.DOUBLE(self.IDS_FPS)
        self.rate = ueye.DOUBLE(self.IDS_FPS)
        self.IDS_exposure = float(20)

        self.width = 2056
        self.height = 1542
        self.rect_aoi = ueye.IS_RECT()
        self.rect_aoi.s32X = ueye.int(0)
        self.rect_aoi.s32Y = ueye.int(0)
        self.rect_aoi.s32Width = ueye.int(self.width)
        self.rect_aoi.s32Height = ueye.int(self.height)
        ueye.is_AOI(self.hcam, ueye.IS_AOI_IMAGE_SET_AOI, self.rect_aoi,
                    ueye.sizeof(self.rect_aoi))

        self.mem_ptr = ueye.c_mem_p()
        self.mem_id = ueye.int()
        self.bitspixel = 16
        self.ret = ueye.is_AllocImageMem(self.hcam, self.width, self.height,
                                         self.bitspixel, self.mem_ptr,
                                         self.mem_id)

        self.ret = ueye.is_SetImageMem(self.hcam, self.mem_ptr, self.mem_id)
        self.ret = ueye.is_CaptureVideo(self.hcam, ueye.IS_DONT_WAIT)
        #self.lineinc = self.width * int((self.bitspixel + 7) / 8)
        self.lineinc = self.width * int(self.bitspixel / 8)

        self.nRet = ueye.is_SetFrameRate(self.hcam, self.rate, self.newrate)
        self.expms = ueye.DOUBLE(self.IDS_exposure)
        self.nRet = ueye.is_Exposure(self.hcam,
                                     ueye.IS_EXPOSURE_CMD_SET_EXPOSURE,
                                     self.expms, ueye.sizeof(self.expms))

        self.pixelclock = ueye.c_uint(197)
        self.nRet = ueye.is_PixelClock(self.hcam, ueye.IS_PIXELCLOCK_CMD_SET,
                                       self.pixelclock, 4)
        #pixelclock = ueye.c_uint()
        #ueye.is_PixelClock(hcam, ueye.IS_PIXELCLOCK_CMD_GET, pixelclock, 4)

        self.nRet = ueye.is_SetHardwareGain(self.hcam, 100,
                                            ueye.IS_IGNORE_PARAMETER,
                                            ueye.IS_IGNORE_PARAMETER,
                                            ueye.IS_IGNORE_PARAMETER)
        #gg = ueye.c_uint()
        #ueye.is_SetHWGainFactor(hcam, ueye.IS_GET_MASTER_GAIN_FACTOR, gg)
        self.nRet = ueye.is_SetHardwareGamma(self.hcam,
                                             ueye.IS_SET_HW_GAMMA_ON)
    def set_fps(self, fps):
        """
        Set the frame rate in frames per second.
        :param fps: frames per second to be set
        :return: actual frame rate
        """
        new_fps = ueye.ctypes.c_double()
        if not ueye.is_SetFrameRate(self.cam, float(fps), new_fps) == ueye.IS_SUCCESS:
            raise RuntimeError("Frame Rate not set")

        if new_fps.value != fps:
            print("Warning actual fps is", new_fps.value)
        else:
            print("Frame rate set to %8.3f" % fps)

        return new_fps.value
示例#10
0
    def set_fps(self, fps):
        """
        Set the fps.

        Returns
        =======
        fps: number
            Real fps, can be slightly different than the asked one.
        """
        # checking available fps
        mini, maxi = self.get_fps_range()
        if fps < mini:
            fps = mini
        if fps > maxi:
            fps = maxi
        fps = ueye.c_double(fps)
        new_fps = ueye.c_double()
        check(ueye.is_SetFrameRate(self.h_cam, fps, new_fps))
        self.current_fps = float(new_fps)
        return new_fps
示例#11
0
    def setExpoureTime(self, expTime):
        #Pixel-Clock Setting, the range of this camera is 7-35 MHz
        nPixelClockDefault = ueye.INT(200)
        nRet = ueye.is_PixelClock(self.hCam, ueye.IS_PIXELCLOCK_CMD_SET,
                                  nPixelClockDefault,
                                  ueye.sizeof(nPixelClockDefault))
        print(nPixelClockDefault)
        if nRet != ueye.IS_SUCCESS:
            print("is_PixelClock ERROR")

        nFrameRate = ueye.double(40.0)
        nRet = ueye.is_SetFrameRate(self.hCam, ueye.IS_PIXELCLOCK_CMD_SET,
                                    nFrameRate)
        if nRet != ueye.IS_SUCCESS:
            print("is_SetFrameRate ERROR")

        # Working on exposure time range. Set exposure time to be 20 ms.
        ms = ueye.DOUBLE(expTime)

        nRet = ueye.is_Exposure(self.hCam, ueye.IS_EXPOSURE_CMD_SET_EXPOSURE,
                                ms, ueye.sizeof(ms))
        if nRet != ueye.IS_SUCCESS:
            print("is_Exposure ERROR")
示例#12
0
    def __init__(self, pathToParameterSets, fps):

        self.hCam = ueye.HIDS(0)
        self.sInfo = ueye.SENSORINFO()
        self.cInfo = ueye.CAMINFO()
        self.pcImageMemory = ueye.c_mem_p()
        self.MemID = ueye.int()
        self.rectAOI = ueye.IS_RECT()
        self.pitch = ueye.INT()
        self.nBitsPerPixel = ueye.INT(24)
        self.channels = 3
        self.m_nColorMode = ueye.INT()
        self.bytes_per_pixel = int(self.nBitsPerPixel / 8)
        self.timeStampsFilePath = "times.txt"
        self.timeStampsFile = open(self.timeStampsFilePath, 'w')
        self.FPS = ctypes.c_double(int(fps))
        self.pathToParameterSets = pathToParameterSets

        nRet = ueye.is_InitCamera(self.hCam, None)
        if nRet != ueye.IS_SUCCESS:
            print("is_InitCamera ERROR")

        # Reads out the data hard-coded in the non-volatile camera memory and writes it to the data structure that cInfo points to
        nRet = ueye.is_GetCameraInfo(self.hCam, self.cInfo)
        if nRet != ueye.IS_SUCCESS:
            print("is_GetCameraInfo ERROR")

        # You can query additional information about the sensor type used in the camera
        nRet = ueye.is_GetSensorInfo(self.hCam, self.sInfo)
        if nRet != ueye.IS_SUCCESS:
            print("is_GetSensorInfo ERROR")

        if int.from_bytes(self.sInfo.nColorMode.value,
                          byteorder='big') == ueye.IS_COLORMODE_MONOCHROME:
            # for color camera models use RGB32 mode
            self.m_nColorMode = ueye.IS_CM_MONO8
            self.nBitsPerPixel = ueye.INT(8)
            self.bytes_per_pixel = int(self.nBitsPerPixel / 8)
            print("IS_COLORMODE_MONOCHROME: ", self.m_nColorMode)
            print("\tm_nColorMode: \t\t", self.m_nColorMode)
            print("\tnBitsPerPixel: \t\t", self.nBitsPerPixel)
            print("\tbytes_per_pixel: \t\t", self.bytes_per_pixel)
            print()

        #loading parameter set file

        pParam = ueye.wchar_p()
        pParam.value = self.pathToParameterSets

        nRet = ueye.is_ParameterSet(self.hCam,
                                    ueye.IS_PARAMETERSET_CMD_LOAD_FILE, pParam,
                                    0)
        if nRet != ueye.IS_SUCCESS:
            print("Setting parameter set error")

        #setting fps
        newFPS = ctypes.c_double(0)
        ueye.is_SetFrameRate(self.hCam, self.FPS, newFPS)
        if nRet != ueye.IS_SUCCESS:
            print("Setting fps ERROR")
        else:
            print("FPS is: ", newFPS)

        # Can be used to set the size and position of an "area of interest"(AOI) within an image
        nRet = ueye.is_AOI(self.hCam, ueye.IS_AOI_IMAGE_GET_AOI, self.rectAOI,
                           ueye.sizeof(self.rectAOI))
        if nRet != ueye.IS_SUCCESS:
            print("is_AOI ERROR")

        self.width = self.rectAOI.s32Width
        self.height = self.rectAOI.s32Height

        # Prints out some information about the camera and the sensor
        print("Camera model:\t\t", self.sInfo.strSensorName.decode('utf-8'))
        print("Camera serial no.:\t", self.cInfo.SerNo.decode('utf-8'))
        print("Maximum image width:\t", self.width)
        print("Maximum image height:\t", self.height)
        print()
示例#13
0
      stopbits=serial.STOPBITS_ONE, 
      bytesize=serial.EIGHTBITS
  )
  ser.isOpen()
# init max_steering
max_steering = 255

# init camera
hcam = ueye.HIDS(0)
ret = ueye.is_InitCamera(hcam, None)
print("initCamera returns "+str(ret))

# set FPS:
targetFPS = ueye.double(40) # insert here which FPS you want
actualFPS = ueye.double(0)
ret = ueye.is_SetFrameRate(hcam,targetFPS,actualFPS)
print("is_SetFrameRate returns " + str(ret) + ", Actual FPS is: " + str(actualFPS))

# set auto gain:
if args.autogain:
  ret = ueye.is_SetAutoParameter(hcam, ueye.IS_SET_ENABLE_AUTO_GAIN, ueye.double(1), ueye.double(0))
  print("is_SetAutoParameter returns " + str(ret))

# set color mode
ret = ueye.is_SetColorMode(hcam, ueye.IS_CM_BGR8_PACKED)
print("SetColorMode IS_CM_BGR8_PACKED returns " + str(ret))

# set region of interest
# width = 1936 # original ids properties
# height = 1216 # original ids properties
width = 1496
示例#14
0
# Activates the camera's live video mode (free run mode)
nRet = ueye.is_CaptureVideo(hCam, ueye.IS_DONT_WAIT)
if nRet != ueye.IS_SUCCESS:
    print("is_CaptureVideo ERROR")

# Enables the queue mode for existing image memory sequences
nRet = ueye.is_InquireImageMem(hCam, pcImageMemory, MemID, width, height,
                               nBitsPerPixel, pitch)
if nRet != ueye.IS_SUCCESS:
    print("is_InquireImageMem ERROR")
else:
    print("Press q to leave the programm")

#---------------------------------------------------------------------------------------------------------------------------------------
#экспозиция
error = ueye.is_SetFrameRate(hCam, fps, fps)
print("fps", fps)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MIN,
                      rangeMin, 8)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MAX,
                      rangeMax, 8)
print("range", rangeMin, rangeMax)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_SET_EXPOSURE, ex, 8)

print("экспозиция ", ex, er)

# Continuous image display
while (nRet == ueye.IS_SUCCESS):

    # In order to display the image in an OpenCV window we need to...
    # ...extract the data of our image memory
示例#15
0
 def Set_FPS(self):
     if self.Movie_Switch == 1:
         self.rate = ueye.DOUBLE(float(self.SetFPS_lineEdit.text()))
         self.newrate = ueye.DOUBLE(float(self.SetFPS_lineEdit.text()))
         self.nRet = ueye.is_SetFrameRate(self.hcam, self.rate,
                                          self.newrate)
示例#16
0
def ueye_set_frame_rate(hcam, framerate) -> None:
    frr = ueye.double(framerate)
    dummy = ueye.double(0)
    err = ueye.is_SetFrameRate(hcam, frr, dummy)
    _throw_if_err(hcam, err)
示例#17
0
if nRet != ueye.IS_SUCCESS:
    print("is_CaptureVideo ERROR")

# Enables the queue mode for existing image memory sequences
print(hCam, pcImageMemory, MemID, width, height, nBitsPerPixel, pitch)
nRet = ueye.is_InquireImageMem(hCam, pcImageMemory, MemID, width, height,
                               nBitsPerPixel, pitch)
if nRet != ueye.IS_SUCCESS:
    print("is_InquireImageMem ERROR")
else:
    print("Press q to leave the programm")

#---------------------------------------------------------------------------------------------------------------------------------------
#экспозиция
newFps = ueye.DOUBLE()
error = ueye.is_SetFrameRate(hCam, 2, newFps)
print("fps", newFps)
rangeMin = ueye.DOUBLE(165)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MIN,
                      rangeMin, 8)
rangeMax = ueye.DOUBLE(165)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MAX,
                      rangeMax, 8)
print("range", rangeMin, rangeMax)
ex = ueye.DOUBLE(165)
er = ueye.is_Exposure(hCam, ueye.IS_EXPOSURE_CMD_SET_EXPOSURE, ex, 8)

print("экспозиция ", ex, er)

# Continuous image display
i = 0
示例#18
0
def setFPS(fps, hCam=0):
    ms_new = ueye.c_double(fps)
    new = ueye.c_double(0)
    rv = ueye.is_SetFrameRate(hCam, ms_new, new)
    return new
 def getFrameRate(self):
     fps = ctypes.c_double()
     hasWorked = ueye.is_SetFrameRate(self.cam, ueye.IS_GET_FRAMERATE, fps)
     self.check(hasWorked, 'getFrameRate')
     return fps.value
示例#20
0
 def setFPS(self, fps):
     ms_new = ueye.c_double(fps)
     new = ueye.c_double(0)
     rv = ueye.is_SetFrameRate(self.hCam, ms_new, new)
     return new
示例#21
0
 def set_frame_rate(self, fps):
     dfps = ueye.DOUBLE(0)
     ueyeFps = ueye.DOUBLE(fps)
     ueye.is_SetFrameRate(self.hCam, ueyeFps, dfps)
     print("new Framerate: ", dfps)
示例#22
0
 def set_fps(self, fps):
     fps = ueye.double(fps)
     origin_fps = self.get_fps()
     return ueye.is_SetFrameRate(self.h_cam, fps, fps)
示例#23
0
    # Makes the specified image memory the active memory
    nRet = ueye.is_SetImageMem(hCam, pcImageMemory, MemID)
    if nRet != ueye.IS_SUCCESS:
        print("is_SetImageMem ERROR")
    else:
        # Set the desired color mode
        nRet = ueye.is_SetColorMode(hCam, m_nColorMode)

nRet = ueye.is_GetFramesPerSecond(hCam, OldFrameRate)
if nRet != ueye.IS_SUCCESS:
    print("GetFrame ERROR")
else:
    print("FramesPerSecond:\t", OldFrameRate.value)

# Set FRAME RATE
nRet = ueye.is_SetFrameRate(hCam, myFrameRate, c_double())
if nRet != ueye.IS_SUCCESS:
    print("SetFrame ERROR:\t", nRet)
else:
    print("FramesPerSecond:\t", myFrameRate)

# Set EXPOSURE TIME
# nRet = is_Exposure(m_hCam, IS_EXPOSURE_CMD_SET_EXPOSURE, (void*)&m_ExposureTime, sizeof(m_ExposureTime));
#IS_EXPOSURE_CMD_SET_EXPOSURE = 12
nRet = ueye.is_Exposure(hCam, 12, myExposure, 8)  #sizeof(myExposure) )
if nRet != ueye.IS_SUCCESS:
    print("Exposure ERROR:\t", nRet)
else:
    print("Exposure set to:\t", myExposure)

# Set GAIN
def is_SetFrameRate(cam, FPS):
    """sets the framerate of the uEye camera"""
    FPS = ueye.double(FPS)
    newFPS = ueye.double()
    return ueye.is_SetFrameRate(cam, FPS, newFPS)