一、和rgb之间换算公式的差异 yuv<-->rgb Y'= 0.299*R' + 0.587*G' + 0.114*B' U'= -0.147*R' - 0.289*G' + 0.436*B' = 0.492*(B'- Y') V'= 0.615*R' - 0.515*G' - 0.100*B' = 0.877*(R'- Y') R' = Y' + 1.140*V' G' = Y' - 0.394*U' - 0.581*V' B' = Y' + 2.032*U' yCbCr<-->rgb Y’ = 0.257*R' + 0.504*G' + 0.098*B' + 16 Cb' = -0.148*R' - 0.291*G' + 0.439*B' + 128 Cr' = 0.439*R' - 0.368*G' - 0.071*B' + 128 R' = 1.164*(Y’-16) + 1.596*(Cr'-128) G' = 1.164*(Y’-16) - 0.813*(Cr'-128) - 0.392*(Cb'-128) B' = 1.164*(Y’-16) + 2.017*(Cb'-128) Note: 上面各个符号都带了一撇,表示该符号在原值基础上进行了gamma correction
二、来源上的差异 yuv色彩模型来源于rgb模型, 该模型的特点是将亮度和色度分离开,从而适合于图像处理领域。 应用:basic color model used in analogue color TV broadcasting.
YCbCr模型来源于yuv模型。YCbCr is a scaled and offset version of the YUV color space. 应用:数字视频,ITU-R BT.601 recommendation
ps: 通过上面的比较可以确定,我们在h.264,mpeg等编码标准中用的yuv其实是YcbCr,大家不要被名称搞混淆了 |