Skip to content

Instantly share code, notes, and snippets.

@ha7ilm
Created December 30, 2024 09:59
Show Gist options
  • Save ha7ilm/beeb68dd1d4d9fd33b175d13b77569e0 to your computer and use it in GitHub Desktop.
Save ha7ilm/beeb68dd1d4d9fd33b175d13b77569e0 to your computer and use it in GitHub Desktop.
opencv error

Scalar value for argument 'color' is not numeric

I got this with OpenCV 4.2.0 from cv2.rectangle, where start_point was a list, end_point was a tuple:

cv2.rectangle(rect_mask, start_point_2, end_point, 1, -1)

To fix:

cv2.rectangle(rect_mask, tuple(start_point_2), end_point, 1, -1)

Bottom line is that the OpenCV parses the args weirdly sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment