Why the RGB to YCbCr formula

Why the RGB to YCbCr

6 Replies

We saw in the earlier post, Bitmap images used the R-G-B planes directly to represent colour images. But medical research proved that the human eye has different sensitivity to colour and brightness. Thus there came about the transformation of RGB to YCbCr.

Y: Luminance; Cb: Chrominance-Blue; and Cr: Chrominance-Red are the components. Luminance is very similar to the grayscale version of the original image. Cb is strong in case of parts of the image containing the sky (blue), both Cb and Cr are weak in case of a colour like green, and Cr is strong in places of occurrence of reddish colours.

The main question that comes to mind, is why this transformation. Medical investigation of the eye has led to findings that the rods some 120 million in number, are much more sensitive than the cones which are around 6-7 million in number. The rods are not sensitive to colour, while the cones which provide much of the eye’s colour sensitivity are found to be located close to a central region called the macula.

Well, the point of all this is that, we really do not need to keep all the information that is now represented in these colour frames (Cb and Cr) and thus these are usually sub-sampled (like in JPEG compression). The formulae for converting from RGB to YCbCr are given below.

Y = (77/256)R + (150/256)G + (29/256)B
Cb = ‐(44/256)R ‐ (87/256)G + (131/256)B + 128
Cr = (131/256)R ‐ (110/256)G ‐ (21/256)B + 128

The down-sampling of chrominance is done in 2 major variants used for most of the codecs.

  • 4:4:4 – In this, there is no sub-sampling of the
    chroma components, and can be as well referred and used directly as a
    RGB image. High-end scanners / cameras / capture devices use this format
    to not lose any data.
  • 4:2:2 – The chroma components are horizontally
    sub-sampled and their resolution is halved as compared to the luminance
    counterpart in this scheme. High-end digital video formats and still
    images generally employ this scheme.
  • 4:2:0 – In this variant, the chroma components are
    sub-sampled by a factor of 2, both horizontally as well as vertically,
    thus reducing to a factor of a quarter. The standard video compression
    MPEG uses this scheme.

This now prepares us to face the first steps in most compression techniques, the colour space transform followed by downsampling.

http:https://makarandtapaswi.wordpress.com/2009/07/20/why-the-rgb-to-ycbcr/

时间: 2024-10-11 16:13:28

Why the RGB to YCbCr formula的相关文章

RGB 与 (RGB转 YCbCr再转为 RGB)的图像

RGB 与 (RGB转 YCbCr再转为 RGB)的图像   不可逆,可以从 矩阵的逆运算看出来. 附上 matlab 代码: clc,clear; Source=imread('1.jpg');%读入原始RGB图像 figure(1); subplot(1,2,1); imshow(Source):title('original image');%显示图像 [r c d]=size(Source);%计算图像大小 %------计算红色分量并显示分解图------% R(:,:,1)=Sour

RGB与YCbCr颜色空间的互相转换公式

http://blog.csdn.net/a14730497/article/details/17886127 Y:明亮度(Luminance或Luma),也就是灰阶值.“亮度”是透过RGB输入信号来建立的,方法是将RGB信号的特定部分叠加到一起. Cb:反映的是RGB输入信号蓝色部分与RGB信号亮度值之间的差异.Cr:反映了RGB输入信号红色部分与RGB信号亮度值之间的差异. 在以下两个公式中RGB和YCbCr各分量的值的范围均为0-255. RGB转换为YCbCr Y   = 0.257*R

灰度转换(2):RGB转YCbCr转Gray

YCbCr 一.YCbCr介绍 啊 二.MATLAB实现 简单 1 clc; 2 clear all; 3 RGB = imread('flower.bmp'); %读取图像 4 5 R = RGB(:,:,1); %R分量 6 G = RGB(:,:,2); %G分量 7 B = RGB(:,:,3); %B分量 8 9 [ROW,COL,N] = size(RGB); %获得图像尺寸[高度,长度,维度] 10 for i = 1:ROW 11 for j = 1:COL 12 Y(i,j)

RGB,YCBCR在HDMI传输线是数据排列

RGB4:4:4 YCbCr4:4:4 YCbCr4:2:2 YCbCr4:2:0 原文地址:https://www.cnblogs.com/zhongguo135/p/9451827.html

RGB颜色空间与YCbCr颜色空间的互转

在人脸检测中会用到YCbCr颜色空间,因此就要进行RGB与YCbCr颜色空间的转换.在下面的公式中RGB和YCbCr各分量的值的范围均为0-255. RGB转到YCbCr: float y= (color.r * 0.256789 + color.g * 0.504129 + color.b * 0.097906)+ 16.0; float cb= (color.r *-0.148223 + color.g * -0.290992 + color.b * 0.439215)+ 128.0; fl

matlab公共函数之RGB与YUV转换

matlab中有自带的rgb转ycbcr函数,但是根据观测,其Y的值为[16 235],不符合我们的要求,所以,提供另一种规范下的转换脚本函数,其Y的值满足[0 255] RGB转YUV % function yuv = myrgb2yuv(image) % input params. % image: input color image with 3 channels, which value must be [0 255] % output % yuv: 3 channels(YUV444,

YUV / RGB 格式及快速转换算法

1 前言 自然界的颜色千变万化,为了给颜色一个量化的衡量标准,就需要建立色彩空间模型来描述各种各样的颜色,由于人对色彩的感知是一个复杂的生理和心理联合作用 的过程,所以在不同的应用领域中为了更好更准确的满足各自的需求,就出现了各种各样的色彩空间模型来量化的描述颜色.我们比较常接触到的就包括 RGB / CMYK / YIQ / YUV / HSI等等. 对于数字电子多媒体领域来说,我们经常接触到的色彩空间的概念,主要是RGB , YUV这两种(实际上,这两种体系包含了许多种具体的颜色表达方式和模

算法优化:rgb向yuv的转化最优算法

朋友曾经给我推荐了一个有关代码优化的pdf文档<让你的软件飞起来>,看完之后,感受颇深.为了推广其,同时也为了自己加深印象,故将其总结为word文档.下面就是其的详细内容总结,希望能于己于人都有所帮助. 速度取决于算法 同样的事情,方法不一样,效果也不一样.比如,汽车引擎,可以让你的速度超越马车,却无法超越音速:涡轮引擎,可以轻松 超越音障,却无法飞出地球:如果有火箭发动机,就可以到达火星. 代码的运算速度取决于以下几个方面 1.  算法本身的复杂度,比如MPEG比JPEG复杂,JPEG比BM

LCD接口和RGB介绍

1. 介绍 Video的显示离不开LCD, 所以这里简单介绍一下LCD的接口和RGB LCD的全称是Liquid Crystal Display 的简称, 即液晶显示器LCD目前已经取代CRT, 成为TV.PC等的标配 RGB是 2. 接口类型 首先我们以传递的信号类型来区分主要有两大类:- 模拟信号:    - VGA: Video Graphics Array- 数字信号   - TTL: Transistor Transisor Logic   - LVDS: Low Voltage Di