开发者

Subtracting RGB values

开发者 https://www.devze.com 2023-01-19 21:07 出处:网络
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.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消