From 8dd7308ec442d4ddccf166e1aff8b283c55311da Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 24 Mar 2023 19:33:28 +0100 Subject: [PATCH] Updated package meta zeug --- license.txt | 21 +++++++++++++++++++++ makehdr.py | 4 +++- readme.md | 48 +++++++++++++++++++++++++++++++----------------- 3 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 license.txt diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..3682532 --- /dev/null +++ b/license.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2023] [Thomas Herrmann] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/makehdr.py b/makehdr.py index a1a1d6b..c44a533 100644 --- a/makehdr.py +++ b/makehdr.py @@ -20,6 +20,7 @@ if int(select) == 2: i += 1 image = input(f"Enter filename {i}: ") path_list.append(image) + stack = file.openImageList(path_list, True) if int(select) == 3: path_list = [] @@ -29,12 +30,13 @@ if int(select) == 3: for i in range(int(nr)): filename = f"{image}{i}.jpg" path_list.append(filename) + stack = file.openImageList(path_list, True) if int(select) == 4: path_list = ['test_hdr0.jpg', 'test_hdr1.jpg', 'test_hdr2.jpg'] + stack = file.openImageList(path_list, True) 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) diff --git a/readme.md b/readme.md index c4d6b4c..8718679 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # numpyHDR -* Micro Library for HDR image creation using the Mertens Fusion Alghoritm* +* Micro Library for HDR image creation using the Mertens Fusion Alghoritm * Optional Raspicam integration with picamera2 lib * CLI Application "makehdr.py" * Processing time on raspi zero ca 15 min with full res 12MP files. @@ -22,24 +22,38 @@ - Clips to Image range and saves via PIL ## Setup -- Download and isntall dependencies from requirements.txt into env -- +- Download and install dependencies from requirements.txt into env +- `pip install -r requirements.txt` +- Install picamera2 and libcamera +- `pip install picamera2` +- `pip install libcamera` ## Usage -- Start make +- Start makehdr.py +- `python3 makehdr.py` +- Follow commandline instructions +- Be patient on Raspi zero + +- Example on how to use the library can be found in makehdr.py + +## Using the library +*Import numpyHDR modules* +- `import file_utility as file` +- `import numpyHDR as hdr` +- `import picamburst as pcb` + +*Get image arrays from raspicam* +- `stack = pcb.get_exposure_stack()` + +*Get image arrays from files* +- `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* +- The filename gets extended by ".jpg" and "_hdr" automatically +- `file = file.saveResultToFile(result, 'hdr/result', 75)` -Run function sequence() to start processing. -Example: -`hdr = numpyHDR.NumpyHDR()` - -`hdr.input_image = photos/EV- stages/` - -`hdr.compress_quality = 50` - -`hdr.output_path = photos/result/` - -`hdr.sequence()` - --returns: Nothing (Arrrr) \ No newline at end of file