The simplest way to find a red ball: keep the pixels that look red and ignore the rest.
Key idea
Thresholding tests every pixel and keeps those that pass, making a black-and-white mask. A simple redness test: keep pixels where $r - \dfrac{g + b}{2} > T$ for some threshold $T$.
Why it works
A pure red has a big red number and small green and blue. White is bright in all three, so plain "red > 150" would wrongly keep white. Subtracting the other channels asks how much more red there is, which is closer to what our eyes call red.
Worked example: Test a pixel
Pixel (200, 80, 60), $T = 60$.
- $(80 + 60)/2 = 70$.
- $200 - 70 = 130 > 60$.
Answer: It passes.
Common mistake
Setting one threshold in a bright room and being surprised when it fails in a dim one. Light changes all the numbers; many robots use color spaces such as HSV that separate color from brightness.