0

I am trying to convert my RGB image to Grayscale. While doing it, I came across the code:

np.dot(rgbImage[...,:3], [0.299, 0.587, 0.114])

Can anyone please explain this line and values taken.? (Please don't provide any Wikipedia link) searching for a simple explanation.

urvi jain
  • 49
  • 8
  • @ThierryLathuille Maybe, but colour conversions are a common thing in programming, comparable to e.g. text encoding. The way it is formulated, the question is perhaps too specific, but I think it is _good enough_. – zvone Jul 31 '20 at 11:41
  • It is based on a standard. It balances the human eye response. –  Jul 31 '20 at 15:27

1 Answers1

3

It is like converting into Grayscale using weighted or Luminosity method

Luminosity = 0.299 × R + 0.587 × G + 0.114 × B

It means 29.9% for RED, 58.7% for Green, and 11.4% Blue.

Axecalever
  • 69
  • 5