sooyekim / Deep-SR-ITM

Official repository of Deep SR-ITM (oral at ICCV 2019)
101 stars 16 forks source link

About the comparison with existed methods. #14

Closed chxy95 closed 3 years ago

chxy95 commented 4 years ago

Hello, I noticed that the compared methods in the paper are HDRi ITM methods, and as far as I know these methods will generate HDR images of '.hdr' format with RGBE encoding. I can't make sure if there exists some problems. If not, I want to know how to compare outputs by these methods with RGBE encoding and outputs of this work. Thanks!

sooyekim commented 4 years ago

Hi @chxy95 ,

Thanks for the interest in our work!

You're right that the existing methods would generate .hdr raw images in the luminance domain.

In our case, for comparison, we converted the color container from BT.709 to BT.2020, then applied PQ-OETF on the linear RGB 2020 values, after obtaining the .hdr files. Finally, the RGB values were converted to YUV (according to the conversion equation for BT.2020 color container).

You could refer to the diagram in Fig. 2 (a) of our paper, with details in Sec. 4.5. Please let me know if you have any other issues!

Thanks, Soo Ye

fanld commented 4 years ago

Hi @chxy95 ,

Thanks for the interest in our work!

You're right that the existing methods would generate .hdr raw images in the luminance domain.

In our case, for comparison, we converted the color container from BT.709 to BT.2020, then applied PQ-OETF on the linear RGB 2020 values, after obtaining the .hdr files. Finally, the RGB values were converted to YUV (according to the conversion equation for BT.2020 color container).

You could refer to the diagram in Fig. 2 (a) of our paper, with details in Sec. 4.5. Please let me know if you have any other issues!

Thanks, Soo Ye

Hello, after the existing methods and obtaining the .hdr files, how to convert the color container from BT.709 to BT.2020? Thanks.

sooyekim commented 4 years ago

Hi @chxy95 ,

You could refer to the Common Test Conditions for HDR/WCG Video Coding Experiments document officially released by MPEG. In section 4.11.3 they've specified the conversion matrix of going from BT.709 to BT.2020, which converts the RGB primaries of the color values.

In MATLAB code, this would look something like:

function [ RGB2020 ] = ColorConv( RGB709 )

M1=[0.6370 0.1446 0.1689;
    0.2627 0.6780 0.0593;
    0.0000 0.0281 1.0610];
M2=[0.4124 0.3576 0.1805;
    0.2126 0.7152 0.0722;
    0.0193 0.1192 0.9505];
M3=M1\M2;

RGB2020=RGB709;
RGB2020(:,:,1)=M3(1,1) * RGB709(:,:,1) + M3(1,2) * RGB709(:,:,2) + M3(1,3) * RGB709(:,:,3);
RGB2020(:,:,2)=M3(2,1) * RGB709(:,:,1) + M3(2,2) * RGB709(:,:,2) + M3(2,3) * RGB709(:,:,3);
RGB2020(:,:,3)=M3(3,1) * RGB709(:,:,1) + M3(3,2) * RGB709(:,:,2) + M3(3,3) * RGB709(:,:,3);

RGB2020=RemoveSpecials(RGB2020);

end

where RemoveSpecials is a function in the HDR Toolbox, defined as:

function img = RemoveSpecials(img, clamping_value)
%
%
%       img = RemoveSpecials(img, clamping_value)
%
%       This function removes specials: Inf and NaN
%
%       Input:
%           -img: an image which can contain float special values
%           -clamping_value:
%
%       Output:
%           -img: the image without float special values
%
%     Copyright (C) 2011-15  Francesco Banterle
% 
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
%

if(~exist('clamping_value', 'var'))
    clamping_value = 0;
end

img(isnan(img) | isinf(img)) = clamping_value;

end

Let me know if you have any other issues!

Best, Soo Ye

fanld commented 4 years ago

Hi @chxy95 ,

You could refer to the Common Test Conditions for HDR/WCG Video Coding Experiments document officially released by MPEG. In section 4.11.3 they've specified the conversion matrix of going from BT.709 to BT.2020, which converts the RGB primaries of the color values.

In MATLAB code, this would look something like:

function [ RGB2020 ] = ColorConv( RGB709 )

M1=[0.6370 0.1446 0.1689;
    0.2627 0.6780 0.0593;
    0.0000 0.0281 1.0610];
M2=[0.4124 0.3576 0.1805;
    0.2126 0.7152 0.0722;
    0.0193 0.1192 0.9505];
M3=M1\M2;

RGB2020=RGB709;
RGB2020(:,:,1)=M3(1,1) * RGB709(:,:,1) + M3(1,2) * RGB709(:,:,2) + M3(1,3) * RGB709(:,:,3);
RGB2020(:,:,2)=M3(2,1) * RGB709(:,:,1) + M3(2,2) * RGB709(:,:,2) + M3(2,3) * RGB709(:,:,3);
RGB2020(:,:,3)=M3(3,1) * RGB709(:,:,1) + M3(3,2) * RGB709(:,:,2) + M3(3,3) * RGB709(:,:,3);

RGB2020=RemoveSpecials(RGB2020);

end

where RemoveSpecials is a function in the HDR Toolbox, defined as:

function img = RemoveSpecials(img, clamping_value)
%
%
%       img = RemoveSpecials(img, clamping_value)
%
%       This function removes specials: Inf and NaN
%
%       Input:
%           -img: an image which can contain float special values
%           -clamping_value:
%
%       Output:
%           -img: the image without float special values
%
%     Copyright (C) 2011-15  Francesco Banterle
% 
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
%

if(~exist('clamping_value', 'var'))
    clamping_value = 0;
end

img(isnan(img) | isinf(img)) = clamping_value;

end

Let me know if you have any other issues!

Best, Soo Ye

Your reply is extremely clear. Thanks very much.