urvi jain
urvi jain

Reputation: 59

Why are these particular values used to convert image to grayscale in python?

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.

Upvotes: 0

Views: 49

Answers (1)

Axecalever
Axecalever

Reputation: 69

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.

Upvotes: 3

Related Questions