DY112 / LSMI-dataset

[ICCV'21] Large Scale Multi-Illuminant (LSMI) Dataset for Developing White Balance Algorithm under Mixed Illumination
https://www.dykim.me/projects/lsmi
58 stars 3 forks source link

illum_map becomes ZERO in 2_preprocess_data.py due to alpha and chormacities #14

Closed CemEntok closed 4 months ago

CemEntok commented 1 year ago

Hello,

in preprocessing_data.py code, there is a LINE /

img_wb = img / illum_map 

This is given in the paper as

Iab(WB) = Iab / Lab where Lab is illum_map. [equation 1]

Illum map is calculated as alpha* La + (1-alpha)*Lb = Lab

In this case, if alpha = 0, then Lb = Lab

Lb is an RGB vector. In the case there is "zero" chromacity in even one channel of RGB, then Lb would have an element of "0", causing a zero division in [equation 1].

This issue is arising, for example, in galaxy dataset on illum_map[1143,376,2] pixel value which is the blue one,

How to overcome this issue? Should there be a workaround in calculating alpha, say, alpha cannot become 0, or should there be a minimum chromacity value in illuminant RGB vectors other than simply "0"?

Thanks!

DY112 commented 1 year ago

Hi, sorry for the late reply. First of all, Lb is the chromaticity of the light, not the pixel value of the image, so it is one of the Light1,2,3 values in meta.json.

However, in certain pixels, both _1 and _12 images have very dark objects, so the value of G pixel is all 0. For such pixels, the value of alpha and light is not calculable (0 / 0+0), and we consider those pixels as masked and GT is not calculable.