A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrayfire.org/docs/group__image__func__rgb2ycbcr.htm below:

ArrayFire: rgb2ycbcr

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.

Parameters
[out] out is an array in the YCbCr color space [in] in is an array in the RGB color space [in] standard specifies the ITU-R BT "xyz" standard which determines the Kb, Kr values used in colorspace conversion equation
Returns
AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.
Note
in must be three dimensional and values should lie in the range [0,1]
◆ rgb2ycbcr()

C++ Interface for converting RGB to YCbCr.

Parameters
[in] in is an array in the RGB colorspace [in] standard specifies the ITU-R BT "xyz" standard which determines the Kb, Kr values used in colorspace conversion equation
Returns
array in YCbCr colorspace
Note
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