Subtracting RGB values
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.
精彩评论