匹配颜色的最佳算法. [英] Best algorithm for matching colours.

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

问题描述

我有一个大约 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?

推荐答案

将所有颜色转换为 CIELab色彩空间并计算该空间中的距离

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.

这篇关于匹配颜色的最佳算法.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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