How to match color [closed]

asked 2016-06-09 03:11:15 -0600

damiya14 gravatar image

updated 2016-06-09 03:12:48 -0600

I am trying to do a vehicle color recognition program. I have managed to extract the color from vehicle. I can get the color histogram too.

Now i am stuck in matching the extracted color with a predefined color.

  1. How can i predefined colors (red,blur,green,black,white and etc)?
  2. How can i compare the extracted color with the predefined color?
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-11 13:28:49.194199

Comments

There is many ways to define a color BGR HSV Luv... First choose color space. Then you can define distance (metric see wikipedia) between two colors. See Macadam ellipse

LBerger gravatar imageLBerger ( 2016-06-09 03:49:54 -0600 )edit

i am using HSV. I can compare to histogram and take the distance.

But i don't know how to define a histogram for a color (red,blue,black,white,etc)

damiya14 gravatar imagedamiya14 ( 2016-06-09 04:09:45 -0600 )edit

If you are trying to achieve a formula to make the color, then you must cross over from RGB to RYB, and that is the tough one. The problem with color is there are additive (paint mixing) and subtractive (computer screen) color formulas. They are very, very different. I came across a formula that was supposed to be it...you could find it with a little Google searching. Computers are too precise..and automotive colors fade with UV exposure.

jmbapps gravatar imagejmbapps ( 2016-06-09 07:01:38 -0600 )edit

so because of the environmental reasons the color systems changes. so when i put thresholds to colors i should make it relative to something. using table of color with constant threshold will not work in practical scenario. so what should i do for this? what methods should i use??

damiya14 gravatar imagedamiya14 ( 2016-06-13 10:06:29 -0600 )edit

There is no method. Spend 5 minutes researching RGB to RYB conversion. You need to figure out the processing for yourself.

jmbapps gravatar imagejmbapps ( 2016-06-13 10:19:23 -0600 )edit

RYB or HSV? because when i googled lot of people has said that HSV is the best way.

damiya14 gravatar imagedamiya14 ( 2016-06-13 11:33:00 -0600 )edit

RYB isnt available as an option, since it is not additive. All I am saying is if you are trying to get a paint formula to mix paint to use in real life, then you have to convert to RYB. You cannot mix paint using RGB, CMYK, HSV or any other computer (additive) colors. Paint uses subtractive color theory. Computers use additive color theory. If you are keeping it digital and the color will never be made in real life, then disregard all I have said.

jmbapps gravatar imagejmbapps ( 2016-06-13 19:04:09 -0600 )edit

i am not trying to mix colors. i am using this system for vehicle identification. so as you say for that HSV is ok, as i am not mixing color for real right?

damiya14 gravatar imagedamiya14 ( 2016-06-14 01:17:21 -0600 )edit

If you are looking for an ID from colors, then use whatever gives you the most accurate results. It will be darker without sun, and brighter in the sun. Im not sure how you will adjust for that, plus shadows and so on. Good luck. I would use the license plate for ID, but that is just me.

jmbapps gravatar imagejmbapps ( 2016-06-14 08:46:43 -0600 )edit