Olli Graf
9 months ago
2 changed files with 36 additions and 1 deletions
@ -1,3 +1,3 @@ |
|||
bin |
|||
lib |
|||
|
|||
*.jpg |
|||
|
@ -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…
Reference in new issue