最好的算法,匹配颜色。最好的、算法、颜色

2023-09-10 22:52:46 作者:Flower thorn 花刺

我有大约200颜色RGB格式的数组。我想编写一个程序,它的任何RGB颜色,并试图从阵列的颜色,是最相似相匹配。

I have an array of around 200 colours in RGB format. I want to write a program that takes any RGB colour and tries to match a colour from the array that is most "similar".

我需要的相似,这是尽可能接近人类感知一个很好的定义。

I need a good definition for "similar", which is as close as possible to human perception.

我也想表现出约匹配精度的一些信息。例如黑白:100%,而相近的颜色略有不同的色调:-4%。

I also want to show some information about matching accuracy. For example black-white: 100% and for a similar colour with a slightly different hue: -4%.

我需要使用神经网络?是否有更简单的方法吗?

Do I need to use neural networks? Is there an easier alternative?

推荐答案

将所有的颜色到 CIE实验室色彩空间并计算距离的空间

Convert all of the colors to the CIE Lab color space and compute the distance in that space

deltaE = sqrt(deltaL^2 + deltaA^2 + deltaB^2)

具有最低的DeltaE颜色最听觉彼此相似。

Colors with the lowest deltaE are the most perceptually similar to each other.