RGB、YUV和YCbCr介绍【转】
RGB:
就是常说的红(Red)、绿(Green)和蓝(Blue),每个图像的像素点由RGB三个通道的值组成。
YUV和YCbCr:
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'
YCrCb与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与YCbCr的来源和用途:
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。
转自:http://blog.csdn.net/sunshine1314/article/details/612485