

Look much better than Pang's method and it is fast.




Intensity=128























It turns out we can use the same function for weight calculations because we are choosing the distance between two ends to sort the orders. There are something I am not sure if I am doing correctly. First, I always maintain the updated value(maybe called intensity) in the range 0 to 255. If it is more than 255 or less than 0, the leftout(residue) will transport to the next chosen pixel. Second, the decision of black or white pixels are affected by both the current intensity and the carry-on residue from last chosen pixels.


maxin = max(0.5,(Ii/(5*pow(r,3.0f))-Ii/(50*pow(r,3.0f)));.jpg)
maxin = max(0.5,(Ii/(5*pow(r,2.0f))));