N
N
Nikita2022-03-17 20:53:42
Mathematics
Nikita, 2022-03-17 20:53:42

How to convert three real numbers showing red, green and blue to one real number showing how bright the color is?

There are three real numbers, each of which lies in the interval [0; 1] .

The first real number shows how red the pixel is, the second how much the pixel is green, the third how much the pixel is blue, that is, the classic color representation through red, green and blue (used in JPEG ). It is necessary to convert all these real numbers into one real number lying in the interval [0; 1] and showing the brightness of a pixel. An example for some values ​​from this range:

0 - absolutely black
0.1 - almost black
0.25 - dark gray
0.5 - gray
0.75 - light gray
0.9 - almost white
1 - absolutely white




Required for loading images into the neural network. Tell me which way to think.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vilinyh, 2022-03-17
@gth-other

Google: "brightness formula of RGB color"

V
Vasily Bannikov, 2022-03-17
@vabka

Just the arithmetic average of three numbers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question