GuoShi28 / CBDNet

Code for "Toward Convolutional Blind Denoising of Real Photographs", CVPR 2019
Apache License 2.0
499 stars 92 forks source link

Fixing the size of the noise_c_map #10

Closed Shakarim94 closed 5 years ago

Shakarim94 commented 5 years ago

noise_c_map didn't contain the channel dimension and the 'Test_Realistic_Noise_Model.m' didn't run on the given colored image

GuoShi28 commented 5 years ago

Thank you for your careful check. However, in the original code, we have considered the color image channels and the noise generation demo works fine on my computer. In line 47, we define three noise level for each channel. you can re-check and run the code. If I have some mistake, I would love to merge your code in CBDNet repository.

Shakarim94 commented 5 years ago

Ok, I am little confused and want to clarify some things.

1) In the 'AddNoiseMosai.m' function if we don't specify sigma_c and sigma_s they are created automatically and each of them are 1x3 vectors, so each channel has its own noise level. However, if I just run the 'Test_Realistic_Noise_Model.m' code, sigma_c and sigma_s are only scalars. Therefore, noise_c_map had only one channel 421x381x1, and I hade size mismatch on line 63 of 'AddNoiseMosai.m'. So I think the lines 26 and 27 in 'Test_Realistic_Noise_Model.m' should be changed so that sigma_c and sigma_s are 1x3 vectors.

2) Now I am confused with 'L'? I thought it was luminance which doesn't have any color information (only one channel), then we apply Bayer filter and then demosaicing to obtain sRGB image. But turns out the 'L' is written as irradiance in the paper and it has 3 channels? P.S. I am aware that there is a mistake in equation 1, x should be replaced with L.

GuoShi28 commented 5 years ago
  1. I find my mistake. You are right the sigma setting in the demo is incorrect. It's my fault.
  2. L is the irradiance of image x. L = f^-1(x). The mistake in equation 1 will be corrected in new version of the paper. Thank you for your help.
Shakarim94 commented 5 years ago

Thank you very much for clarifications!