Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to detect the same color in dark and light conditions.
I am already able to detect colors, but it depends on light conditions.
How can I fix this?
Thanks.


What I have tried:

R=r*255/(r+g+b)
G=g*255/(r+g+b)
B=b*255/(r+g+b)
Posted
Updated 25-Mar-18 7:45am

Quote:
I want to detect the same color in dark and light conditions.

This have nothing to do with programming, it is off topic.
Quote:
but it depends on light conditions.

That is exactly the problem, there is more than 1 light, and its strength is not the only varying part, its color vary too.
The only reliable way to go is for each picture you want to compare, you need a reference part that you will use to detect the difference of light between picture and then do color correction to compare.
 
Share this answer
 
Comments
Member 10850253 29-Mar-18 16:20pm    
If I use the flash just to recognize the color, would that solve the light issue?
Patrice T 29-Mar-18 16:36pm    
It may help but is not necessary the solution.
There is an easy way to know: Take a sheet of paper will parts colored. Then take a picture with and without flash with different kind of lighting.
in dark, artificial light, day light (no sun), on the sun ....
then compare the colors and see if you got matches or not.
How? Change the laws of physics.

Not only does the brightness of light source change the color of an object, so does the color and composition of the light illuminating the object you're looking at.
 
Share this answer
 
Comments
Member 10850253 25-Mar-18 16:49pm    
What I wanted to say was that I want to detect the true color in every light condition, but from what airline just read, this isn't possible.
Please correct me if I'm wrong.
Dave Kreskowiak 26-Mar-18 8:15am    
The only way you can do that is if you knew everything about the light sources involved in illuminating the target object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900