The RGB to YCbCr formula

本文深入探讨了颜色图像处理中从RGB到YCbCr颜色空间的转换过程及其背后的原因,解释了人类视觉系统对亮度和颜色的感知差异,并介绍了不同颜色空间转换对图像压缩和处理的影响。主要关注了RGB到YCbCr转换的数学公式、不同颜色空间的采样率以及其在图像编码和处理中的应用,特别强调了在医疗图像分析、视频压缩和数字图像处理等领域的重要性。

Why the RGB to YCbCr

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/

转载于:https://www.cnblogs.com/artestlove/p/4664026.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值