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__rgb2gray.htm below:

ArrayFire: rgb2gray

RGB to Grayscale colorspace converter. More...

RGB to Grayscale 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.

Grayscale is a single channel color space where pixel value ranges from 0 to 1. Zero represents black, one represent white and any value between zero & one is a gray value

The grayscale internsity of a pixel is calculated using the following formula:

\f$gray = R*rPercent + G*gPercent + B*bPercent\f$

=======================================================================

◆ af_rgb2gray()

C Interface for converting RGB to gray.

Parameters
[out] out is an array in target color space [in] in is an array in the RGB color space [in] rPercent is percentage of red channel value contributing to grayscale intensity [in] gPercent is percentage of green channel value contributing to grayscale intensity [in] bPercent is percentage of blue channel value contributing to grayscale intensity
Returns
AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.
Note
in must be three dimensional for RGB to Grayscale conversion.
◆ rgb2gray() AFAPI array rgb2gray ( const arrayin, const float  rPercent = 0.2126f, const float  gPercent = 0.7152f, const float  bPercent = 0.0722f  )

C++ Interface for RGB to gray conversion.

Parameters
[in] in is an array in the RGB colorspace [in] rPercent is percentage of red channel value contributing to grayscale intensity [in] gPercent is percentage of green channel value contributing to grayscale intensity [in] bPercent is percentage of blue channel value contributing to grayscale intensity
Returns
array in Grayscale colorspace
Note
in must be three dimensional for RGB to Grayscale conversion.

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