Grayscale or colored images for computer vision?

Kiskris report abuse

Hi everybody. I'm a software engineer but I recently become interested in computer vision. By learning different tutorials I have noticed that some of them conduct grayscaling of images as a step in preprocessing before training. But other tutorials don't include grayscaling in the image preprocessing. My question is about what is better: leave the image as it is, or transform it to grayscale?


Lu-at-Imaginghub report abuse

Hello @Kiskris

It depends on the type of objects you want to classify. There is a general question which could help you: "Is the color important for me to classify these objects?"

For example: if you want to distinguish between different type of insects, the color may be important, because the form of bugs can be the same but red bugs belong to one species and yellow bugs belong to another. On the other side, if you want to distinguish between cars body type the color is probably not important.

Best regards, Lu

Kiskris report abuse

But there can be the following situation. I think that the color is not important, but maybe the machine learning model would be able to derive some useful patterns from color. And then by performing grayscaling I will throw away some useful information from my data?

oksifoxy report abuse

When the color is not important it is better to convert images to grayscale because it is easier to work with (both for you and for the model). Accordingly, this can affect the quality of the final results. In any way, you can try both pre-processing with and without converting to grayscale and decide what is better in your case.

Add Answer

Need support?

Just drop us an email to ... Show more