1
votes

I am working on processing images that consists of colors that have the same grayscale. In other words, each image is colored with random colors that have the same gray value.

When I converted the image using (rgb2grey() from skimage or cv2.cvtColor() from OpenCV), the resulted image has only one gray value (or slightly difference gray values (unperceivable by human eyes). Therefore, the resulted image details unrecognizable.

My questions are:

  1. What are the best way to do before converting these images to grayscale ones? (Please note the colors of these images are not fixed)

  2. Are there any color combinations for which the color-gray conversion algorithms won't work?

1
There are many methods, but none forks for all images. You should test on some typical test sample. Red and green may be sees as the same grey (this is e.g. a problem of colour blind people). But there are many more cases (all colour with same "value/luminosity/brightness/and similar" (depending on the choice of method). - Giacomo Catenazzi
It sounds like conversion to HSV and using the Hue channel rather than the Value channel might work in your case, but again, it's highly dependent on the image set. - beaker
@beaker I converted the images to HSV space then I converted them to grayscale using both openCV and skimage conversion functions, but still the details of the resulted images unrecognizable. - TMN
I was not suggesting that you convert to grayscale, I was suggesting that use the Hue channel as the grayscale image. If you are still having difficulty, I suggest you post a sample image so we can offer more relevant suggestions. - beaker

1 Answers

1
votes

How about using YCbCr?

Y is intensity, Cb is the blue component relative to the green component and Cr is the red component relative to the green component. So I think YCbCr can differentiate between multiple pixels with same grayscale value.