yjn870/FSRCNN-pytorch

rgb to ycbcr formula coefficient problem.

BarCodeReader opened this issue · 2 comments

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 commented

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

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.