R,G和B系数的这些值来自哪里?
问题描述:
https://rosettacode.org/wiki/Grayscale_image#C.23R,G和B系数的这些值来自哪里?
Bitmap tImage = new Bitmap("spectrum.bmp");
for (int x = 0; x < tImage.Width; x++)
{
for (int y = 0; y < tImage.Height; y++)
{
Color tCol = tImage.GetPixel(x, y);
// L = 0.2126·R + 0.7152·G + 0.0722·B
double L = 0.2126 * tCol.R + 0.7152 * tCol.G + 0.0722 * tCol.B;
tImage.SetPixel(x, y, Color.FromArgb(Convert.ToInt32(L),
Convert.ToInt32(L), Convert.ToInt32(L)));
}
}
// Save
tImage.Save("spectrum2.bmp");
我们从哪里找到这些// L = 0.2126·R + 0.7152·G + 0.0722·B
值?
答
你可以找到ITU (International Telecommunication Union)建议ITU BT.709
Parameter values for the HDTV standards for production and international programme exchange
请参阅第4
的信息可以看到旧版本here
[维基百科上的灰度(https://开头的连接。 wikipedia.org/wiki/Grayscale) – TaW