def capture(shutter_speed=_shutter_speed, light_color="blue", resolution=_resolution, auto_exposure=False): if auto_exposure: return _auto_exposure(light_color=light_color, resolution=resolution) else: try: lights.setLight(light_color, 1) # turn the lights on if resolution == _max_resolution: print("capturing raw bayer data") # img = _captureBayer(shutter_speed) img = bayer.capture_green(shutter_speed) # convert to pseudo 16 bit format # img = img << 6 print(img.dtype) print(img.shape) else: # img = raspistill.capture(shutter_speed=shutter_speed, light_color=light_color, resolution=resolution) img = _captureRGB(shutter_speed, resolution) img = img[:, :, 1] # take green channel return img finally: lights.setLight(light_color, 0) # turn the lights off
def capture(shutter_speed=_shutter_speed, light_color='blue', resolution=_resolution, auto_exposure=False): if auto_exposure: return _auto_exposure(light_color=light_color, resolution=resolution) else: try: lights.setLight(light_color, 1) # turn the lights on if resolution == _max_resolution: print('capturing raw bayer data') #img = _captureBayer(shutter_speed) img = bayer.capture_green(shutter_speed) # convert to pseudo 16 bit format #img = img << 6 print(img.dtype) print(img.shape) else: #img = raspistill.capture(shutter_speed=shutter_speed, light_color=light_color, resolution=resolution) img = _captureRGB(shutter_speed, resolution) img = img[:,:,1] # take green channel return img finally: lights.setLight(light_color, 0) # turn the lights off
def setLight(color, value): lights.setLight(color, value)