Nguyen-Hoang-Nam / image-enhancement

🌈 Library to enhance image
MIT License
45 stars 8 forks source link

a little problem about AGCWD #7

Open 8067222151 opened 9 months ago

8067222151 commented 9 months ago

Hello, thank you for pointing out the discrepancy in the implementation of the AGCWD algorithm. there is a difference between the code and the original description in the paper. In the AGCWD algorithm, the weight_distribution_scale is obtained by normalizing the weight_distribution after it has been cumulatively summed. your code is : weight_distribution_scale = weight_distribution / weight_distribution_sum I think it should be: weight_distribution_scale = np.cumsum(weight_distribution) / np.sum(weight_distribution)

thank you!

Nguyen-Hoang-Nam commented 9 months ago

Hi @8067222151,

I gave the paper a quick look and my code seems okay. Can you share some details about your approach.

weight_distribution = highest_probabilitiy * ((pdf - lowest_probability) / (highest_probabilitiy - lowest_probability)) ** alpha
weight_distribution_sum = np.sum(weight_distribution)

weight_distribution_scale = weight_distribution / weight_distribution_sum

image

Best Regard,