The YCbCr to RGB formula

 

  RGB2YCbCr conversions,the range is RGB[0,255] to YCbCr[0,255] : 

    Y  = R *  0.301 + G *  0.586 + B *  0.113
    Cb = R * -0.168 + G * -0.332 + B *  0.500 + 128
    Cr = R *  0.500 + G * -0.417 + B * -0.082 + 128

When the Y range of [0,255],UV range of [0,255],the YCbCr to RGB formula is : R = Y + + (Cr - 128) * 1.40200 G = Y + (Cb - 128) * -0.34414 + (Cr - 128) * -0.71414 B = Y + (Cb - 128) * 1.77200

 When the Y range of [16,235],UV range of [16,240],the YCbCr to RGB formula is :

  R = (Y - 16) * 1.164 + (Cr - 128) * 1.596
G = (Y - 16) * 1.164 - (Cr - 128) * 0.813 - (Cb - 128) * 0.391
B = (Y - 16) * 1.164 + (Cb - 128) * 2.081

If you have any question,you can leave a message for me.
 
原文地址:https://www.cnblogs.com/artestlove/p/4674031.html