-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overflow in PSNR computation #288
Comments
@Yshuo-Li pls check if there are corner cases, and fix & add unittest if it is true |
@incenger , thank you for your reminder, I will fix this issue later. |
@Yshuo-Li Yes, I only found this issue when using the function on my own code :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the function to compute PSNR score, if the two input image arrays of type
np.unint8
, using(img1 - img2)**2
can overflow. This causes incorrect PSNR evaluation result, especially when calling the function withoutconvert_to="Y"
argument. I think this could be fixed by either explicitly converting the input images into float type or adding the data type requirement into the document.The text was updated successfully, but these errors were encountered: