So I have this original image:
Then I have it's YDbDR conversion:
it's separated by red, blue and green channels which I know aren't equivalent to YDbDr, but should give a good general gauge on whether the channels have been converted correctly. As you can see Db and Dr equivalently are heavily pixelated when they shouldn't be.
Here's the code:
def RGB_to_YDbDr(obs_RGB):
r = obs_RGB[:, 0]
g = obs_RGB[:, 1]
b = obs_RGB[:, 2]
y = 0.299 * r + 0.587 * g + 0.114 * b
db = -0.450 * r + -0.883 * g + 1.333 * b
dr = -1.333 * r + 1.116 * g + 0.217 * b
return torch.stack([y, db, dr], -3)
I followed Kornia augmentation library's code for RGB to YCbCr to implement RGB to YDbDr. What did I do wrong? Why does Db and Dr look so pixelated? The input images are 100 x 100.
Note:
I tried kornia.color.rgb_to_ycbcr
and got this:
Also seems very heavily pixelated