计算像素的强度或灰度值 [英] Calculating the intensity or gray level value of a pixel

查看:157
本文介绍了计算像素的强度或灰度值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在图像上执行直方图均衡。为此,我需要将像素强度值存储在一个数组中。

如何在C#中获得像素的强度或灰度值(0-255)

请帮助。



谢谢:)

I want to perform Histogram Equalization on an image. For that i need to store the pixel intensity values in an array.
How can i get the intensity or gray scale value (0-255) of a pixel in C#
Pls help.

Thanks :)

推荐答案

有几种颜色模型,也称为色彩空间 [ ^ ]( http://en.wikipedia.org / wiki / List_of_color_spaces_and_their_uses [ ^ ])。像素可以用任何颜色表示 - 但并非所有颜色空间都存在所有颜色。颜色空间定义颜色的组件。在一般监视器屏幕上,您使用RGB(红 - 绿 - 蓝),但例如排版中使用的颜色模型是CMYK(青色 - 品红 - 黄 - 黑)。但还有更多。您计算机上的图像文件最有可能是RGB或CMYK。



有一种名为HSI(色调 - 饱和度 - 强度)的颜色模型,您可能会觉得有用你对强度部分感兴趣。 RGB的转换非常简单,如下所述: http://fourier.eng.hmc。 edu / e161 / lectures / color_processing / node3.html [ ^ ]。我建议你先咨询这篇文章,但是如果不符合你的需要,也可以尝试其他的颜色空间。

你也可以使用这样的工具来获得颜色组件的实用见解: http://www.workwithcolor.com/color-converter-01.htm [ ^ ]
There are several color models, also known as color spaces[^] (http://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses[^]). A pixel can be represented in any of them - but not all colors are present in all color spaces. A color space defines components of a color. On a general monitor screen you use RGB (red-green-blue) but for example the color model used in typography is the CMYK (cyan-magenta-yellow-black). But there are more. An image file on your computer is most likely in RGB or CMYK.

There is a color model called HSI (hue-saturation-intensity), you might find useful if you are interested in the intensity part. The conversion from RGB is quite simple, as described here: http://fourier.eng.hmc.edu/e161/lectures/color_processing/node3.html[^]. I suggest you consult this article first, but if does not fits your needs, try other color spaces too.
You can play around also with tools like this to get a practical insight on color components: http://www.workwithcolor.com/color-converter-01.htm[^]


这篇关于计算像素的强度或灰度值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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