Browse Source

erste Vresion pistill.py

develop
Olli Graf 9 months ago
parent
commit
31915dc7d6
  1. 2
      camera/.gitignore
  2. 35
      camera/pistill.py

2
camera/.gitignore

@ -1,3 +1,3 @@
bin bin
lib lib
*.jpg

35
camera/pistill.py

@ -0,0 +1,35 @@
#! /usr/bin/python
from picamera2 import Picamera2
from libcamera import controls
from time import sleep
import sys
to_file=''
picam = Picamera2()
def take_still(filename):
config = picam.create_preview_configuration()
picam.configure(config)
picam.start()
picam.set_controls({"AfMode": controls.AfModeEnum.Continuous})
sleep(5)
picam.capture_file(filename)
picam.close()
def parseArgs(argv):
global to_file
count = 0
for arg in argv:
if arg == '-o':
to_file = argv[count+1]
count += 1
if __name__ =='__main__':
parseArgs(sys.argv)
print(f'to_file={to_file}')
take_still(to_file)
Loading…
Cancel
Save