如何比较两种颜色

如何比较两种颜色

本文介绍了如何比较两种颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设计一个程序,可以帮助我5 pre定义颜色哪一个更类似于一个可变的色彩,并用多少比例的评估。问题是,我不知道该怎么做一步的手动步骤。所以也就更难以想到的方案。

I want to design a program that can help me assess between 5 pre-defined colors which one is more similar to a variable color, and with what percentage. The thing is that I don't know how to do that manually step by step. So it is even more difficult to think of a program.

更多细节:颜色是从管凝胶,由于不同颜色的照片。我有5个管用不同的颜色分别为每个被重新的1 5的水平presentative。我想利用其他样品,并在电脑上的照片,以评估其水平样本属于比较颜色,我想知道,用近似的百分比了。我想一个程序,它是这样的:http://www.colortools.net/color_matcher.html

More details: The colors are from photographs of tubes with gel that as different colors. I have 5 tubes with different colors were each is representative of 1 of 5 levels. I want to take photographs of other samples and on the computer assess to which level that sample belongs by comparing colors, and I want to know that with a percentage of approximation too. I would like a program that does something like this: http://www.colortools.net/color_matcher.html

如果你能告诉我采取什么步骤,即使他们的事情,我想和做手工。这将是非常有益的。

If you can tell me what steps to take, even if they are things for me to think and do manually. It would be very helpful.

推荐答案

请参阅维基百科上色差文章权线索。基本上,你要计算在一些多维色彩距离度量。但RGB不是视觉上保持一致性,所以你的欧几里德RGB距离度量由瓦迪姆建议将不匹配的颜色之间的人类感知距离。一开始,的L * a * b *表旨在是一个感知上一致的色彩空间,并且DeltaE值度量是常用。但也有更精致的色彩空间和更精致的DeltaE公式,更接近匹配的人类感知。

See Wikipedia's article on Color Difference for the right leads.Basically, you want to compute a distance metric in some multidimensional colorspace.But RGB is not "perceptually uniform", so your Euclidean RGB distance metric suggested by Vadim will not match the human-perceived distance between colors. For a start, L*a*b* is intended to be a perceptually uniform colorspace, and the deltaE metric is commonly used. But there are more refined colorspaces and more refined deltaE formulas that get closer to matching human perception.

您将有更多地了解色彩空间和照明做转换。但对于一个快速公式比欧几里德RGB指标更好,只是这样的:假设你的RGB值都在sRGB的色彩空间,找到sRGB进行的L * a * b *的转换公式,转换sRGB的色彩来的L * a * b *表,和计算的DeltaE你的两个的L * a * b *值之间。这不计算成本的,它只是一些非线性公式和一些乘法,并补充说。

You'll have to learn more about colorspaces and illuminants to do the conversions. But for a quick formula that is better than the Euclidean RGB metric, just do this: assume that your RGB values are in the sRGB colorspace, find the sRGB to L*a*b* conversion formulas, convert your sRGB colors to L*a*b*, and compute deltaE between your two L*a*b* values. It's not computationally expensive, it's just some nonlinear formulas and some multiplies and adds.

这篇关于如何比较两种颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 23:48