1 YUVformat andRGBFormat Description
Due to the different image formats supported by TV signal systems in different countries, there are YUV Format Imaging and RGB format imaging, so in order to ensure compatibility, RGB and Interactive transfer in YUV format.
In addition , YUV format has the characteristics of luminance information and color information separation, but most image processing operations are based on RGB format , need to convert RGB format to YUV format. And when the image is later displayed, you need to convert YUV to an RGB domain.
2 RGBformat toYUVFormat Conversion Formula
The above matrix multiplication is expanded, andYUV ( level ) can be calculated directly from 8 -bit RGB as follows:
Y = 0.299 R + 0.587 G + 0.114 B
U =-0.1687 R-0.3313 G + 0.5 B + 128
V = 0.5 R-0.4187 G-0.0813 B + 128
3 YUVformat toRGBFormat Conversion Formula
The above matrix multiplication is expanded, and8 -bit RGB can be calculated directly from YUV ( level ) as follows:
R = Y + 1.402 (V-128)
G = Y-0.34414 (U-128)-0.71414 (V-128)
B = Y + 1.772 (U-128)
4 RGBformat toYCbCrFormat Conversion Formula
The YCbCr format is an offset based on the YUV format, which is translated as follows:
Y' = 0.257*r ' + 0.504*g ' + 0.098*b ' +
Cb ' = -0.148*r '-0.291*g ' + 0.439*b ' + 128
Cr ' = 0.439*r '-0.368*g '-0.071*b ' + 128
5 RGBformat toYCbCrFormat Conversion Formula
The conversion format is as follows:
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)
Introduction to the RGB2YUV of image and Yuv2rgb format