使用VB.Net或C#进行颜色比较 [英] color comparison using VB.Net or C#

查看:103
本文介绍了使用VB.Net或C#进行颜色比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家



我需要构建一个简单的应用程序,以匹配参考标准的颜色。更具体的是,我将扫描36种颜色的标记颜色(将作为参考标准)我将在同一扫描仪上扫描测试颜色(以避免设备间的变化)。应用程序应将颜色与标准调色板进行比较,并在匹配时发出警报。我想知道visual studio是否有工具进行颜色比较。



提前谢谢

Dear Experts

I need to build a simple application to match a color with a reference standard. to be more specific i will scan a tagged color palate of 36 colors (will serve as a reference standard) I will scan the test color on the same scanner (to avoid inter-device variations). The application should compare the color to the standard palette and alert if there is a match. I wonder if visual studio has a tool to do the color comparison.

Thanks in advance

推荐答案

颜色比较永远不会非常准确,因为有许多因素,如扫描仪捕获亮度的能力,周围的光等。你也有像α校正等因素,虽然可以计算,但可以使计算相当复杂。



一个简单的解决方案,被认为并不总是准确的,是使用色调,饱和度和亮度 [ ^ ]比较和对比像素颜色。



基于HSL的比较描述此处 [ ^ ]并形成一个有趣的阅读。

色差 [ ^ ]提供了一些解释。
Color comparison can never be very accurate since there are a number of factors like capability of the scanner to capture brightness, the surrounding light etc involved. You also have factors like alpha correction etc, which although calculable, can make the calculations quite complex.

An easy solution, thought not always accurate, is to use hue, saturation and luminosity[^] to compare and contrast pixel colors.

Comparing based on HSL is described here[^] and it forms an interesting read.
Color Difference[^] provides some explanations.


据我所知,没有内置的这样做的组件。

您必须比较测试图像中给定点的颜色编码,并在标准颜色数组中找到相同的颜色。



你可能想看一下,在.NET中操作颜色 - 第1部分 [ ^ ],它不是你想要的,但它有一些你可能觉得有用的东西。



您可能还需要考虑使用颜色空间进行匹配,例如 CIE XYZ [ ^ ]而不是使用.Net RGB这样的颜色模型,因为模型和空格之间的转换比较困难不一定容易,但空间r现实的颜色,模型就是这样,模型和给定点的颜色取决于输出设备。



Mike
To my knowledge there is no built-in component to do that.
You would have to compare the encoding of the colour at a given point in the test image and find the same colour in an array of the colours in the standard.

You might want to look at, Manipulating colors in .NET - Part 1[^], it''s not what you want but has some stuff in it that you might find useful.

You may also want to consider doing the matching with a colour space such as CIE XYZ[^] rather than using colour models, like .Net RGB, which is harder since conversions between models and spaces is not necessarily easy, however spaces represent real colours, models are just that, models and what colour a given point is depends on the output device.

Mike


在我撰写的一篇文章中[ ^ ] ,有一个关于色差方程的部分。我认为Delta E 2000等式可能会有所帮助。
In an article I wrote [^], there is a section on color difference equations. I think the Delta E 2000 equation may be helpful.


这篇关于使用VB.Net或C#进行颜色比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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