Esempio n. 1
0
        print('stopping autocalib')
        cp.StartStopAutoCalibration()
    return previous_exposure_speed, previous_red_gain, previous_blue_gain


targetbgr, weight = DefineColorCheckerColorsAndWeights()
# initialize the camera and grab a reference to the raw camera capture
try:
    camera = PiCamera()
except:
    print('No camera. Exiting.')
    quit()
SetInitialCameraProperties(camera)
rawCapture = PiRGBArray(camera, size=camera.resolution)

globa.cameraproperties = CameraProperties(camera)
cp = globa.cameraproperties
cp.Load()

try:
    (globa.last_picture_taken_ticks,
     globa.last_picture_filename) = LoadLastPictureTicks()
except:
    print('Could not load time of last picture.')

try:
    with open('calibration-locations.pkl', 'r') as f:
        globa.locations = pickle.load(f)
        print('loaded calibration locations')
except:
    pass