-
Notifications
You must be signed in to change notification settings - Fork 11
/
test_ivport.py
44 lines (37 loc) · 1 KB
/
test_ivport.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
#!/usr/bin/env python
import os
import ivport
import time
def raspistill_capture():
# raspistill capture
def capture(camera):
"This system command for raspistill capture"
cmd = "raspistill -t 10 -o still_CAM%d.jpg" % camera
os.system(cmd)
iv = ivport.IVPort(ivport.TYPE_DUAL2)
iv.camera_change(1)
capture(1)
iv.camera_change(2)
capture(2)
iv.close()
def libcamera_still_capture():
# raspistill capture
def capture(camera):
"This system command for raspistill capture"
cmd = "libcamera_still -t 10 -o still_CAM%d.jpg" % camera
os.system(cmd)
iv = ivport.IVPort(ivport.TYPE_DUAL2)
iv.camera_change(1)
capture(1)
iv.camera_change(2)
capture(2)
iv.close()
# main capture examples
# all of them are functional
def main():
#raspistill_capture() # legacy camera
libcamera_still_capture() # after Raspberry OS Bullseye
#picam_capture()
#picam_sequence()
if __name__ == "__main__":
main()