LSMI-dataset icon indicating copy to clipboard operation
LSMI-dataset copied to clipboard

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

Open CemEntok opened this issue 1 year ago • 1 comments

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!

CemEntok avatar Sep 22 '23 12:09 CemEntok