YUVtoRGB RGB to YUV color convert formulas - ITU 601

1.  for computer system, the YUV and RGB range are  [0~255] using 8bit to show. 


int clip_int ( int value ) { return (value > 255) ? 255 : (value <0) ? 0 : value; }


     RGB to YUV:

     


   

    int y = clip_int(y);

    int u = clip_int(u);

    int v = clip_int(v);


     using the float , the RGB to YUV convert formula :

     iy = (65.738 * r + 129.057*g + 25.064*b) / 256 + 16;

     iu = (-37.945*r - 74.494*g + 112.439*b) / 256 + 128;

     iv = (112.439*r - 94.154*g - 18.285*b) / 256 + 128;

     

     or 

     y = (0.2568*r + 0.5041*g + 0.0979*b) + 16;

     u = (-0.1482*r - 0.2910*g + 0.4392*b) + 128;

     v = (0.4392*r -0.3678*g - 0.0714*b) + 128;




计算机中可以使用


2. YUV to RGB

     r = 1.1644*y + 1.5960*v - 16;

     g = 1.1644*y - 0.3918*u - 0.8130*v - 128;

     b = 1.1644*y + 2.0172*u   - 128;






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

coloriy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值