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

rgb to ycbcr formula coefficient problem. #3

Open
BarCodeReader opened this issue Apr 26, 2020 · 2 comments
Open

rgb to ycbcr formula coefficient problem. #3

BarCodeReader opened this issue Apr 26, 2020 · 2 comments

Comments

@BarCodeReader
Copy link

BarCodeReader commented Apr 26, 2020

hi, I checked your image transformation part in file utils.py
the formula for rgb to ycbcr image is a little different from Wikipedia:
yours:
y = 16. + (64.738 * img[..., 0] + 129.057 * img[..., 1] + 25.064 * img[..., 2]) / 256.
wiki:
y = 16. + (65.738 * img[..., 0] + 129.057 * img[..., 1] + 25.064 * img[..., 2]) / 256.

and actually in all of your implementations, you use 64.738.
i tested both and seems this minor difference does not affect the prediction accuracy...
but still, want to point out this and make this work better.

@kyz20
Copy link

kyz20 commented Apr 16, 2021

maybe an typing error, btw, did you have any color difference in you experiment?

@BarCodeReader
Copy link
Author

maybe an typing error, btw, did you have any color difference in you experiment?

i think the error is trivial and I did not observe a significant difference in the final result.

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

2 participants