MCPcopy Create free account
hub / github.com/BasedHardware/Whomane / capture_image

Function capture_image

pi/script.py:6–18  ·  view source on GitHub ↗
(image_path)

Source from the content-addressed store, hash-verified

4import subprocess
5
6def capture_image(image_path):
7 # Define the command to capture an image
8 command = ["libcamera-still", "-o", image_path]
9
10
11 # Run the command
12 try:
13 subprocess.run(command, check=True)
14
15 print(f"Image captured successfully: {image_path}")
16 subprocess.run(['python', 'search.py'])
17 except subprocess.CalledProcessError as e:
18 print(f"Failed to capture image: {e}")
19
20if __name__ == "__main__":
21 # Define the path for the image

Callers 1

script.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected