From 48f0ef52abd9bfaa203b8a53418410fff710de4c Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 24 Sep 2023 09:42:34 +0200 Subject: [PATCH] - Added safety measure to round incoming Exposure to int before processing. --- makehdr.py | 2 +- picamburst.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makehdr.py b/makehdr.py index 4e079a2..5116424 100644 --- a/makehdr.py +++ b/makehdr.py @@ -12,7 +12,7 @@ select = input("Select Image Source: 1 - Raspicam, 2 - From File, 3 - Image sequ if int(select) == 1: import picamburst as pcb #Get sequence from raspicam - stack = pcb.get_exposure_stack() + stack = pcb.get_ex2posure_stack() if int(select) == 2: path_list = [] diff --git a/picamburst.py b/picamburst.py index 1baed0b..999d095 100644 --- a/picamburst.py +++ b/picamburst.py @@ -15,7 +15,7 @@ picam2.set_controls({"LensPosition": 0.0 }) def get_exposure_stack(factor: int = 2): '''Returns a list with arrays that contain different exposures controlled by the factor.''' - '''The Autoamtically set exposure of the first frame is saved and multiplied or divided ba the factor to get the above or under epxosures.''' + '''The Autoamtically set exposure of the first frame is saved and multiplied or divided by the factor to get the above or under epxosures.''' picam2.start() time.sleep(1) @@ -23,7 +23,7 @@ def get_exposure_stack(factor: int = 2): print(picam2.capture_metadata()) start = picam2.capture_metadata() exposure_start = start["ExposureTime"] - gain_start = start["AnalogueGain"] + gain_start = int(round(start["AnalogueGain"])) if exposure_start > 117000 or exposure_start < factor: print("Low Light levels out of range, can't make HDR") exit()