timothybrooks / hdr-plus

HDR+ Implementation
MIT License
594 stars 201 forks source link

how to determin wp & bp #18

Closed porpalone closed 5 years ago

porpalone commented 6 years ago

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.

Trinkle23897 commented 6 years ago

dcraw -i -v xxx.dng

porpalone commented 6 years ago

@Trinkle23897 it does not work properly, for input dng files got a wp = 1023, however it seem small that often leave over-expo areas.

Trinkle23897 commented 6 years ago

google’s origin dng wp=1023, and after merging process, the algorithm outputs more percisely, so the wp in merge.dng is 16368, which is equal to 1023*16

KillerInk commented 6 years ago

its up to the bit depth of the input data. for 10bit 1023 work. for 12bit you have to shift it by <<2 (if upcasted from 10bit) for 14bit <<4 (if upcasted from 10bit)

same approach can get used for the blacklevel when its > 0

16bit breaks the algo and will cause clipping in high/lights due the merge buffer with 16bit.

Titaniumtown commented 5 years ago

It is the "Saturation" and "Darkness" numbers in the dcraw command output. The "Saturation" number is the "Wp" value, and the "Darkness" number is the "Bp" value. I also added this to the README file.

Ex. (The bold is where the important values are)

Loading Canon EOS DIGITAL REBEL XT image from 1.CR2 ... Scaling with darkness 255, saturation 4095, and multipliers 2.690726 1.000000 1.270038 1.000000 AHD interpolation... Converting to sRGB colorspace... Writing data to 1.tiff ...