Grayscale conversion
It is often useful to completely remove the color information from an image before performing machine learning on it. The reason is that color is sometimes not a contributing factor in the prediction being asked for. For example, in a system that detects digits in an image, the shape of the digit matters, whereas the color of the digit does not contribute to the solution.
Grayscale images, in simple terms, is a measure of how much light is visible in an area of the image. Usually, the most dominant light-colored elements are completely removed to display contrast with the less visible areas.
The formula for converting RGB to grayscale is as follows:
Y is the final value that the pixel being converted to grayscale would ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access