-
Notifications
You must be signed in to change notification settings - Fork 0
/
camfunct.py
46 lines (45 loc) · 887 Bytes
/
camfunct.py
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
45
from picamera import PiCamera
from time import sleep
#list for effects
#sketch
#posterise
#gpen
#colorbalance
#film
#pastel
#emboss
#denoise
#negative
#blur
#colorswap
#colorpoint
#saturation
#hatch
#watercolor
#cartoon
#none
#deinterlace1
#deinterlace2
#washedout
#solarize
#oilpaint
i =0
camera = PiCamera()
def takepict():
camera.start_preview()
sleep(5)
camera.capture('/home/pi/Desktop/image%s.jpg' % i)
camera.stop_preview()
def takevideo():
camera.start_preview()
camera.start_recording('/home/pi/Desktop/video.h264')
sleep(5)
camera.stop_recording()
camera.stop_preview()
def diffEffects(effect):
camera.start_preview()
camera.image_effect = effect #"film"#camera.IMAGE_EFFECTS[effect]
camera.annotate_text = "Effect: %s" % effect
sleep(5)
camera.capture('/home/pi/Desktop/image%s.jpg' % effect)
camera.stop_preview()