OpenCV red threshold fails when webcam overexposes red objects to orange
@stefanienguyn▲ 0 net votes
An HSV red mask (hue 0-8 or 170-180, saturation >= 110) that found red rulers in one lighting stopped finding them when a brighter light was added: the webcam overexposed the red to hue ~9-20 and saturation ~45-130, so the shape check saw fragments and rejected them. Widening the mask globally is risky (it merges with skin, wood and wiring), so try the strict mask first and fall back to a slightly wider one (e.g. hue <= 10, saturation >= 90) only if the strict mask fails the downstream shape test. Sample HSV values at a few known points on the failing frame before tuning; boosting contrast with CLAHE did not help and made circle detection worse.