Why is DGI calculated by evalglare a negeative?

I use evalglare to calculate the glare metrics for a series of HDR images, but sometimes DGI is a negeative when daylight condition is bad. For example, DGI is -4.23 for below image, which is very strange.

If you check the equation of DGI you will see, that a logarithmic function is used - that delivers negative values when applied to values between 0 and 1. For sure a negative value does not make sense, but the equation is as it is - exactly for that reason the DGP equation uses the "1+ " in the contrast term before applying the logarithmic function.
In your case you have no glare for sure. Just be aware that the glare detection mode influences a lot in such situations the calculation of the purely contrast based metrics like DGI,UGR, UGP. In case you use one of the latest versions of evalglare (I guess it is still 2.08, check with evalglare -v), it uses as default a threshold of 2000cd/m2. It does not mean that every patch >2000cd/m2 is also perceived as a glare source per se. I would rather say such pixels/patches are “potential glare sources” and it depends on the metrics’ sensitivity who strong they are weighted. In case you change this threshold or method (e.g. task based one or average luminance) you will get significantly different values for the contrast based metrics, even if the “potential glare sources” still look reasonable (you should check them by using the -d option and also by visualizing with -c ).
This problematic (which you can already see looking at the equations) was a reason why the DGP equation is as it is - less sensitive to such non-important glare sources. As a drawback, DGP is not sensitive enough for dim light situations (e.g. location away from facade in deep openplan offices - but there will be an update probably next year).
So as summary: Yes, DGI can be negative, but check your glare detection mode if it fits to your configuration (and check that you use the latest evalglare version).
cheers
Jan

1 Like