Giter Club home page Giter Club logo

hdr-plus's People

Contributors

brotherofken avatar galois-c avatar gooooloo avatar lamerman avatar opna2608 avatar smancill avatar suhaasr avatar timothybrooks avatar titaniumtown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hdr-plus's Issues

Ability to save aligned/merged image before demosaic

It would be beneficial to leverage the HDR+ align/merge algorithms but allow performing the remaining processing steps in the workflow using a tool such as RawTherapee.

An example proof-of-concept hack that saves to TIFF can be seen at Entropy512@135273b - the resulting file can be renamed to .dng and then tagged with exiftool such that RT treats it like any other DNG file.

Some method of allowing this to be chosen via the command line instead of hardcoding the behavior is needed. The return type of process() could be a challenge for this.

Additional work would be to integrate an EXIF library so that the DNG could be tagged on export as opposed to in an external script.

Supported file types

What file types can be the input? I know CR2 and dng. But what about tiff, jpg, png, etc? It seems the code might only support CR2 and dng but there are uncompressed tiffs as well.

Input image must have width of 5796

Input image must have width of 5796 ?
Input image must have height of 3870 ?

my image is 6024* 4024
i change the code
static const int width = 6024;
static const int height = 4024;
the result is bad? can you give me some suggests, thanks

Updating for better compatibility

Are you ever going to update this to work on newer halide versions? I never can get this to work even though I am following all the directions and I have spend hours trying to get it to compile. Please Help!!

Assertion failed: (size == (size_t)type().bytes() && "Error: Overflow computing total size of buffer."),

I tried the newest code on my mac,
when run the produced hdrplus binary , it crashed because of the following error:

./hdrplus dng_images dst.png payload_N000.dng payload_N001.dng payload_N002.dng
Opening dng_images/payload_N000.dng
Opening dng_images/payload_N001.dng
Opening dng_images/payload_N002.dng
Opening dng_images/payload_N003.dng
Opening dng_images/payload_N004.dng
Assertion failed: (size == (size_t)type().bytes() && "Error: Overflow computing total size of buffer."), function check_overflow, file /Users/yifabao/CLionProjects/Halide/include/Halide.h, line 5502.
Abort trap: 6


My mac info : Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

clang version 10.0.0
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

I don't know why ?

I debug found that in the code :
Halide::Runtime::Buffer<uint8_t> process() {
const int width = burst.GetWidth(); // return -1
const int height = burst.GetHeight();// return -1

Raws.empty() == 1

and I tried on android , also make the same error

image

using GPU

the current code is quite slow, which takes about 20 seconds to generate a picture. So I speed it up by using GPU. I set the HL_TARGET and other environment parameters like the following:

target=x86-64-linux-opencl
cwd=$(pwd)
export HL_TARGET=$target
export HL_JIT_TARGET=$target
export HL_DEBUG_CODEGEN=1
export HL_TRACE=1
export HL_NUM_THREADS=1024
export HL_TRACE_FILE=$cwd/trace.log
export HL_PROFILE=1

And run the hdrplus. However, this does not work at all. Any hint to fix it?

make error

$ cmake ..
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.16299.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/00work/00HDR/hdr-plus/build

$ mingw32-make
mingw32-make: *** No targets specified and no makefile found. Stop.

Input example

Hi!
Could you please share an example of input files?

make error

I tried building the project with the instructions in README but failed. The message is as below. Do you have any idea how to solve it?

Scanning dependencies of target hdrplus
[ 16%] Building CXX object CMakeFiles/hdrplus.dir/src/HDRPlus.cpp.o
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:2:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h: In function ‘bool Halide::Tools::load_raw(const string&, uint16_t*, int, int)’:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:50:93: error: too many arguments to function
     if (!check(f.f != nullptr, "File %s could not be opened for reading\n", filename.c_str())) return false;
                                                                                             ^
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:2:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:66:135: error: too many arguments to function
     if (!check(in_width == width, "Input image '%s' has width %d, but must must have width of %d\n", filename.c_str(), in_width, width)) return false;
                                                                                                                                       ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:68:141: error: too many arguments to function
     if (!check(in_height == height, "Input image '%s' has height %d, but must must have height of %d\n", filename.c_str(), in_height, height)) return false;
                                                                                                                                             ^
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:7:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/align.h: At global scope:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/align.h:58:26: error: ‘Image’ in namespace ‘Halide’ does not name a type
 Halide::Func align(const Halide::Image<uint16_t> imgs);
                          ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/align.h:58:34: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
 Halide::Func align(const Halide::Image<uint16_t> imgs);
                                  ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/align.h:58:39: error: expected ‘,’ or ‘...’ before ‘<’ token
 Halide::Func align(const Halide::Image<uint16_t> imgs);
                                       ^
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:8:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/merge.h:10:20: error: ‘Image’ is not a member of ‘Halide’
 Halide::Func merge(Halide::Image<uint16_t> imgs, Halide::Func alignment);
                    ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/merge.h:10:42: error: expected primary-expression before ‘>’ token
 Halide::Func merge(Halide::Image<uint16_t> imgs, Halide::Func alignment);
                                          ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/merge.h:10:44: error: ‘imgs’ was not declared in this scope
 Halide::Func merge(Halide::Image<uint16_t> imgs, Halide::Func alignment);
                                            ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/merge.h:10:63: error: expected primary-expression before ‘alignment’
 Halide::Func merge(Halide::Image<uint16_t> imgs, Halide::Func alignment);
                                                               ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:21:15: error: ‘Image’ does not name a type
         const Image<uint16_t> imgs;
               ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:36:22: error: expected ‘)’ before ‘<’ token
         HDRPlus(Image<uint16_t> imgs, BlackPoint bp, WhitePoint wp, WhiteBalance wb, Compression c, Gain g) : imgs(imgs), bp(bp), wp(wp), wb(wb), c(c), g(g) {
                      ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:47:9: error: ‘Image’ does not name a type
         Image<uint8_t> process() {
         ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:72:90: error: ‘Image’ has not been declared
         static bool load_raws(std::string dir_path, std::vector<std::string> &img_names, Image<uint16_t> &imgs) {
                                                                                          ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:72:95: error: expected ‘,’ or ‘...’ before ‘<’ token
         static bool load_raws(std::string dir_path, std::vector<std::string> &img_names, Image<uint16_t> &imgs) {
                                                                                               ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:99:74: error: ‘Image’ has not been declared
         static bool save_png(std::string dir_path, std::string img_name, Image<uint8_t> &img) {
                                                                          ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:99:79: error: expected ‘,’ or ‘...’ before ‘<’ token
         static bool save_png(std::string dir_path, std::string img_name, Image<uint8_t> &img) {
                                                                               ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp: In static member function ‘static bool HDRPlus::load_raws(std::string, std::vector<std::basic_string<char> >&, int)’:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:76:13: error: ‘imgs’ was not declared in this scope
             imgs = Image<uint16_t>(width, height, num_imgs);
             ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:76:20: error: ‘Image’ was not declared in this scope
             imgs = Image<uint16_t>(width, height, num_imgs);
                    ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:76:34: error: expected primary-expression before ‘>’ token
             imgs = Image<uint16_t>(width, height, num_imgs);
                                  ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:76:43: warning: left operand of comma operator has no effect [-Wunused-value]
             imgs = Image<uint16_t>(width, height, num_imgs);
                                           ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:76:51: warning: right operand of comma operator has no effect [-Wunused-value]
             imgs = Image<uint16_t>(width, height, num_imgs);
                                                   ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp: In static member function ‘static bool HDRPlus::save_png(std::string, std::string, int)’:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:105:35: error: ‘img’ was not declared in this scope
             int stride_in_bytes = img.width() * img.channels();
                                   ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp: In function ‘int main(int, char**)’:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:187:5: error: ‘Image’ was not declared in this scope
     Image<uint16_t> imgs;
     ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:187:19: error: expected primary-expression before ‘>’ token
     Image<uint16_t> imgs;
                   ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:187:21: error: ‘imgs’ was not declared in this scope
     Image<uint16_t> imgs;
                     ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:197:18: error: expected primary-expression before ‘>’ token
     Image<uint8_t> output = hdr_plus.process();
                  ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:197:20: error: ‘output’ was not declared in this scope
     Image<uint8_t> output = hdr_plus.process();
                    ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:197:38: error: ‘class HDRPlus’ has no member named ‘process’
     Image<uint8_t> output = hdr_plus.process();
                                      ^
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:2:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h: In instantiation of ‘bool Halide::Tools::load_raw(const string&, uint16_t*, int, int) [with bool (* check)(bool, const char*) = Halide::Tools::Internal::CheckFail; std::string = std::basic_string<char>; uint16_t = short unsigned int]’:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:85:66:   required from here
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:50:93: error: too many arguments to function
     if (!check(f.f != nullptr, "File %s could not be opened for reading\n", filename.c_str())) return false;
                                                                                             ^
In file included from /home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/HDRPlus.cpp:2:0:
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:66:135: error: too many arguments to function
     if (!check(in_width == width, "Input image '%s' has width %d, but must must have width of %d\n", filename.c_str(), in_width, width)) return false;
                                                                                                                                       ^
/home/likewise-open/SENSETIME/liuchengtsung/Desktop/hdr-plus/src/halide_load_raw.h:68:141: error: too many arguments to function
     if (!check(in_height == height, "Input image '%s' has height %d, but must must have height of %d\n", filename.c_str(), in_height, height)) return false;
                                                                                                                                             ^
make[2]: *** [CMakeFiles/hdrplus.dir/src/HDRPlus.cpp.o] Error 1
make[1]: *** [CMakeFiles/hdrplus.dir/all] Error 2
make: *** [all] Error 2

Are Sony ARWs supported? - Cannot open file ARW error: Input/output error

Haven't tried other RAW files, but are Sony ARWs supported?

./hdrplus -c 2.0 -g 1.0 /raw result.png DSC05745.ARW DSC05746.ARW DSC05747.ARW
Cannot open file raw/DSC05745.ARW error: Input/output error
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error opening raw/DSC05745.ARW
Abort trap: 6

Process with GR/BG pattern.

Hi @timothybrooks,
I was compiled this project and run with raw images capture from my phone, but the result was bad.
and I realized my input is in GRBG pattern and this project was developed for RGGB pattern when run finish function it seem to be not correct, how to run with GRBG?

make error

I get the following error when trying to make hdr+.

(base) yoongyoo@PC1907057:/test/hdrplus_c/build$ cmake -DHALIDE_DISTRIB_DIR="/home/yoongyoo/test/hdrplus_c/halide" ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- HALIDE_DISTRIB_DIR: /home/yoongyoo/test/hdrplus_c/halide
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- run load halide cmake
-- Using /home/yoongyoo/test/hdrplus_c/halide/bin/libHalide.so
-- Found TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (found version "4.0.9")
-- Found tiffxx: /usr/lib/x86_64-linux-gnu/libtiffxx.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34")
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yoongyoo/test/hdrplus_c/build
(base) yoongyoo@PC1907057:
/test/hdrplus_c/build$ make -j$(expr $(nproc) + 1)
Scanning dependencies of target hdrplus_pipeline.generator_library
Scanning dependencies of target halide_library_runtime.generator_binary
Scanning dependencies of target align_and_merge.generator_library
[ 3%] Building CXX object CMakeFiles/halide_library_runtime.generator_binary.dir/halide/tools/GenGen.cpp.o
[ 11%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_library.dir/src/hdrplus_pipeline_generator.cpp.o
[ 11%] Building CXX object CMakeFiles/align_and_merge.generator_library.dir/src/align_and_merge_generator.cpp.o
[ 18%] Building CXX object CMakeFiles/align_and_merge.generator_library.dir/src/align.cpp.o
[ 18%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_library.dir/src/align.cpp.o
[ 25%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_library.dir/src/merge.cpp.o
[ 25%] Building CXX object CMakeFiles/align_and_merge.generator_library.dir/src/merge.cpp.o
[ 29%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_library.dir/src/util.cpp.o
[ 33%] Building CXX object CMakeFiles/align_and_merge.generator_library.dir/src/util.cpp.o
[ 37%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_library.dir/src/finish.cpp.o
/home/yoongyoo/test/hdrplus_c/src/align.cpp: In function ‘Halide::Func align(Halide::Func, Halide::Expr, Halide::Expr)’:
/home/yoongyoo/test/hdrplus_c/src/align.cpp:77:85: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func imgs_mirror = BoundaryConditions::mirror_interior(imgs, 0, width, 0, height);
^
/home/yoongyoo/test/hdrplus_c/src/merge.cpp: In function ‘Halide::Func merge_temporal(Halide::Func, Halide::Expr, Halide::Expr, Halide::Expr, Halide::Func)’:
/home/yoongyoo/test/hdrplus_c/src/merge.cpp:29:85: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func imgs_mirror = BoundaryConditions::mirror_interior(imgs, 0, width, 0, height);
^
/home/yoongyoo/test/hdrplus_c/src/merge.cpp: In function ‘Halide::Func merge_temporal(Halide::Func, Halide::Expr, Halide::Expr, Halide::Expr, Halide::Func)’:
/home/yoongyoo/test/hdrplus_c/src/merge.cpp:29:85: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func imgs_mirror = BoundaryConditions::mirror_interior(imgs, 0, width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/align.h:12:0,
from /home/yoongyoo/test/hdrplus_c/src/align.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
In file included from /home/yoongyoo/test/hdrplus_c/src/merge.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/merge.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
In file included from /home/yoongyoo/test/hdrplus_c/src/merge.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/merge.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
/home/yoongyoo/test/hdrplus_c/src/align.cpp:117:92: warning: ‘Halide::Func Halide::BoundaryConditions::repeat_edge(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func alignment_repeat = BoundaryConditions::repeat_edge(alignment, 0, num_tx, 0, num_ty);
^
/home/yoongyoo/test/hdrplus_c/src/finish.cpp: In function ‘Halide::Func demosaic(Halide::Func, Halide::Expr, Halide::Expr)’:
/home/yoongyoo/test/hdrplus_c/src/finish.cpp:90:87: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func input_mirror = BoundaryConditions::mirror_interior(input, 0, width, 0, height);
^
/home/yoongyoo/test/hdrplus_c/src/align.cpp: In function ‘Halide::Func align(Halide::Func, Halide::Expr, Halide::Expr)’:
/home/yoongyoo/test/hdrplus_c/src/align.cpp:77:85: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func imgs_mirror = BoundaryConditions::mirror_interior(imgs, 0, width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/align.h:12:0,
from /home/yoongyoo/test/hdrplus_c/src/align.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18509:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func repeat_edge(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~
In file included from /home/yoongyoo/test/hdrplus_c/src/finish.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/finish.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
In file included from /home/yoongyoo/test/hdrplus_c/src/align.h:12:0,
from /home/yoongyoo/test/hdrplus_c/src/align.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
/home/yoongyoo/test/hdrplus_c/src/align.cpp:117:92: warning: ‘Halide::Func Halide::BoundaryConditions::repeat_edge(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func alignment_repeat = BoundaryConditions::repeat_edge(alignment, 0, num_tx, 0, num_ty);
^
/home/yoongyoo/test/hdrplus_c/src/finish.cpp: In function ‘Halide::Func bilateral_filter(Halide::Func, Halide::Expr, Halide::Expr)’:
/home/yoongyoo/test/hdrplus_c/src/finish.cpp:200:87: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_interior(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func input_mirror = BoundaryConditions::mirror_interior(input, 0, width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/align.h:12:0,
from /home/yoongyoo/test/hdrplus_c/src/align.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18509:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func repeat_edge(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~
In file included from /home/yoongyoo/test/hdrplus_c/src/finish.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/finish.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18632:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_interior(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~~~~
/home/yoongyoo/test/hdrplus_c/src/finish.cpp: In function ‘Halide::Func desaturate_noise(Halide::Func, Halide::Expr, Halide::Expr)’:
/home/yoongyoo/test/hdrplus_c/src/finish.cpp:254:84: warning: ‘Halide::Func Halide::BoundaryConditions::mirror_image(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func input_mirror = BoundaryConditions::mirror_image(input, 0, width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/finish.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/finish.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18589:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func mirror_image(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~~
/home/yoongyoo/test/hdrplus_c/src/finish.cpp: In function ‘Halide::Func combine(Halide::Func, Halide::Func, Halide::Expr, Halide::Expr, Halide::Func)’:
/home/yoongyoo/test/hdrplus_c/src/finish.cpp:350:80: warning: ‘Halide::Func Halide::BoundaryConditions::repeat_edge(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func im1_mirror = BoundaryConditions::repeat_edge(im1, 0 , width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/finish.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/finish.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18509:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func repeat_edge(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~
/home/yoongyoo/test/hdrplus_c/src/finish.cpp:351:80: warning: ‘Halide::Func Halide::BoundaryConditions::repeat_edge(const T&, Bounds&& ...) [with T = Halide::Func; Bounds = {int, Halide::Expr&, int, Halide::Expr&}; typename std::enable_if<Halide::Internal::all_are_convertible<Halide::Expr, Bounds ...>::value>::type* = 0]’ is deprecated: Add braces around the bounds like so: {{a, b}, {c, d}} [-Wdeprecated-declarations]
Func im2_mirror = BoundaryConditions::repeat_edge(im2, 0 , width, 0, height);
^
In file included from /home/yoongyoo/test/hdrplus_c/src/finish.h:4:0,
from /home/yoongyoo/test/hdrplus_c/src/finish.cpp:1:
/home/yoongyoo/test/hdrplus_c/halide/include/Halide.h:18509:33: note: declared here
HALIDE_NO_USER_CODE_INLINE Func repeat_edge(const T &func_like, Bounds &&... bounds) {
^~~~~~~~~~~
[ 40%] Linking CXX executable halide_library_runtime.generator_binary
[ 40%] Built target halide_library_runtime.generator_binary
Scanning dependencies of target halide_rt_host_runtime_gen
[ 44%] Linking CXX static library libalign_and_merge.generator_library.a
[ 44%] Built target align_and_merge.generator_library
Scanning dependencies of target align_and_merge.generator_binary
[ 48%] Building CXX object CMakeFiles/align_and_merge.generator_binary.dir/halide/tools/GenGen.cpp.o
[ 51%] Linking CXX static library libhdrplus_pipeline.generator_library.a
[ 51%] Built target hdrplus_pipeline.generator_library
Scanning dependencies of target hdrplus_pipeline.generator_binary
[ 55%] Building CXX object CMakeFiles/hdrplus_pipeline.generator_binary.dir/halide/tools/GenGen.cpp.o
[ 55%] Built target halide_rt_host_runtime_gen
[ 59%] Linking CXX executable align_and_merge.generator_binary
[ 59%] Built target align_and_merge.generator_binary
[ 62%] Linking CXX executable hdrplus_pipeline.generator_binary
Scanning dependencies of target align_and_merge_lib_gen
Unknown flag: -x
gengen
[-g GENERATOR_NAME] [-f FUNCTION_NAME] [-o OUTPUT_DIR] [-r RUNTIME_NAME] [-d 1|0]
[-e EMIT_OPTIONS] [-n FILE_BASE_NAME] [-p PLUGIN_NAME] [-s AUTOSCHEDULER_NAME]
target=target-string[,target-string...] [generator_arg=value [...]]

-d Build a module that is suitable for using for gradient descent calculationn
in TensorFlow or PyTorch. See Generator::build_gradient_module() documentation.

-e A comma separated list of files to emit. Accepted values are:
[assembly, bitcode, c_header, c_source, cpp_stub, featurization,
llvm_assembly, object, python_extension, pytorch_wrapper, registration,
schedule, static_library, stmt, stmt_html, compiler_log].
If omitted, default value is [c_header, static_library, registration].

-p A comma-separated list of shared libraries that will be loaded before the
generator is run. Useful for custom auto-schedulers. The generator must
either be linked against a shared libHalide or compiled with -rdynamic
so that references in the shared library to libHalide can resolve.
(Note that this does not change the default autoscheduler; use the -s flag
to set that value.)
-r The name of a standalone runtime to generate. Only honors EMIT_OPTIONS 'o'
and 'static_library'. When multiple targets are specified, it picks a
runtime that is compatible with all of the targets, or fails if it cannot
find one. Flags across all of the targets that do not affect runtime code
generation, such as no_asserts and no_runtime, are ignored.

-s The name of an autoscheduler to set as the default.
CMakeFiles/align_and_merge_lib_gen.dir/build.make:62: recipe for target 'genfiles/align_and_merge/align_and_merge.a' failed
make[2]: *** [genfiles/align_and_merge/align_and_merge.a] Error 1
CMakeFiles/Makefile2:245: recipe for target 'CMakeFiles/align_and_merge_lib_gen.dir/all' failed
make[1]: *** [CMakeFiles/align_and_merge_lib_gen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 62%] Built target hdrplus_pipeline.generator_binary
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Implement Handheld Multi-Frame Super-Resolution

Google researches published paper with details of implementation of their superresolution: https://arxiv.org/abs/1905.03277

It seems not trivial but implementable. Algorithm introduces new approach to merge and produces demosaiced image, so requires large changes in pipeline.

Development might be split into stages:

  1. Alignment refinement for sub-pixel accuracy using Lukas-Kanade optical flow iterations.
  2. Merge without considering robustness term
  3. Add robustness estimation.

Compile once and run more time

Hi,
I need to run HDRPlus to process images in run time, so I need to compile it once not every time I give him new images. I knew two ways to do that:

  1. using compile_jit() once, then call realize() more time. But how can I do that in this project?
  2. using compile_to_file() but I don't know also how to do that with this project?

thanks,

weight calculation of merge

I was digging into the implementation of merge process and get confused with the following pieces.

Expr norm_dist = max(1, i32(dist) / factor - min_dist / factor);
weight(tx, ty, n) = select(norm_dist > (max_dist - min_dist), 0.f, 1.f / norm_dist);

Here, how the weights are calculated? If norm_dist has a maximal value of 1, then how could it be greater than max_dist-min_dist?

Expr val_00 = input(idx_0(x), idx_0(y), tile_0(x), tile_0(y));
Expr val_10 = input(idx_1(x), idx_0(y), tile_1(x), tile_0(y));
Expr val_01 = input(idx_0(x), idx_1(y), tile_0(x), tile_1(y));
Expr val_11 = input(idx_1(x), idx_1(y), tile_1(x), tile_1(y));

Secondly why are these vals calculated like this in spatial merging? I didn't find much information about spatial merging details in hdr+ paper, so I didn't really get the purpose of this implemetation. Is there any paper that I can refer to here? Thank you.

How to process Bayer metadata?

Hi, my data from cameras is just metadata, without any other informantion but RGGB array. So how can I get HDR image using such data?

Static hdrplus binary by replace dcraw

Any ideas on how to replace dcraw in order to create a static hdrplus binary?

The dcraw binary location is hard wired into the code, so in order to create a static binary the dependency on dcraw would have to be removed or fully incorporated into the final binary itself.

How would one go about this?
If this is achieved we could then have pre-compiled binaries on the release page!

Observation on the hdrplus dataset

Hey !
Any idea why the photos taken by google cameras are much smaller in size compared to the others (LGE, motorola, huawei). All of them have the same resolution, dimensions and are 10bit right ?
Thanks

Color correction

Does anyone meet the problem with color correction? The output I got as .png format is so weird. I think it happens during tone mapping process.

pink image result of .DNG image format?

I use the ".DNG" format to test the code, and the result is a pink image(the width is bigger than height). Is anyone knows why?
By the way, the result of image format ".CR" is okay.

make err wit Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)

I get the following error when trying to cmake. my cmake version is 3.17.0 with MacOS 10.15.5
-- Using /Users/xxx/Documents/build/halide/bin/libHalide.dylib
-- PNG not found for _halide_library_from_generator_rungen; compiling with -DHALIDE_NO_PNG
-- Found tiffxx: /usr/local/lib/libtiffxx.dylib
CMake Error at /usr/local/Cellar/cmake/3.17.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.17.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.17.0/share/cmake/Modules/FindPNG.cmake:156 (find_package_handle_standard_args)
CMakeLists.txt:15 (find_package)

-- Configuring incomplete, errors occurred!
See also "/Users/xxx/Documents/build/hdr/CMakeFiles/CMakeOutput.log".

I already brew install libpng

the code does not implement the robust merge?

I stored the dng file after the "merge" step and found that shaking hands and shaking leaves were always ghosting, although every picture in my original dng file has no motion blur. This phenomenon is not as described by the author in his blog. I suspect that the robust merge part of the code is not implemented well. Isn't it ? @timothybrooks

make error

I get the following error when trying to make hdr+. my cmake version is 3.17.2

build git:(master) ✗ make
[ 17%] Built target align_and_merge.generator_library
[ 24%] Built target halide_library_runtime.generator_binary
[ 24%] Built target halide_rt_host_runtime_gen
[ 44%] Built target hdrplus_pipeline.generator_library
[ 51%] Built target hdrplus_pipeline.generator_binary
[ 55%] Built target hdrplus_pipeline_lib_gen
[ 58%] Building CXX object CMakeFiles/hdrplus.dir/src/InputSource.cpp.o
In file included from /Users/Projects/IQ/hdr-plus/src/InputSource.cpp:1:
In file included from /Users/Projects/IQ/hdr-plus/src/InputSource.h:5:
In file included from /usr/local/include/libraw/libraw.h:35:
/usr/local/include/libraw/libraw_datastream.h:121:8: warning: 'auto_ptr<std::__1::basic_streambuf<char> >' is deprecated
     [-Wdeprecated-declarations]
 std::auto_ptr<std::streambuf> f;       /* will close() automatically through dtor */
      ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2080:28: note: 'auto_ptr<std::__1::basic_streambuf<char> >' has been
     explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                          ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                     ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                              ^
In file included from /Users/Projects/IQ/hdr-plus/src/InputSource.cpp:1:
In file included from /Users/Projects/IQ/hdr-plus/src/InputSource.h:5:
In file included from /usr/local/include/libraw/libraw.h:35:
/usr/local/include/libraw/libraw_datastream.h:122:8: warning: 'auto_ptr<std::__1::basic_streambuf<char> >' is deprecated
     [-Wdeprecated-declarations]
 std::auto_ptr<std::streambuf> saved_f; /* when *f is a subfile, *saved_f is the master file */
      ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2080:28: note: 'auto_ptr<std::__1::basic_streambuf<char> >' has been
     explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                          ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                     ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                              ^
/Users/Projects/IQ/hdr-plus/src/InputSource.cpp:58:32: error: implicit instantiation of undefined template
     'std::__1::array<float, 4>'
std::array<float, 4> RawImage::GetBlackLevel() const {
                              ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                              ^
/Users/Projects/IQ/hdr-plus/src/InputSource.cpp:63:26: error: implicit instantiation of undefined template
     'std::__1::array<float, 4>'
   std::array<float, 4> black_level = {
                        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                              ^
2 warnings and 2 errors generated.
make[2]: *** [CMakeFiles/hdrplus.dir/src/InputSource.cpp.o] Error 1
make[1]: *** [CMakeFiles/hdrplus.dir/all] Error 2
make: *** [all] Error 2

Can you provide a simple example including commands and data to run the program?

I've compiled the program and copy some raw images in the build folder.

I first tried with CR2 images captured with my Cannon camera.

./hdrplus  . out.png  IMG_4548.CR2 IMG_4549.CR2 

Error message is

Input is not binary PGM

Then I tried using dng files from android phones:

./hdrplus  ./ out.png payload_N000.png payload_N001.dng  payload_N002.dng 

An error goes like

Input image './payload_N001.dng' has width 4208, but must must have width of 5796

I think there is something wrong with my data. So can you provide a simple example including commands and data to demonstrate usage of the program?

Thanks!

Pink image

Hi! The only result I can get is completely pink image, could you point out what I did wrong?

Incompatible with Halide 10.0.0

Halide 10.0.0 deprecated halide.cmake, so the installation doesn't work out of the box for Halide 10.0.0 when running the cmake command

Convert Code to python?

I was thinking about possibly converting the code to python. Does anyone have any idea of how one could do that?

Compilation issue: file not found: ./lib_halide_compiler_lib.a

When running make I get the following error.

[ 20%] Linking CXX executable halide_library_runtime.generator_binary
ld: file not found: ./lib_halide_compiler_lib.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [halide_library_runtime.generator_binary] Error 1
make[1]: *** [CMakeFiles/halide_library_runtime.generator_binary.dir/all] Error 2

Searching the web yields 0 results for lib_halide_compiler_lib.a, anywhere. I see three references to the file in various link.txt files on my PC. I successfully compiled halide prior to this, not sure what the issue is.

I'm using Mac OSX Catalina, clang 11.0.3, cmake 3.17.2, and the latest halide build. LLVM is 10.0.0.

Take RGB to sRGB conversion matrix from RAW instead of hardcoded one.

Color convertion matrix hardcoded into srgb function will result in wrong white balance for almost all cameras other than Canon 5D III that Timothy was used in his work.

We should instead use camera's auto white balance that provided in imgdata.color.rgb_cam field.

For rare cases when this field is not available for some reason it's probably it's worth to implement some white balance method (e.g. gray world, convolutional color constancy).

This issue related to #36

code building problem

Hi, Tim,

We try to compile the codes and find some problems with the Halide part.
We want to know what version of Halide used in the compilation of your codes,
so we can download the correct one.

Could you kindly provide the info?

Thank you

fix for darkareas missalignment

its simple but effective.
you have to add +64 to each input pixel and increase the blacklvl +64.
due that its easier for the algo to algin correct in dark areas, no more ghosting and visible tiles.

greets

how to determin wp & bp

since tone-mapping based on merged high dynamic results, a range of [bp, wp=1023] causes over-expo. According merged result in google hdr+ gallary , I get a large wp=16368 and it is not proper here, seems comes from algorithm difference.

I tried set different wp manually, for some cases, a wp value about 2500 seems better, far smaller than google merged results.

Wrong Halide Release

In the README.md file, it is specified to download the "2017-06-03" release of Halide. However, according to the historical release link, such release does not exists. The closest ones are:

  • 2017-10-30
  • 2017-05-03

Which release should be downloaded?

Thank you.

Move to cmake to improve compilation time

Hi,
currently when you change one file the compilation takes quite a lot, because of the way make file is written.
Have you considered moving to cmake?
I wrote a simple cmake file and here are results in terms of compilation speed when HDRPlus.cpp is changed:

current make

time make
g++ -O3 -g -Wall -std=c++11 HDRPlus.cpp align.cpp merge.cpp finish.cpp util.cpp -I/home/lamerman/work/hdr/halide//include -I/home/lamerman/work/hdr/halide//tools -lHalide -L/home/lamerman/work/hdr/halide//bin -lpng -o hdrplus

real    0m21.325s
user    0m20.300s
sys     0m0.972s

cmake (same compiler flags)

time make
Scanning dependencies of target hdrplus
[ 16%] Building CXX object CMakeFiles/hdrplus.dir/HDRPlus.cpp.o
[ 33%] Linking CXX executable hdrplus
[100%] Built target hdrplus

real    0m3.347s
user    0m3.064s
sys     0m0.228s

If it's fine for you I could provide a PR.

DngConverter not writing black level correctly

Hi, I'm running your latest version under ubuntu with google hdr+ official burst images, I tried to get raw align and merge result by running binary "stack_frames", the bursts of inputs have black level at 64 and white level at 1023, then I used an image previewing software to compare my output with the output of google group (offered together with the bursts), I found out that my output was visually more "purple" which I thought due to wrong black level in the .dng file. I checked the black_level array before TIFFSetField(tiff, TIFFTAG_BLACKLEVEL, 4, &black_level); but they were all set to 64 already. Then I set the output .dng as input and got, bl at 0 and wl at 1023 for my output, and bl at 1024 and wl at 16368 for google's output. Could you help me with that? Thank you.

Use RAW library to achieve automatic image property detection

Hi!

Regarding the following question in readme.md

³ I am looking into the program automaticly finding the width and height of the input photos. If you have any pointers please contact me.

I found several alternatives, that may help:

  1. Adobe DNG SDK, e.g.: https://github.com/aizvorski/dng_sdk
    1. + supports writing DNG
    2. + supports reading DNG OpCodes (e.g. GainMap for lens shading correction, WarpRectilinear for lens aberration correction, etc)
    3. - DNG only, but there are a lot of RAW2DNG converters
    4. - Has no official support for linux, but there are CMakeLists builds available on github
  2. LibRaw: https://www.libraw.org/
    1. Haven't tried, but supports a lot of proprietary RAW formats
  3. RawSpeed: https://github.com/darktable-org/rawspeed
    1. Haven't tried, but supports a lot of proprietary RAW formats

I have some experience with DNG SDK and can say that it does work well.

Also, there are LibExiv2 which allows to read metadata from DNG image format (which essentialy is TIFF), such as:

  1. image dimensions
  2. bits per sample
  3. kind of color filter array pattern
  4. camera color matrix
  5. camera white balance
  6. black, white level
  7. orientation
    that algorithm need for postprocessing aka finish.cpp.
    You could add libexiv2 in CMakeLists using the following command:
    find_package(Exiv2 REQUIRED)

But anyway, if you want to do lens shading correction, then you have to read GainMap from DNG or other raw format somehow

P.S. please feel free to edit header or issue text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.