减去 RGB 值

发布于 2024-09-26 18:50:59 字数 150 浏览 0 评论 0原文

我正在做一些图像方面的工作;我不想将它们转换为灰度,因为我想考虑颜色。如您所知,通过灰度,不同的颜色可以具有相同的灰度值。

如果我从一个像素中减去另一个像素的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奢欲 2024-10-03 18:50:59

看看 YUV(或 HSV),它通常更适合对彩色图像进行图像处理

Take a look at YUV (or HSV) it's ussualy much better for doing image processing on color images

风轻花落早 2024-10-03 18:50:59

通常,您可以平均红色、绿色和蓝色以获得相当好的灰度图像。您可能需要稍后调整对比度,具体取决于图像。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文