The interaction between RGB color space and YCbCr color space

Source: Internet
Author: User

YCbCr color space is used in face detection, so the conversion of RGB and YCBCR color space is necessary. In the following formula, the values of the RGB and YCBCR components are in the range of 0-255.

RGB Go to 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;

Float cr= (COLOR.R * 0.439215 + color.g * -0.367789 + color.b *-0.071426) + 128.0;

YCbCr go to RGB:

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)

The interaction between RGB color space and YCbCr color space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.