alex04072000 / SingleHDR

[CVPR 2020] Single-Image HDR Reconstruction by Learning to Reverse the Camera Pipeline
546 stars 91 forks source link

Which tone mapping algorithm did you use? #27

Closed UdonDa closed 3 years ago

UdonDa commented 3 years ago

Hi, @alex04072000

I try to reproduce to visualize HDR images with the HDR-Eye dataset. However, I can not get the same results...

Please tell me which tone mapping algorithm you did?

Examples. Use mu_law (below codes) ours

Use Photomatix スクリーンショット 2021-09-01 2 45 00

Your result ours

Codes.

import numpy as np
import cv2

def mu_law(x, mu=10.):
    return np.log(1.0 + mu * x) / np.log(1.0 + mu)

def log(x):
    return np.log(x)

def main():

    FILENAME = 'gt'

    HDR_PATH  = f'/src/00004/{FILENAME}.hdr'

    img = cv2.imread(HDR_PATH) / 255.

    img = mu_law(img)
    # img = log(img)

    print(img.shape, img.max(), img.min())
    cv2.imwrite(f'./{FILENAME}.jpg', img * 255.)

if __name__ == '__main__':
    main()
alex04072000 commented 3 years ago

Hi @UdonDa , We use the 'Vibrant' tone-mapping preset in Photomatix 6.0. You can find the tone-mapping setting file in [path_of_photomatix]/BuiltinPresets/Vibrant.xmp. Thank you!

UdonDa commented 3 years ago

Hi, @alex04072000 Thanks! I can reproduce the result! Thank you!!