up42 / image-similarity-measures

:chart_with_upwards_trend: Implementation of eight evaluation metrics to access the similarity between two images. The eight metrics are as follows: RMSE, PSNR, SSIM, ISSM, FSIM, SRE, SAM, and UIQ.
MIT License
550 stars 68 forks source link

is the RMSE wrong? #31

Closed lxc-love-zy closed 1 year ago

lxc-love-zy commented 2 years ago

I checked the RMSE computing process and it returns a mean, but it should be np.sqrt at last.

nikooc2s commented 2 years ago

Hey at line 37 we are doing the sqrt. The last mean you see is the mean for all bands.

nikooc2s commented 2 years ago

@chrieke can you close this? Unfortunately, I can't ....

Safiullahmarwat commented 2 years ago

I think RMSE is wrong. i is not used inside the for loop, which means that same operations are performed thrice. if you print(s) inside the for loop, the results is same for each channel. I further checked with the RMSE equation np.sqrt(((img1- img2) ** 2).mean()) and sklearn.metrics.mean_squared_error and found that these results are different than rmse of this package.

nekhtiari commented 2 years ago

Oh that is true, since here we still had the i in the calculation. Not sure what removed it. Will make a PR. Thanks for the catch.

chrieke commented 1 year ago

Fixed in https://github.com/up42/image-similarity-measures/pull/37