I am reading this paper for enhancing image quality. my problem is that when I am calculating weighted CDF, I always get 1 as output. here is the sequence of for