Hey,
In ntigo method, it the contrast estimation is based on the formulat : -50+log10((FG_mean-FG_std)/)BG_mean-BG_std)
in the situation where we have a 100% black foreground, it raise an error ( log(0) ), i checked the article, from my understanding they said to use in the extreme case to put FG_mean-FG_std = 2.5, you can check it for more credit:
here is the proposed solution.
if not (FG_avg + FG_std) == 0:
C = -50 * np.log10((FG_avg + FG_std) / (BG_avg - BG_std))
k = -0.2 - 0.1 * C / 10
else :#This is the extreme case when the FG is 100% black, check the article explaination page before equation 5
C = -50 * np.log10((2.5) / (BG_avg - BG_std))
k = -0.2 - 0.1 * C / 10
PS : i ll do a push request as soon as i can, sorry for that
Hey, In ntigo method, it the contrast estimation is based on the formulat : -50+log10((FG_mean-FG_std)/)BG_mean-BG_std) in the situation where we have a 100% black foreground, it raise an error ( log(0) ), i checked the article, from my understanding they said to use in the extreme case to put FG_mean-FG_std = 2.5, you can check it for more credit: here is the proposed solution.
PS : i ll do a push request as soon as i can, sorry for that