alex04072000 / SingleHDR

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

Question about HDR-VDP-2 scores #4

Closed 114569 closed 4 years ago

114569 commented 4 years ago

Thank you for your work. I have a question about HDR-VDP-2 scores.

I have tried to get HDR-VDP-2 scores with given HDR-eye results in your project website, but i can't get 53.16 scores in paper. Could you tell me how can i get the same result as paper?

Here is the code i used.

reference = hdrimread(reference_path);
test = hdrimread(test_path);

1. res = hdrvdp(reference, test, 'rgb-bt.709', 30);
2. ppd = hdrvdp_pix_per_deg( 24, [512 512], 0.5 );
    res = hdrvdp(reference, test, 'rgb-bt.709', ppd);
alex04072000 commented 4 years ago

Hi @114569 , Please refer to the following code and see if you can get similar HDR-VDP-2 scores in the paper.

test_hdr = hdrimread(test_path);

test_hdr = pre_hdr_p3(test_hdr);
ref_hdr  = pre_hdr_p3(ref_hdr);

res = hdrvdp(test_hdr, ref_hdr, "rgb-bt.709", 30);

function hdr = pre_hdr_p3(hdr)
    eps = 1e-8;
    s = size(hdr(:), 1);
    k = int64(s*1e-3);
    a = mink(hdr(:), k);
    a = a(end);
    b = maxk(hdr(:), k);
    b = b(end);
    c = 1.0;
    d = 999.0;
    hdr = (hdr - a).*(d - c)./(b - a + eps) + c;
    hdr(hdr < 0) = 0;
end

Function pre_hdr_p3 is the normalization step we mention in the paper to roughly align two HDR images.

114569 commented 4 years ago

Thanks a lot! I got HDR-VDP-2 score like this.

mean : 47.58 std : 16.84

I think std is high. Do i need to change some parameters in 'hdrvdp_parse_options'?

alex04072000 commented 4 years ago

Hmm... weird. Are you using the original matlab code of HDR-VDP 2.2.1?

alex04072000 commented 4 years ago

BTW, you also need to get res.Q to get the averaged HDR-VDP-2 Q score of the entire image.

114569 commented 4 years ago

I've been used HDR-VDP 2.0. When i used HDR-VDP 2.2.1, i got result like this.

mean : 53.16, std : 5.91

Thanks!

cctakaet commented 4 years ago

Hi @alex04072000 , I want to ask how to generate tone mapped images. Do I need to align two HDR images by pre_hdr_p3 before tone mapping? Or I can directly apply tone mapping on the HDR images which you provided? How do you generate the LDR 'ours.jpg'? Thanks you.