颜色之间的相似性 [英] Similarity Between Colors

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

问题描述

我在写一个程序,与图像一起工作,在某种程度上,我需要后化的图像。

I'm writing a program that works with images and at some point I need to posterize the image. This means I need to bin the colors, but I'm having trouble deciding how to tell how close one color is to another.

在RGB中给出一个颜色,我可以使用一个颜色来表示颜色。想想至少有两种方法可以看到它们有多不同:

Given a color in RGB, I can think of at least 2 ways to see how different they are:


  1. | r1 - r2 | + | g1-g2 | + | b1-b2 |

  2. sqrt((r1 - r2)^ 2 +(g1 - g2)^ 2 +(b1 - b2)^ 2)

如果我搬到HSV,我可以想出其他方法。

And if I move into HSV, I can think of other ways of doing it.

问,忽略速度,什么是最好的方式告诉如何相似的两种颜色?

So I ask, ignoring speed, what is the best way to tell how similar two colors are? Best meaning most accurate to the human eye.

推荐答案

看看这里

http://en.wikipedia.org/wiki/Color_difference

http://en.wikipedia.org/wiki/Euclidean_distance

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

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