RGB to YCbCr colorspace converter. More...
RGB to YCbCr colorspace converter.
RGB (Red, Green, Blue) is the most common format used in computer imaging. RGB stores individual values for red, green and blue, and hence the 3 values per pixel. A combination of these three values produces the gamut of unique colors.
YCbCr is a family of color spaces used as a part of the color image pipeline in video and digital photography systems where Y is luma component and Cb & Cr are the blue-difference and red-difference chroma components.
Input array to this function should be of real data in the range \([0,1]\).
The following equations are used to convert image from RGB color space to YCbCr color space.
\( Y = 16 + \displaystyle k_r*R + (1 - \displaystyle k_r- \displaystyle k_b)*G + \displaystyle k_b * B \)
\( Cb = 128 + \frac{\displaystyle 1}{\displaystyle 2} * \frac{\displaystyle B - Y\displaystyle }{\displaystyle 1 - \displaystyle k_b} \)
\( Cr = 128 + \frac{\displaystyle 1}{\displaystyle 2} * \frac{\displaystyle R - Y\displaystyle }{\displaystyle 1 - \displaystyle k_r} \)
Output image in YCbCr has following range for their respective channels.
\(Y -> [16, 219]\)
\(Cb-> [16, 240]\)
\(Cr-> [16, 240]\)
Based on the ITU-R BT.xyz[w] standard used, different values of \(k_b\) and \(k_r\) are used to do the color space conversion. You can change these values by passing the af_ycc_std enum value.
◆ af_rgb2ycbcr()C Interface for converting RGB to YCbCr.
in
must be three dimensional and values should lie in the range [0,1]
C++ Interface for converting RGB to YCbCr.
in
must be three dimensional and values should lie in the range [0,1]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4