Which algorithm is used to convert rgb to grayscale?
Answers
Answered by
1
The basic 'algorithm' is to find three parameters, ,,
a
,
b
,
c
, and set the gray-level value at each pixel,
y
, as =++
y
=
a
R
+
b
G
+
c
B
.
The naive way to set ,,
a
,
b
,
c
is just an average: ===1/3
a
=
b
=
c
=
1
/
3
. However, in practice this is not the case, and the parameters are based on the human visual systems: we do not see each color as a 'third' of the intensity, but rather we see more green than red and blue.
Empirical research can get a good estimate of these parameters, and the final value is set to (approximately) =0.3+0.6+0.1
y
=
0.3
R
+
0.6
G
+
0.1
B
, so that the single-channel (gray-level) image best corresponds with our perception of color intensities.
Similar questions