-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnap-on-run.py
More file actions
28 lines (24 loc) · 881 Bytes
/
Copy pathsnap-on-run.py
File metadata and controls
28 lines (24 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import time
from picamera import PiCamera
def setup_camera(the_camera):
the_camera.brightness = 50
the_camera.sharpness = 0
the_camera.contrast = 0
the_camera.saturation = 0
the_camera.iso = 0
the_camera.exposure_compensation = 0
the_camera.exposure_mode = 'auto'
the_camera.meter_mode = 'average'
the_camera.awb_mode = 'auto'
the_camera.rotation = 0
the_camera.hflip = False
the_camera.vflip = False
the_camera.crop = (0.0, 0.0, 1.0, 1.0)
the_camera.resolution = (4056, 3040)
# you may need to increase gpu_mem in /boot/config.txt to achieve full resolution with the Camera Module v2.
if __name__ == '__main__':
the_camera = PiCamera()
setup_camera(the_camera)
filename = "/home/pi/Pictures/image_" + str(int(time.time())) + ".jpg"
the_camera.capture(filename)
print("Saved image as " + filename)