(image_path)
| 4 | import subprocess |
| 5 | |
| 6 | def 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 | |
| 20 | if __name__ == "__main__": |
| 21 | # Define the path for the image |