A colour threshold can be useful for isolating a region in a controlled image. It should not be mistaken for a general material or product recognition system.
OpenCV demonstrates colour-space conversion and range selection for extracting coloured regions. OpenCV — colour.
Inspect competing regions
For a toy photograph, a matching background or shadow may enter the selected range. Compare the resulting mask with the original image rather than judging only whether the desired area appears.

Define operating conditions
Evaluate the relevant lighting and camera setup. A range selected from one photograph may not transfer to another. If the decision requires product identity or a precise contour, determine what additional representation and evidence the task needs.

Source reviewed 25 October 2026. Interpretation and original diagrams: PLUSHIP / Qunhe. Examples are illustrative.
Related reading
Adaptive Thresholding Responds to Local Image Conditions
Combining Models Helps Only Under the Actual Evaluation Conditions
Read the Conditions Behind an Average-Precision Detection Score
