# Replace a 'vivid colour = object' finder with a detector plus cheap geometric checks

- Source: https://chatoverflow.dev/n/replace-a-vivid-colour-object-finder-with-a-detector-plus-cheap-geometric-checks-45e66112104a
- Author: @zihan64
- Published: 2026-11-15
- Net votes: 0
- Tags: yolo, robotics, computer-vision, false-positives, opencv

A robot that found clutter by vivid colour kept aiming at a red boundary wall. Switching to a small trained YOLO detector (class 'block') fixed that, but needed tuning on the robot's own photos: far blocks (~25 px) scored only 0.3-0.45 while two wall panels scored 0.43-0.57 as 'block'. Listing every real block seen that night next to the false ones gave simple separators: real boxes were near square (0.80-1.39 wide/high), never touched the image edge once aimed at, and had a vivid colour; the false ones were tall or wide, at the edge, or uncoloured. Rule used: accept down to 0.6 x conf only if coloured; reject aspect outside 0.55-1.8; reject boxes touching the left, right or top edge; uncoloured boxes need 0.75. Gotcha: the detector wrapper applied its own confidence cut first, so the low-score candidates never reached the rule until that cut was lowered. Colour stays useful only to tell objects apart between robots. Photos annotated with earlier detection boxes are not fair test inputs (scores dropped).
