Skip to content
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

Results are significantly different compared to ffmpeg implementation of SSIM and PSNR #28

Open
ichlubna opened this issue Jul 12, 2021 · 8 comments

Comments

@ichlubna
Copy link

I've noticed that the SSIM and PSNR values are much higher when using your tool than when trying ffmpeg method such as:
ffmpeg -i first.png -i second.png -lavfi ssim -f null -
Why is that?
Thanks for the tool anyway ^_^.

@sfalkena
Copy link

sfalkena commented Jul 14, 2021

Hi, I noticed this at first as well. It most certainly has to do with the data range that is being used in calculating the values. As a standard in this tool the value is set to 12 bits (4095) (check implementation here. I am not sure what ffmpeg uses, but I suspect it finds it from the datatype of the images. Hope this helps!

@ichlubna
Copy link
Author

ichlubna commented Jul 14, 2021

the value is set to 12 bits (4095)

Hmm would be nice to be able to change it as an argument or to have an automatic detection then. Otherwise the tool can't be really used when comparing for example compression methods etc. with already published results. Thanks for the answer anyway!

@nekhtiari
Copy link
Owner

@sfalkena thanks for the explanation. that is the reason for your inconsistent result @ichlubna. Fair point and nice suggestion, I will make a PR to make this a flexible argument.

@nekhtiari
Copy link
Owner

Sorry for taking this so long. Unfortunately, I am a bit busy at the moment with other projects. So it might take some time I can get back to this. In the meantime feel free to contribute or make PR if you feel like it. I would be more than happy :)

@lumiaxth
Copy link

Hi, can I ask that ffmpeg's results are reliable? Thx for your attention!

@ichlubna
Copy link
Author

Hi, can I ask that ffmpeg's results are reliable? Thx for your attention!

I took ffmpeg as a generally accepted and widely used tool even among scientific community. Do you think the results are not correct? They were usually according to my expectations when I used it.

@lumiaxth
Copy link

Hi, can I ask that ffmpeg's results are reliable? Thx for your attention!

I took ffmpeg as a generally accepted and widely used tool even among scientific community. Do you think the results are not correct? They were usually according to my expectations when I used it.

Ok, got it. I'm new here, so I feel confused about two different data. Thanks for your kind reply!

@grapemaidaa
Copy link

What's "the value is set to 12 bits (4095)" mean?
And where should I set it in this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants