检查颜色的相似性的算法 [英] Algorithm to check similarity of colors

查看:198
本文介绍了检查颜色的相似性的算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种比较两种RGB颜色并生成其相似性值的算法(其中相似性意味着相对于平均人类感知相似)。



任何想法?



EDIT



决定把我的解决方案作为一个编辑的问题。



我决定在我的应用程序中使用一个(非常)真彩色的小子集,我可以处理颜色的比较我自己。我使用大约30种颜色,并使用它们之间的硬编码距离。



由于这是一个iPhone应用程序,我与objective-C,实现是或多或少



解决方案

在欧几里德空间中的RGB距离不是非常类似于avarage人类感知



您可以使用颜色空间。



编辑



我将提到YUV颜色空间是一种便宜的近似,可以通过简单的公式计算。但它不是感觉上统一。感觉上均匀意味着在颜色值中相同量的变化应当产生大约相同的视觉重要性的变化。
如果你需要一个更精确和严格的指标,你一定要考虑CIELAB色彩空间或另一个知觉均匀的空间(即使没有简单的公式进行转换)。


I'm looking for an algorithm that compares two RGB colors and generates a value of their similarity (where similarity means "similar with respect to average human perception").

Any ideas?

EDIT:

Since I cannot answer anymore I decided to put my "solution" as an edit to the question.

I decided to go with a (very) small subset of true-color in my app, so that I can handle comparison of colors by my own. I work with about 30 colors and use hard-coded distances between them.

Since it was an iPhone app I worked with objective-C and the implementation is more or less a matrix representing the table below, which shows the distances between the colors.

解决方案

RGB distance in the euclidean space is not very "similar to avarage human perception"

You can use YUV color space, it takes into account this factor :

You can also use the CIE color space for this purpose.

EDIT:

I shall mention that YUV color space is an inexpensive approximation that can be computed via simple formulas. But it is not perceptually uniform. Perceptually uniform means that a change of the same amount in a color value should produce a change of about the same visual importance. If you need a more precise and rigourous metric you must definitely consider CIELAB color space or an another perceptually uniform space (even if there are no simple formulas for conversion).

这篇关于检查颜色的相似性的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆