我有许多颜色的衣服图像,我想检测每个图像的颜色。假设我在日光条件下有蓝色裙子图像,我可以通过RGB分布获得正确的颜色。然而,在晚上很难分辨颜色,蓝色被认为是黑色。通过RGB分布来制定统一标准非常难以指定颜色。
I have a bunch of images of clothes of many colors and I want to detect the colors of each image. Say that I have a blue skirt image in daylight conditions and I can get the correct color through RGB distributions. However, at night it's difficult to tell the color and the "blue" is recognized as "black". It's very hard to make a unified standard to specify colors through RGB distributions.
因此,我想知道是否有一种方法或算法可以检测不同照明下的颜色?
As such, I am wondering is there a way or algorithm to detect colors under different illuminations?
顺便说一句:我也尝试过HSV色彩空间,结果不太好。
BTW: I also tried HSV color space and the results were not good.
推荐答案这是一个非常棘手的问题,今天仍在努力解决。它的要点是使用一组代表性的图像基本颜色找到颜色量化。对不同的外部刺激有很强的抵抗力......光线,阴影,光线不足等。
That's a very hard problem and it's still trying to be solved today. The gist of it is to find a colour quantization using a representative set of basic colours of an image that is robust against different external stimuli... lighting, shade, poor illumination etc.
不幸的是,我不能建议任何一种算法可以为所有人做这项工作案例。但是,过去对我有用的一种算法就是我在图像检索方面的工作。具体来说,来自柯达研究实验室的Jiebo Luo和David Crandall的工作: http://愿景。 soic.indiana.edu/papers/compoundcolor2004cvpr.pdf
Unfortunately I can't suggest any one algorithm that would do the work for you for all cases. However, one algorithm that has worked for me in the past was when I was doing work in image retrieval. Specifically, the work by Jiebo Luo and David Crandall from Kodak Research Labs: vision.soic.indiana.edu/papers/compoundcolor2004cvpr.pdf
基本算法是看看 ISCC-NBS调色板集。此外,这个链接更富有成效: tx4.us/nbs-iscc.htm。它是一组267种颜色,代表了我们今天在现代社会中看到的颜色。通常当我们描述颜色时,我们有一组一个或多个形容词,然后是主色调。例如,那件衬衫是浅蓝色或浅黄色等。这个算法的优点在于,当所讨论的颜色受到不同的外部刺激时,我们拥有所有这些形容词赋予颜色意义,但在一天结束时,颜色的最后一部分 - 主导色调 - 就是我们所追求的。
The basic algorithm is to take a look at the ISCC-NBS colour palette set. Also, this link is much more fruitful: tx4.us/nbs-iscc.htm. It is a set of 267 colours that are representative of the colours that we see in modern society today. Usually when we describe colours, we have a set of one or more adjectives, followed by the dominant hue. For example, that shirt is a darkish pale blue, or a light bright yellow, etc. The beauty of this algorithm is that when the colour in question is subject to different external stimuli, we have all of these adjectives that give meaning to the colour, but at the end of the day, the last part of the colour - the dominant hue - is what we're after.
这些颜色中的每一种都有一个相关的RGB值。这些颜色转换为 CIE Lab 颜色空间,形成267 CIE Lab查找表。
Each of these colours has an associated RGB value. These colours are transformed into the CIE Lab colour space which form a 267 CIE Lab lookup table.
要对特定输入颜色进行分类,您可以将此输入的RGB值转换为CIE Lab颜色空间,然后确定与此查找表最接近的颜色。已经表明,CIE Lab颜色空间中两种颜色之间的欧几里德距离最能代表人类对颜色的感知差异。一旦我们确定查找表中哪个位置颜色最接近,我们就会去除所有形容词,看看主色调是什么,然后我们相应地对该颜色进行分类。
To classify a particular input colour, you would transform this input's RGB values into the CIE Lab colour space, then determine the closest colour to this lookup table. It has been shown that the Euclidean distance between two colours in the CIE Lab colour space best represents the difference in human perception of colours. Once we determine which location in the lookup table the colour is closest to, we strip out all of the adjectives and see what the dominant hue is and we thus classify that colour accordingly.
例如,如果我们有一个RGB像素并将其转换为Lab,则发现最接近的颜色为亮黄色,我们将删除明亮,代表该RGB像素的最终颜色将为黄色。
For example, if we had a RGB pixel and we converted it to Lab, then found that the closest colour was bright yellow, we would remove the "bright" and the final colour that is representative of that RGB pixel would be yellow.
因此,最终算法如下:
希望这会有所帮助!
Hope this helps!
更多推荐
如何在不同光照条件下检测颜色
发布评论