减去 RGB 值
我正在做一些图像方面的工作;我不想将它们转换为灰度,因为我想考虑颜色。如您所知,通过灰度,不同的颜色可以具有相同的灰度值。
如果我从一个像素中减去另一个像素的 RGB 值,我认为它们仍然会有偏差?也就是说,我需要使用亮度方程对结果值进行加权,而不是仅仅将它们相加/平均?
I'm doing some work with images; I don't want to convert them to grayscale because I want to factor in the color. As you know, with grayscale, different colors can have the same grayscale value.
If I were to subtract RGB values of one pixel from another, I assume that they will still have skew? That is to say, I would need to weight the resulting values using the luminance equation, rather than just adding/averaging them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看 YUV(或 HSV),它通常更适合对彩色图像进行图像处理
Take a look at YUV (or HSV) it's ussualy much better for doing image processing on color images
通常,您可以平均红色、绿色和蓝色以获得相当好的灰度图像。您可能需要稍后调整对比度,具体取决于图像。
You can usually average Red, Green, and Blue to get a pretty good grayscale image. It's possible you might want to adjust the contrast afterward, depending on the image.