Getting and comparing object's color from image
My aim is to determine the color of object. And make a classification, for example some blue, little bit dark blue or light blue can be classified to one type - Blue. I have some template objects images. There are many of them. What I want is to group this images manually. For example some objects have blue colored text, but some areas of yellow etc. By some algorithm at first I group them manually, and then each group should be analyzed by computer to make some feature extraction. And then while getting from camera as video or image of the random selected object, I want to identify it's group correctly. How can I do it? Which features should be extracted and how can they b开发者_开发百科e compared? I was thinking of histogram of a Hue plane in HSV. But don't know what features to get from that histogram and then to compare it with another(from template images)
EDIT 1: Example of images that should be classified, later will post more if neccessary. image example
It is always good to use the LAB color space in order to mimic human perception.
http://en.wikipedia.org/wiki/Lab_color_space
That is because the Euclidean metric in this color space represents the perceptual distance between colors, that is, how close they are.
You should cluster by A,B and ignore L value which is the brightness.
HSV can be tricky to use in varying light situations. This is especially true outside, where shadows are a lot bluer than sunlight areas.
Ideally, you can use the hue and saturation components and ignore the value component. This would make the distance between a light blue and a dark blue very small:
dist = sqrt((h1 - h2)^2 + (s1 - s2)^2
The gotcha is that hue is actually a continuous scale (like an angle). The difference between 255 and 0 should only be 1.
精彩评论