Skip to content

Commit

Permalink
add comments and format picam.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlou05 committed Nov 30, 2024
1 parent 2a9bd1e commit b507e23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions picam.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def main() -> None:


if __name__ == "__main__":
LOG_DIRECTORY_PATH.mkdir(parents=True, exist_ok=True)
main()
7 changes: 7 additions & 0 deletions picam.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

# Get current Unix time to avoid collision
# TODO: Something more sophisticated (e.g. counter)
TIME="${date +%s}"
echo $TIME

# Picamera Python
cd /home/warg/image-collection
touch logs/record_$TIME.log # To confirm script has run
python picam.py &
3 changes: 3 additions & 0 deletions test_picam_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
picam2 = picamera2.Picamera2()

picam2.configure(picam2.create_preview_configuration())

# Example default settings for use with IR camera + IR filter. (only sees IR hotspot)
# Don't change Brightness (artificially makes everything whiter) or Contrast (doesn't look too good)
# picam2.set_controls({"ExposureTime": 250, "AnalogueGain": 64.0, "Brightness": 0.0, "Contrast": 1.0})
print(picam2.controls)

picam2.start(show_preview=True)

while True:
# Since preview already started, it does not block preview
command = input("Enter a config and value (e.g. 'ExposureTime 250'): ")

input_tokens = command.split()
Expand Down

0 comments on commit b507e23

Please sign in to comment.