Hélder Oliveira
Hélder Oliveira

Reputation: 45

Get color coordinates from image with different luminosity

I have a challenge to get the color coordinates from the same image with different luminosity: enter image description here enter image description here

The goal is get the circle color coordinates and after that check if this this two images has the same color. Can you give some ideias, how I can do this with python and openCV for instance? (Or other technologies)

Note: The image are the same (has circle with same color) but with only different luminosity.

Upvotes: 0

Views: 103

Answers (1)

user1196549
user1196549

Reputation:

You can normalize the luminance by multiplying the RGB components by 3 x 255 / (R + G + B).

Notice that the formula is singular for the black color, and you can add a small constant to the denominator to cope. Below, your two images so transformed.

enter image description here

enter image description here

This can be slightly better than getting the hue component alone, as you keep two degrees of freedom (saturation is preserved).

Upvotes: 1

Related Questions