Beispiel #1
0
def main():
    # we need a QApplication, that runs our QT Gui Framework
    app = PyuEyeQtApp()

    # a basic qt window
    view = PyuEyeQtView()
    view.show()
    view.user_callback = process_image

    # camera class to simplify uEye API access
    cam = Camera()
    cam.init()
    cam.set_colormode(ueye.IS_CM_BGR8_PACKED)
    cam.set_aoi(0, 0, 640, 480)
    cam.alloc()
    cam.capture_video()

    # a thread that waits for new images and processes all connected views
    thread = FrameThread(cam, view)
    thread.start()

    # cleanup
    app.exit_connect(thread.stop)
    app.exec_()

    thread.stop()
    thread.join()

    cam.stop_video()
    cam.exit()
Beispiel #2
0
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()
Beispiel #3
0
def main():

    # we need a QApplication, that runs our QT Gui Framework
    print 'a'
    app = PyuEyeQtApp()
    print 'b'
    # a basic qt window
    view = PyuEyeQtView()
    print 'c'
    view.show()
    print 'd'
    view.user_callback = process_image
    print 'e'
    # camera class to simplify uEye API access
    cam = Camera()
    print 'f'
    cam.init()
    cam.set_colormode(ueye.IS_CM_BGR8_PACKED)
    #cam.set_colormode(ueye.IS_CM_SENSOR_RAW8)
    #cam.set_aoi(0,0, 1280, 1024)
    cam.set_aoi(300, 300, 400, 400)
    #cam.set_aoi(500,500,900,900)
    print 'g'
    cam.alloc()
    print 'h'
    cam.capture_video()
    print 'i'
    # a thread that waits for new images and processes all connected views
    print 'j'
    thread = FrameThread(cam, view)
    print 'k'
    thread.start()

    print 'l'

    # cleanup
    app.exit_connect(thread.stop)
    print '1'
    app.exec_()
    print '2'
    thread.stop()
    print '3'
    thread.join()
    print '4'
    cam.stop_video()
    print '5'
    cam.exit()
    print '6'