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

I can not get the same value with matlab's #4

Open
spnova12 opened this issue Nov 5, 2018 · 5 comments
Open

I can not get the same value with matlab's #4

spnova12 opened this issue Nov 5, 2018 · 5 comments

Comments

@spnova12
Copy link

spnova12 commented Nov 5, 2018

I am using your code.
But i can not get the same psnr with matlab's.
This is my code (https://github.com/spnova12/get_set5_psnr)
If you do not mind, please check my code.
I also put the matlab code I used on github together.

@sliu729
Copy link

sliu729 commented Nov 16, 2018

Me too. The latest update results in different result when the target size is larger than the original.

@fatheral
Copy link
Owner

Dears spnova12, sliu729, thanks for your interest in my code.

Unfortunately, this code was implemented more than a year ago and can (and in the future definitely will) be not very correct due to the behavior of the new versions of Numpy as well as the new versions on MatLab (e.g. different ways of rounding, image processing etc).

But for this issue I will try to investigate if I have time (maybe the problem is indeed in the upscaling behavior only).

@sliu729
Copy link

sliu729 commented Nov 20, 2018

Dear fatheral,

Thanks for your reply.
Indeed, it will be interesting to have the updated version for python 3 and upscaling test.

Dears spnova12, sliu729, thanks for your interest in my code.

Unfortunately, this code was implemented more than a year ago and can (and in the future definitely will) be not very correct due to the behavior of the new versions of Numpy as well as the new versions on MatLab (e.g. different ways of rounding, image processing etc).

But for this issue I will try to investigate if I have time (maybe the problem is indeed in the upscaling behavior only).

@spnova12
Copy link
Author

Dear fatheral,

It would be appreciated if you could make this code more accurate.
In particular, I think this code will be the most important code linking MatLab to Python.

@cjsoft
Copy link

cjsoft commented Aug 14, 2019

conversion from RGB to YCbCr may contribute to the difference as well.
I was doing VDSR using Pillow to preprocess my data, and I encountered the same problem.
I used imresize in this repo and Matlab formula to convert from rgb to ycbcr manually, and achieved a very close result to the matlab version.
Or your can just copy this https://blog.csdn.net/Jee_King/article/details/88626917
if you r using cv2, dont forget to convert is to rgb first.

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

4 participants