From 02f403b8a84238408dbe5e5c36d3bf2d26b677f6 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 24 Mar 2023 18:57:44 +0100 Subject: [PATCH] Added basic CLI app makehdr.py --- main.py | 17 ----------------- makehdr.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 17 deletions(-) delete mode 100644 main.py create mode 100644 makehdr.py diff --git a/main.py b/main.py deleted file mode 100644 index a9bb534..0000000 --- a/main.py +++ /dev/null @@ -1,17 +0,0 @@ -#!//usr/bin/python3 -import numpyHDR as hdr -import picamburst as pcb -import file_utility as file - -'''Example of a complete HDR process starting with raspicam ''' - -#Get sequence from raspicam -stack = pcb.get_exposure_stack() - -#Process HDR with mertens fusion and post effects -result = hdr.process(stack, 1, 1, 1, True) - -#Save Result to File -file = file.saveResultToFile(result, 'hdr/', 75) - - diff --git a/makehdr.py b/makehdr.py new file mode 100644 index 0000000..e59cd53 --- /dev/null +++ b/makehdr.py @@ -0,0 +1,47 @@ +#!//usr/bin/python3 +import numpyHDR as hdr +import file_utility as file + +'''CLI application for HDR experiments''' + +stack = [] +select = input("Select Image Source: 1 - Raspicam, 2 - From File, 3 - Image sequence, 4 debug: ") + +if int(select) == 1: + import picamburst as pcb + #Get sequence from raspicam + stack = pcb.get_exposure_stack() + +if int(select) == 2: + path_list = [] + i= 0 + nr = input("How many images? :") + for image in range(int(nr)): + i += 1 + image = input(f"Enter filename {i}: ") + path_list.append(image) + +if int(select) == 3: + path_list = [] + i = 0 + nr = input("How many images? :") + image = input(f"Enter first filename without seq Nr and .jpg {i}: ") + for i in range(int(nr)): + filename = f"{image}{i}.jpg" + path_list.append(filename) + +if int(select) == 4: + path_list = ['test_hdr0.jpg', 'test_hdr1.jpg', 'test_hdr2.jpg'] + +print(path_list) +stack = file.openImageList(path_list, True) + +#Process HDR with mertens fusion and post effects +result = hdr.process(stack, 1, 1, 1, True) + +#Save Result to File +file = file.saveResultToFile(result, 'hdr/result', 75) + + + +