timothybrooks / hdr-plus

HDR+ Implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

TomHeaven opened this issue · comments

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!

your inputdata is ok.
your first problem is caused by the powershell and dcraw.
using the powershell(wich happen when the dcraw command get executed) creates a PGM file with wrong encoding(powershell use unicode, but pgm should be in ascii).
my workaround on windows is to use libraw for reading. its a bit overdone but it handels all different input formats equal if the file is 10,12,or 14bit.

your second problem is caused due the algo itself. its expected that the width is bigger then height.

Thank you for the suggestions. I'll try using libraw. B.T.W, I'm running on Mac OS :)

you can simple check it, set a break point where the pgm header gets loaded.
https://github.com/timothybrooks/hdr-plus/blob/master/src/halide_load_raw.h#L59
if it cointains P5 everything is ok. if you get þÿPþÿ5 or simliar its in unicode.

You can also try to dump the file from the PipeOpener and diff it with a direct dcraw output.
direct dcraw output is in ascii. with the pipeOpener the system encoding get used.

What about the "options" the compiled program mentions.
Output of program:
./hdrplus [options] dir_path out_img raw_img1 raw_img2 [...]

I am including some instructions on my pull request! https://github.com/timothybrooks/hdr-plus/pull/33 But I don't know what "options" is, as mentioned above.

[options] is a placeholder for setting any optional flag. This may be more clear:
./hdrplus [-c comp -g gain] dir_path out_img raw_img1 raw_img2 [...]

Note that -c and -g flags allow you to change the amount of dynamic range compression and gain, respectively, and are optional since they both have default values. Other options could be added as flags here as well.

I added usage information in the README; in turn this issue should be resolved!