算法基于RGB值检查的颜色相似性(或者HSV) [英] Algorithm to check similarity of colors based on RGB values (or maybe HSV)

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

问题描述

我在寻找一种算法,比较RGB,色彩和产生的相似性值(其中相似的意思是就类似于avarage人类感知)。

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

任何想法?

修改

因为我不能回答了我决定把我的解决方案作为一个编辑的问题。

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

我决定去了(非常)小真彩色在我的应用程序集,让我能处理的色彩由我自己比较。我有大约30种颜色,并使用它们之间的硬codeD的距离。

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.

由于这是一个iPhone应用程序,我曾与Objective-C和实施或多或少矩阵重新presenting下表,其中显示了颜色之间的距离。

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距离在欧几里德空间是不是很相似avarage人类感知

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

您可以使用 YUV 的色彩空间,它考虑到这个因素:

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

您也可以使用 CIE 色彩空间用于此目的。

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

编辑:

我要提的是YUV色彩空间是一种廉价的近似值,可以通过简单的公式来计算。但它不是视觉上保持一致性。感知均匀意味着相同量的在彩色值的变化应产生的大约相同的视觉重要的变化。 如果你需要一个更precise和rigourous指标必须肯定会考虑CIELAB色彩空间或其它视觉上保持一致性空间(即使有没有简单的公式转换)。

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).

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

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