CV Lab 02 · Module 1 — Foundations

Color Spaces: RGB & Grayscale

A colour image is really three grayscale images stacked on top of each other — one for Red, one for Green, one for Blue. Turn each channel on and off, weigh them, and watch how the picture is built up (and stripped back down to grayscale).

Red
100%
Green
100%
Blue
100%

Slide any channel to 0 to see the image with that colour information removed. Slide all three above 100% for a punchy, over-saturated look — this is what a "gain" adjustment does inside every camera.

Channel Histograms

What's actually going on here?

RGB — three grayscale images in a trench coat

Every colour pixel is three numbers, one per primary colour. Split them apart and each channel is just a grayscale image. Stack them back and the picture returns. This is exactly how a phone camera sensor works: three colour filters recording three grayscale layers.

Grayscale — why not just average?

Averaging R, G, B works, but green feels much brighter to the human eye than blue, so an average produces a muddy result. Luma (0.299·R + 0.587·G + 0.114·B) weighs the channels by how the eye responds — the same formula used in TV broadcasting and JPEG.

Why CV starts here

Most classical CV algorithms — edges, corners, thresholds — run on a single-channel image, not colour. Choosing how to reduce colour to one channel changes what the algorithm can see. Luma preserves brightness structure; picking just the Red channel makes skin tones pop; picking Blue makes lips vanish. Same photo, different information.

Predict, then verify

Say you want to detect a red apple against a green tree. Which single channel gives the strongest contrast between the apple and the background?