-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcam.py
More file actions
executable file
·46 lines (38 loc) · 983 Bytes
/
Copy pathcam.py
File metadata and controls
executable file
·46 lines (38 loc) · 983 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
import io
import time
import base64
import picamera
camera = picamera.PiCamera()
camera.vflip = True
camera.led = True
#camera.start_preview()
camera.capture('image.jpg')
camera.led = False
camera.close()
#my_stream = io.BytesIO()
#camera.capture(my_stream, 'jpeg')
#with open('myIm.jpg', 'w+b') as myIm:
# myIm.write(my_stream.flush())
#camera.hflip = True
#camera.vflip = True
#camera.sharpness = 0
#camera.contrast = 0
#camera.brightness = 50
#camera.saturation = 0
#camera.ISO = 0
#camera.video_stabilization = False
#camera.exposure_compensation = 0
#camera.exposure_mode = 'auto'
#camera.meter_mode = 'average'
#camera.awb_mode = 'auto'
#camera.image_effect = 'none'
#camera.color_effects = None
#camera.rotation = 0
#camera.hflip = False
#camera.vflip = False
#camera.crop = (0.0, 0.0, 1.0, 1.0)
with open('image.jpg', 'r+b') as myIm:
encoded_string = base64.b64encode(myIm.read())
with open('b64.txt', 'w') as bim:
bim.write(encoded_string)