79523178

Date: 2025-03-20 14:03:48
Score: 1
Natty:
Report link

Phew! There is a lot going on in here, but the problem turned out not to be OpenCV’s inRange() itself but how its boundary arguments were provided. Although many examples show using NumPy arrays, in some cases (like yours) OpenCV ends up “rejecting” the type if it isn’t a numerical tuple. A common workaround (if you’d like to keep the NumPy array approach) is to explicitly convert them to a tuple when calling inRange:

mask = cv2.inRange(hsvImage, tuple(lowerb.tolist()), tuple(upperb.tolist()))

Btw your comment says “Yellow in RGB” but you pass [0,255,255]—which in BGR actually is yellow. OpenCV uses BGR by default!

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Eyeball